Add constraints on Customer (part e)

This commit is contained in:
Nick Krichevsky 2019-08-26 22:54:49 -04:00
parent c5f807f958
commit e0468e48fb

View file

@ -14,7 +14,9 @@ CREATE TABLE Customer(
lastName VARCHAR2(15), lastName VARCHAR2(15),
address VARCHAR2(30), address VARCHAR2(30),
phone NUMBER(10), phone NUMBER(10),
CONSTRAINT Customer_pk PRIMARY KEY(customerID) CONSTRAINT Customer_pk PRIMARY KEY(customerID),
CONSTRAINT Customer_U1 UNIQUE(firstName, lastName, phone),
CONSTRAINT Customer_phoneNumber_Val CHECK (phone IS NOT NULL)
); );
CREATE SEQUENCE customerID_seq; CREATE SEQUENCE customerID_seq;