Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Oracle SQL Homework: I need help with both problems 5. Write a SELECT statement

ID: 3701950 • Letter: O

Question

Oracle SQL Homework: I need help with both problems

5. Write a SELECT statement that returns these columns from the Invoices table:

The invoice_number column

The balance due (invoice total minus payment total minus credit total) with commas, a decimal point, and two decimal positions

A column named “Balance Rank” that uses the RANK function to return a column that ranks the balance due in descending order.

6. Design a database for tracking memberships

Draw a database diagram for a database that tracks the memberships for an association and for the groups within the association. Assume that each member can belong to any number of groups and that each group can have any number of members.

Modify your design for exercise 2 to keep track of the role served by each individual in each group. Assume that each individual can only serve one role within a group and that each group has its own set of roles that members can fulfill.

Explanation / Answer

Question 5-

Solution: SELECT invoice_number, TO_CHAR((total_invoice – total_payment – total_credit), '$11,111.11') AS due_balance,RANK() OVER (ORDER BY TO_CHAR((total_invoice – total_payment – total_credit), '$11,111.11') DESC) AS balance_rank FROM invoices.

Note-For other question to be answered please provide as a separate question

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote