Knowee
Questions
Features
Study Tools

Write a query to display the owner_name and contact_number of all building, Display the records in ascending order based on owner_name.

Question

Write a query to display the owner_name and contact_number of all building, Display the records in ascending order based on owner_name.

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

Solution

Sure, here is a SQL query that should do what you're asking for:

SELECT owner_name, contact_number 
FROM building 
ORDER BY owner_name ASC;

Here's a step-by-step breakdown of the query:

  1. SELECT owner_name, contact_number: This part of the query selects the data to be displayed. In this case, we want to display the owner_name and contact_number fields.

  2. FROM building: This part of the query specifies the table from which to retrieve the data. In this case, the data is retrieved from the building table.

  3. ORDER BY owner_name ASC: This part of the query sorts the results in ascending order (ASC) by the owner_name field. If you wanted to sort the results in descending order, you would use DESC instead of ASC.

This problem has been solved

Similar Questions

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 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.

Write a query to display the owner name and the length of the owner's name of the buildings. Display the records in ascending order based on owner name. Give an alias as name_length to the length of the owner names.Use the inbuilt function length().Note:1. Display only the owner name and length of the owner_name from building table.2. Specify the alias name without any mistake.3. Order by is mandatory4. Compare your executed result with the sample output given below.Sample output:[only few records shown here]

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

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:

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.