Question: Code an SQL statement to create a view named CourseFeeOwedView that shows CourseNumber, Course, CourseDate, CustomerNumber, CustomerLastName, CustomerFirstName, Phone, Fee, AmountPaid, and the calculated column

  1. Code an SQL statement to create a view named CourseFeeOwedView that shows CourseNumber, Course, CourseDate, CustomerNumber, CustomerLastName, CustomerFirstName, Phone, Fee, AmountPaid, and the calculated column (Fee AmountPaid), renamed as AmountOwed.
  2. Code an SQL statement that displays the data in CourseFeeOwedView, sorted alphabetically by CustomerLastName
  3. Code an SQL statement that displays the data in CourseFeeOwedView, sorted alphabetically by CustomerLastName for any customer who still owes money for a course fee.
  4. Write a user-defined function named FirstNameFirst that concatenates the CustomerLastName and CustomerFirstName into a single value named CustomerName and displays, in order, the CustomerFirstName, space, and the CustomerOwnerLastName (Hint: Johnson and Ariel would be combined to read Ariel Johnson).
  5. Code an SQL statement to create a view named CourseEnrollmentFirstNameFirstView that shows CourseNumber, Course, CourseDate, CustomerNumber, CustomerLastName and CustomerFirstName concatenated using the FirstNameFirst user-defined function and displayed as CustomerName, and Phone.
  6. Code an SQL statement that displays the data in CourseEnrollmentLastNameFirstView, sorted alphabetically by CustomerName and CourseNumber.

TABLES:

CUSTOMER (CustomerNumber (PK), CustomerLastName, CustomerFirstName, Phone)

COURSE (CourseNumber (PK), Course, CourseDate, Fee)

ENROLLMENT (CustomerNumber (PK,FK), CourseNumber(PK,FK), AmountPaid)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!