Consider the following six relations for an order-processing database applicatio
ID: 3876277 • Letter: C
Question
Consider the following six relations for an order-processing database
application in a company:
CUSTOMER (Cust#, Cname, City)
ORDER (Order#, Odate, Cust#, OrdAmt)
ORDERITEM (Order#, Item#, Qty)
ITEM (Item#, Unitprice)
SHIPMENT (Order#, Warehouse#, Shipdate)
WAREHOUSE (Warehouse#, City)
Here, OrdAmt refers to total dollar amount of an order; Odate is the
date the order was placed; Shipdate is the date an order is shipped
from the warehouse. Assume that an order can be shipped from several
warehouses
Give an update operation to a database state that
violates an entity integrity constraint, stating any assumptions
on the database state you make
Explanation / Answer
entity integrity constraint is basic constraint that refers to unique value of primary key and it should not be null. As well it applied to foreign key of other table.
One entity integrity constraint violates can be if We update ORDER table with Order# which already present in table then it will give error as Order# is primary key of ORDER table and it must be unique.
Update Operation:
UPDATE ORDER
SET #order = <Order# Value which is already present in table >