Database Analysis   «Prev  Next»

Storing User Views - Exercise

Objective: Create a user view to calculate total cost of an order.

Exercise Scoring

You will receive up to eight points for creating a user view and up to three points each for correctly creating the calculations needed to fill the user view, according to the instructions below.


To round out the capabilities of the Stories on CD order-tracking database, you need to create a user view that presents the order number, the title of the CD, the wholesale cost of the CD, the shipping cost, the total cost of the order, the selling price of the CD, and the expected profit after the CD is sold.


Using the following two relations, design a user view containing the data fields and calculated fields required to present the information listed above.
  1. CD (CDNo, Title, Price, CategoryNo, CategoryName, DistID)
  2. Order (OrderNo, CDNo, OrderDate, OrderCost, Shipping, Received)

Then, in the text box below:
  1. Write the view in relational notation.
  2. Write the name of the first calculated field.
  3. Write the calculation used for the first calculated field.
  4. Write the name of the second calculated field.
  5. Write the calculation used for the second calculated field.


You should make up descriptive names for the calculated fields.
OrderCost is the wholesale price of a CD; Price is the retail sale price.

Submitting your exercise

Type or paste your responses to the tasks above into the text box below, then Submit to submit you answer.