Knowee
Questions
Features
Study Tools

Write a query to display all the contact number of the building_type named 'Police Station'. Display the records in ascending order based on the contact number

Question

Write a query to display all the contact number of the building_type named 'Police Station'.

Display the records in ascending order based on the contact number.

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

Solution

Sure, here is a SQL query that will display all the contact numbers of the building_type named 'Police Station' in ascending order:

SELECT contact_number
FROM buildings
WHERE building_type = 'Police Station'
ORDER BY contact_number ASC;

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

  1. SELECT contact_number: This part of the query selects the data to be displayed, which in this case is the contact number.

  2. FROM buildings: This part of the query specifies the table from which to retrieve the data, which in this case is the 'buildings' table.

  3. WHERE building_type = 'Police Station': This part of the query filters the records to only include those where the building_type is 'Police Station'.

  4. ORDER BY contact_number ASC: This part of the query sorts the resulting records in ascending order based on the contact number.

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

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.

Write a query to display the entire contents of the 'slab' details.Display the records in ascending order based on their 'from_unit'.

Write a query to display the entire contents of the 'electricity_connection_type'. Display the records in ascending order based on their connection name.

Write a query to display the connection name ,from_unit and to_unit and rate of all the slabs.Display the records in ascending order based on connection_name.

1/1

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.