Question: Please can some one help correct errors in this Sql Scripts CREATE TABLE PatientAssignment ( PatientNum INT NOT NULL , PatientFName VARCHAR(50), PatientLName VARCHAR (50)

Please can some one help correct errors in this Sql Scripts


CREATE TABLE PatientAssignment (

PatientNum INT NOT NULL ,

PatientFName VARCHAR(50),

PatientLName VARCHAR (50) ,

WardNum INT NOT NULL ,

-- primary key

CONSTRAINT PK_PatientAssignment Primary Key(PatientNum , WardNum) ,

-- foreign key

CONSTRAINT FK_PatientAssignment FOREIGN KEY (PatientNum) REFERENCES PatientRegistrationInfo (PatientNum)

);

-- creation of table Ward

CREATE TABLE Ward (

WardNum INT NOT NULL PRIMARY KEY,

WardName VARCHAR(50),

BedNum VARCHAR (50) ,

WardLoc VARCHAR (50),

TeleExt VARCHAR (50),

);

-- creation of table Appointment

CREATE TABLE Appointment (

ApptNum INT NOT NULL Primary Key ,

ApptDate date,

ApptTime TIME ,

PatientNum VARCHAR (50),

StaffNum INT NOT NULL

-- foreign key

CONSTRAINT FK_Appointment FOREIGN KEY ( StaffNum ) REFERENCES Staff (StaffNum)

);

-- creation of table ExamRoomAppt

CREATE TABLE ExamRoomAppt (

ApptNum INT NOT NULL ,

ApptExamRoomNum INT NOT NULL,

ApptExamRoomName VARCHAR (50) ,

PatientNum INT NOT NULL ,

-- foreign key

CONSTRAINT FK_ExamRoomAppt FOREIGN KEY ( ApptNum ) REFERENCES Appointment (ApptNum) ,

CONSTRAINT FK_Patient FOREIGN KEY ( PatientNum ) REFERENCES PatientRegistrationInfo (PatientNum) ,

-- primary key

CONSTRAINT PK_ExamRoomAppt Primary Key(PatientNum , ApptNum)

);

-- creation of table PatientMedication

CREATE TABLE PatientMedication (

PatientNum INT NOT NULL ,

PatientFName VARCHAR(50),

PatientLName VARCHAR (50) ,

SupplyNum INT NOT NULL , SupplyName VARCHAR (50),

CONSTRAINT PK_PatientMedication Primary Key(PatientNum , SupplyNum) ,

-- foreign key

CONSTRAINT FK_PatientMedication FOREIGN KEY (PatientNum) REFERENCES PatientRegistrationInfo (PatientNum) ,

-- foreign key

CONSTRAINT FK_Supply FOREIGN KEY (SupplyNum) REFERENCES Supply (SupplyNum)

);

-- creation of table Bed

CREATE TABLE Bed(

PatientNumber INT NOT NULL ,

PatientFName VARCHAR( 50),

PatientLName VARCHAR (50),

BedNum VARCHAR (50),

BedName VARCHAR (50),

PaDatePlaced date,

PaStay Numeric(18, 0),

PaDateExpLeave date ,

PaDateActDepart date ,

);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!