0% found this document useful (0 votes)
71 views4 pages

DDL Statements:: For Table "Employee"

The document contains CREATE TABLE statements that define the structure of 8 tables - employee, patient, doctor, check, pharmacy, cafeteria, test. The tables define columns with data types and constraints such as primary keys and foreign keys to link the tables together. For example, the employee and patient tables are linked with a foreign key on the patient table that references the primary key of the employee table.

Uploaded by

Black Tigar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views4 pages

DDL Statements:: For Table "Employee"

The document contains CREATE TABLE statements that define the structure of 8 tables - employee, patient, doctor, check, pharmacy, cafeteria, test. The tables define columns with data types and constraints such as primary keys and foreign keys to link the tables together. For example, the employee and patient tables are linked with a foreign key on the patient table that references the primary key of the employee table.

Uploaded by

Black Tigar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DDL Statements:

For table "employee"


CREATE TABLE employee(empID int NOT
NULL,empName varchar(100) NOT
NULL,counterNo int NOT NULL,constraint
pk_empID PRIMARY KEY (empID))
For table "patient"
CREATE TABLE patient(patientNo int NOT
NULL,PatientName varchar(100) NOT
NULL,age int,sex char,address
varchar(100),deposite currency NOT
NULL,regDate date,disDate date,remarks
text,empID int NOT NULL,CONSTRAINT
pk_patientNo PRIMARY KEY
(patientNo),CONSTRAINT fk_empID
FOREIGN KEY (empID) REFERENCES
employee (empID))

For table "doctor"


CREATE TABLE doctor(docID int NOT
NULL,docName varchar(100) NOT
NULL,address varchar(100),contact
varchar(30),faculty
varchar(100),CONSTRAINT pk_docID
PRIMARY KEY (docID))
For table "check"
CREATE TABLE check(docID int NOT
NULL,patientNo int NOT NULL,checkDate
date,fee currency,remarks
text,CONSTRAINT fk_docID FOREIGN KEY
(docID) REFERENCES doctor
(docID),CONSTRAINT fk1_patientNo
FOREIGN KEY (patientNo) REFERENCES
patient(patientNO))
For table "pharmacy"
CREATE TABLE pharmacy(patientNo int
NOT NULL ,buydate date NOT
NULL,particulars varchar(100),rate
currency,qty int,

amount currency,CONSTRATIN
ph_patientNo FOREIGN KEY (patientNo)
REFERENCES patient(patientNo))
For table "cafeteria"
CREATE TABLE cafeteria(patientNo int
NOT NULL,orderdate date NOT
NULL,particulars varchar(100),rate
currency,qty int,amount
currency,CONSTRAINT caf_patientNo
FOREIGN KEY (patientNo) REFERENCES
patient(patientNo),)
For table "test"
CREATE TABLE test(patientNo int NOT
NULL,testdate date,testhead
varchar(100),amount currency,remarks
text,CONSTRATIN test_patientNo
FOREIGN KEY (patientNo) REFERENCES
patient(patientNo))

You might also like