Write a query to display the owner_name, address and contact_number of the buildings which does not have an email_address. Display the records in ascending order based on their owner_name.Note:1. Display only the columns owner_name, address and contact_number present in the building table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on email_address column. If email_address is NULL, then it indicates email_address does not present).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]
Question
Write a query to display the owner_name, address and contact_number of the buildings which does not have an email_address. Display the records in ascending order based on their owner_name.Note:1. Display only the columns owner_name, address and contact_number present in the building table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on email_address column. If email_address is NULL, then it indicates email_address does not present).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]
Solution
The SQL query you're looking for would look something like this:
SELECT owner_name, address, contact_number
FROM building
WHERE email_address IS NULL
ORDER BY owner_name ASC;
Here's a step-by-step breakdown of this query:
-
SELECT owner_name, address, contact_number: This part of the query specifies the columns that you want to display in the output. In this case, you want to display theowner_name,address, andcontact_numbercolumns. -
FROM building: This part of the query specifies the table from which you want to retrieve data. In this case, you're retrieving data from thebuildingtable. -
WHERE email_address IS NULL: This is the condition that the rows must meet in order to be included in the output. In this case, you're only including rows where theemail_addressisNULL, which indicates that the building does not have an email address. -
ORDER BY owner_name ASC: This part of the query specifies how you want to sort the output. In this case, you're sorting the output in ascending order (ASC) based on theowner_namecolumn.
Similar Questions
QueryQ14Write a query to display the owner_name, address and contact_number of the buildings which does not have an email_address. 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 contact_number of all building, Display the records in ascending order based on owner_name.Note:1. Display only the column named ‘owner_name’ and ‘contact_number’ present in the building table.2. Order by is mandatory
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]
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.