Knowee
Questions
Features
Study Tools

Write a query to display the details of the 'bill' whose payment is not completed. Display the records  in ascending order based on due_date.

Question

Write a query to display the details of the 'bill' whose payment is not completed.

Display the records in ascending order based on due_date.

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

Solution

Sure, here is a SQL query that should give you the desired result:

SELECT * 
FROM bill 
WHERE payment_status = 'Not Completed' 
ORDER BY due_date ASC;

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

  1. SELECT * FROM bill: This part of the query selects all records from the 'bill' table.

  2. WHERE payment_status = 'Not Completed': This is the condition that filters the records. It only selects the bills where the payment status is 'Not Completed'.

  3. ORDER BY due_date ASC: This part of the query sorts the selected records in ascending order based on the 'due_date' field. If you wanted to sort the records in descending order, you would use DESC instead of ASC.

This problem has been solved

Similar Questions

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 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 travel_card_id, entry_time and exit_time from the travel_payment.Display the records in ascending order based on the entry_time.

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

Write a query to display the second minimum fine_amount from bill table. Give an alias name to the second minimum fine amount as 'second_min_fine_amount'.

1/1

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.