Knowee
Questions
Features
Study Tools

Write a query to display the details of all the bills whose 'total_units' greater than 10000, sorted by total_units in descending order.

Question

Write a query to display the details of all the bills whose 'total_units' greater than 10000, sorted by total_units in descending order.

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

Solution

Sure, here is the SQL query you asked for:

SELECT * 
FROM bills 
WHERE total_units > 10000 
ORDER BY total_units DESC;

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

  1. SELECT * FROM bills: This part of the query selects all columns from the bills table.

  2. WHERE total_units > 10000: This is the condition that filters the results. It only includes rows where the total_units column is greater than 10000.

  3. ORDER BY total_units DESC: This part sorts the results in descending order based on the total_units column. The rows with the highest total_units values will be at the top.

This problem has been solved

Similar Questions

Write a query to display the total_units, payable_amount and fine_amount of bill table. Display the records in descending order based on their total_units

Write a query to display the details of all the bills whose 'total_units' greater than 10000, sorted by total_units in descending order.Note:1. Display all the columns present in the bill table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on total_units 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]SubmitSaveExecutePrevious Submission1​

Write a query to display the entire contents of bill table. Display the records sorted in ascending order based on month and then in descending order based on total_units.Note:1. Display all the columns present in the bill table.2. Order by is mandatory

Write a query to display all the details of bills whose payment_date is on 2nd day of the month and also display the records in  descending order based on the total_units.

Write a query to display the details of all the 'bills' with the due_date on '2017-10-01'.Display the records in descending order based on their payable_amount.

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.