Write a query to display the details of all the bills whose 'total_units' greater than 10000, sorted by total_units in descending orde
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.
Solution
Assuming you are using SQL, the query would look like this:
SELECT *
FROM bills
WHERE total_units > 10000
ORDER BY total_units DESC;
Here's a step-by-step breakdown of the query:
SELECT *
- This statement selects all columns from the table.FROM bills
- This statement specifies the table from which to retrieve the data, in this case, the 'bills' table.WHERE total_units > 10000
- This statement filters the results to only include rows where the 'total_units' column is greater than 10000.ORDER BY total_units DESC
- This statement sorts the results in descending order based on the 'total_units' column.
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 total_units and payable_amount of the particular meter number 'SG934826
Write a query to display all the details of all the 'bills' whose payment_date is on the year 2018, sorted by payable_amount in descending order
Write a query to display the number of bills having fine_amount. Give an alias name as 'count_of_bills_with_fine'.
Write a query to display the number of electricity_reading in which the total_units per day is greater than 500. Give an alias name as 'count_total_units_500'.
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.