Knowee
Questions
Features
Study Tools

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

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

🧐 Not the exact question you are looking for?Go ask a question

Solution

Assuming you are using SQL, here is a step-by-step guide on how to write the query:

  1. First, you need to select the column you are interested in, which is the name of the building types. In SQL, you use the SELECT statement for this. If the column name is "building_type", the beginning of your query will look like this: SELECT building_type.

  2. Next, you want to specify that you're only interested in building types that end with the letter 'l'. For this, you use the WHERE clause in combination with the LIKE keyword. The '%' symbol is used as a wildcard in SQL, meaning it can represent any number of characters. So, to specify that the building type should end with 'l', you add WHERE building_type LIKE '%l' to your query.

  3. Finally, you want to order the results in ascending order based on the name. For this, you use the ORDER BY clause. To specify ascending order, you use the ASC keyword. So, you add ORDER BY building_type ASC to your query.

Putting it all together, your final query will look like this:

SELECT building_type
FROM your_table
WHERE building_type LIKE '%l'
ORDER BY building_type ASC;

Please replace "your_table" with the actual name of your table.

This problem has been solved

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.

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.

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 building_type name and the number of buildings under the type which has maximum number of buildings. Give an alias name for number of buildings as number_of_buildings and for building name as building_name. If there are multiple records sort in ascending order by building_name.Note:1. Display only the building_type name and no. of buildings in building_type table with the condition having maximum no. of buildings.2. Use Joins3. Tables involved are building and building_type4. Order by is mandatory. 5. Specify the alias name without any mistake.6. Compare your executed result with the sample output given below.

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.

1/3

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.