Knowee
Questions
Features
Study Tools

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

Question

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

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

Solution

It seems like you want to write a SQL query to fetch details of buildings based on certain conditions. Here's how you can do it:

SELECT * 
FROM buildings 
WHERE building_type_name LIKE '%e%' 
MINUS 
SELECT * 
FROM buildings 
WHERE building_type_name LIKE '%a%' 
ORDER BY owner_name DESC;

Here's what this query does:

  1. SELECT * FROM buildings WHERE building_type_name LIKE '%e%' - This part of the query selects all details of the buildings where the building type name contains the letter 'e'.

  2. MINUS SELECT * FROM buildings WHERE building_type_name LIKE '%a%' - This part of the query removes all records from the first query that contain the letter 'a' in the building type name.

  3. ORDER BY owner_name DESC - This part of the query sorts the final result in descending order based on the owner's name.

Please replace buildings, building_type_name, and owner_name with your actual table name and column names.

This problem has been solved

Similar Questions

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

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]

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.