<< >>


2.1.2 ALTER

, , , ALTER. , 2.2 , , ALTER. CREATE TABLE CUSTOMER, . ALTER TABLE CustomerPK, CustomerlD .

2.2.

CREATE TABLE CUSTOMER(
CustomerlD int NOT NULL,
Name char(25) NOT NULL,
Street char(30) NULL,
City char(35) NULL,
State char(2) NULL,
ZipPostalCode char(5) NULL,
Country varchar(50) NULL,
AreaCode char(3) NULL,
PhoneNumber char(8) NULL,
Email varchar(100) NULL);
ALTER TABLE CUSTOMER
ADD CONSTRAINT CustomerPK PRIMARY KEY (CustomerlD);
CREATE TABLE ARTIST(
ArtistID int NOT NULL,
Name char(25) NOT NULL,
Nationality varchar(30) NULL,
BirthDate numeric(4,0) NULL,
DeceasedDate numeric(4,0) NULL,
CONSTRAINT ArtistPK PRIMARY KEY (ArtistID));

. . , , (Primary Key - ) .

CUSTOMER ( 2.1 2.2) . , . CUSTOMER ( 2.1) , , . .

ARTIST 2.2 . CREATE, . , , ALTER.

2.3.

. CUSTOMER_ARTIST_INT {ArtistID, CustomerlD}. , 2.1.

ALTER (. 2.3). Customer_Artist_Int_ArtistFK , ArtistID , ARTIST.ArtistID. FK (foreign key). : ON DELETE CASCADE.

 

 



<< >>