Consider the following six relations for an order-processing database application in a company:

CUSTOMER (Cust#, Cname, City)
ORDER (Order#, Odate, Cust#, Ord_Amt)
ORDER_ITEM (Order#, Item#, Qty)
ITEM (Item#, Unit_price)
SHIPMENT (Order#, Warehouse#, Ship_date)
WAREHOUSE (Warehouse#, City)

Here, Ord_Amt refers to total dollar amount of an order; Odate is the date the order was placed; Ship_date is the date an order (or part of an order) is shipped from the warehouse. Assume that an order can be shipped from several warehouses. Specify the foreign keys for this schema, stating any assumptions you make. What other constraints can you think of for this database?


Strictly speaking, a foreign key is a set of attributes, but when that set contains only one attribute, then that attribute itself is often informally called a foreign key. The schema of this question has the following five foreign keys:
1. the attribute Cust# of relation ORDER that references relation CUSTOMER,
2. the attribute Order# of relation ORDER_ITEM that references relation ORDER,
3. the attribute Item# of relation ORDER_ITEM that references relation ITEM,
4. the attribute Order# of relation SHIPMENT that references relation ORDER, and
5. the attribute Warehouse# of relation SHIPMENT that references relation WAREHOUSE.
We now give the queries in relational algebra:
image
The above query lists all orders for which no “timely” shipment was made, including orders for which no shipment was ever made. It is instructive to compare the above query with the one below that lists those orders for which at least one “late” shipment was made.
14001

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1. The guaranteed service is the most demanding service provided by ISA. 2. Differ is the most widely accepted QoS mechanism in enterprise networks. 3. Elastic traffic is network traffic that is tolerant to variations in delay, jitter, and throughput. 4. Trick mode functionalities are features of video streaming systems that mimic visual feedback given during fast-forward and rewind operations.

Computer Science & Information Technology

Write a statement that reads a record from the file trans.dat. The record consists of integer accountNum and floating-point dollarAmount. Use ifstream object inTransaction.

What will be an ideal response?

Computer Science & Information Technology

Click any pixel on the canvas and the Magic Wand tool selects other pixels based on ____.

A. tolerance B. similarity C. proximity D. fording

Computer Science & Information Technology

Parameter queries return a subset of the data based on the values that are typed in the Enter Parameter Value input box

Indicate whether the statement is true or false

Computer Science & Information Technology