Computer Science Homework Solutions
Problem
#142803

Create a view and SQL statement

Assume that FiredUp has created a database with the following tables:
CUSTOMER (CustomerSK, Name, Phone, EmailAddress)
STOVE (SerialNumber, Type, Version, DateOfManufacture)
REGISTRATION (CustomerSK, SerialNumber, Date)
STOVE_REPAIR (RepairInvoiceNumber, SerialNumber, Date, Description, TotalCost, TotalPaid, CustomerSK)

A.  Create a view called RepairSummary that shows only RepairInvoiceNumber, TotalCost, and TotalPaid

B.  Show a SQL statement to retrieve all RepairSummary data sorted by TotalCost.

C.  Create a view called CustomerRepair that shows CUSTOMER.Name and STOVE_REPAIR.SerialNumber, Date, Description, and TotalDue, where TotalDue is the difference between TotalCost and TotalPaid.

D.  Suppose that FiredUp has the rule that a customer's record can be deleted only if TotalPaid is equal to TotalCost in all repair records.  Explain how you would use a trigger to enforce this rule.  What type of trigger would you use?  On which table would you place the trigger?  Show the SQL statements that you would code, but write the rest of the trigger in generic code.


Solution Summary

This deals with creation of views using SQL statements. Also some other operations involving views are included.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$27.93)
Included in Download
  • Plain text response
  • Attached file(s):
    • solution_sql.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Create a Database Diagram - Assume that FiredUp has created a database with the following tables: CUSTOMER (CustomerSK, Name, Phone, EmailAddress) STOVE (SerialNumber, Type, Version, DateOfManufacture) REGISTRATION (CustomerS ...
  • MICROSOFT ACCESS EXPERT - Need a Hardware inventory database developed based on the attached paper utilizing MS ACCESS.
Browse