Knowee
Questions
Features
Study Tools

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

Question

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

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

Solution

Sure, here is the SQL query you asked for:

SELECT total_units, payable_amount, fine_amount
FROM bill
ORDER BY total_units DESC;

This query will select the total_units, payable_amount, and fine_amount columns from the bill table and display the records in descending order based on the total_units column.

Similar Questions

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

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 all the 'bills' with 'meter' details. Display the records in ascending order based on meter number.Note:1. Display all the columns of bill and meter table2. Use Joins3. Tables involved bill and meter4. Order by is mandatory5. Compare your executed result with the sample output given below.Sample output: [Only few records are shown here]ID METER_ID MONTH YEAR DUE_DATE TOTAL_UNITS PAYABLE_AMOUNT IS_PAYED PAYMENT_D FINE_AMOUNT ID METER_NUMBER BUILDING_ID39 26 8 2017 01-SEP-17 20700 724500 1 14-SEP-17 72450 26 SG190123 2614 10 10 2017 01-NOV-17 750 16875 1 09-NOV-17 1687.5 10 SG198329 10

Write a query to display the owner_name and sum of payable_amount who paid the maximum bill amount in the year 2017. If there are multiple records display the record in ascending order based on owner_name Give an alias name as "TotalBillAmount".Note:1. Display only the owner_name and sum of payable_amount who paid the maximum bill amount in the year 2017.2. Use Joins3. Tables involved building, meter and bill4. Specify condition on year column of bill table. sum of payable_amount must be maximum in this year.5. Order by is mandatory. 6. Compare your executed result with the sample output given below

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.