Purchase Solution

Creating Views using SQL statements

Not what you're looking for?

Ask Custom Question

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.

Purchase this Solution

Solution Summary

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

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

C++ Operators

This quiz tests a student's knowledge about C++ operators.