Write a query to display the name of all building types that ends with letter 'l'. Display the records in ascending order based on name.Note:1. Display only the name of building types that ends with L from building_type table.2. Order by is mandatory3. Compare your executed result with the sample output given below.
Question
Write a query to display the name of all building types that ends with letter 'l'. Display the records in ascending order based on name.Note:1. Display only the name of building types that ends with L from building_type table.2. Order by is mandatory3. Compare your executed result with the sample output given below.
Solution
Here is the SQL query you need to write to get the desired output:
SELECT name
FROM building_type
WHERE name LIKE '%l'
ORDER BY name ASC;
Let's break down this query:
SELECT name FROM building_type: This part of the query is selecting the column "name" from the table "building_type".WHERE name LIKE '%l': This is a condition that filters the results to only include rows where the "name" ends with the letter 'l'. The '%' is a wildcard character that matches any sequence of characters.ORDER BY name ASC: This part of the query sorts the results in ascending order by the "name".
Similar Questions
Write a query to display all the building details in which building_type named ‘Library’. Display the records in ascending order based on their owner_name.Note:1. Display all the column present in the building table where building_type name is ‘Library’. Use subqueries to achieve this.2. Tables involved are building_type and building3. Order by is mandatory.4. Compare your executed result with the sample output given below.Sample output:
Write a query to display all the details of the buildings, whose building type name contains a letter 'e' but do not contain a letter 'a'. Display the records in descending order based on their owner_name.Note: Use 'Minus'Note:1. Display all the details of the buildings contains a letter 'e' but do not contain a letter 'a'.2. Order by is mandatory. 3. Use Minus.4. Compare your executed result with the sample output given below.Submit
Write a query to display the entire details of the 'building' whose owner_name starts with the letter 'M', Display the records in ascending order based on their owner_name.Note:1. Display all the columns present in the building table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on owner_name column).3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample output: [Only few records are shown here]
Write a query to display the entire details of the building whose building_type_id is 2, sorted by owner_name in ascending order.Note:1. Display all the columns present in the building table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on building_type_id column).3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample output:
Write a query to display all the details of the buildings whose owner name contains 'di' in ascending order based on the owner name of the building.Note:1. Display all the columns from the building table whose owner_name contains “di” from building table.2. Order by is mandatory3. Compare your executed result with the sample output given below.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.