Add constraints on Customer (part e)

master
Nick Krichevsky 2019-08-26 22:54:49 -04:00
parent c5f807f958
commit e0468e48fb
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,9 @@ CREATE TABLE Customer(
lastName VARCHAR2(15),
address VARCHAR2(30),
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;