Question: (SQL query) Consider the schemas for a camera database: . Camera(model, manufacturer, type, price) . Customer(custID, zipcode) . Purchase(model, cus 1. Suppose you want to
(SQL query)

Consider the schemas for a camera database: . Camera(model, manufacturer, type, price) . Customer(custID, zipcode) . Purchase(model, cus 1. Suppose you want to enforce the following constraint: when inserting a tuple tID, date) into the Purchase relation, custID must also exist in the Customer relation If custID does not exist in the Customer table, automatically insert it into the Customer table (you can set the zipcode value to be NULL). Write a Trigger statement to do this; 2. Can we accomplish the same thing with a Check statement? Why or why not
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
