0% found this document useful (0 votes)
4 views2 pages

Set 6

The document outlines the creation of four database tables: doctor, medicine, disease, and treatment, each with specified attributes and constraints. It includes SQL commands for inserting sample data into the medicine and disease tables, as well as the treatment table. Additionally, it demonstrates the structure for inserting records into these tables with placeholder values for future data entry.

Uploaded by

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

Set 6

The document outlines the creation of four database tables: doctor, medicine, disease, and treatment, each with specified attributes and constraints. It includes SQL commands for inserting sample data into the medicine and disease tables, as well as the treatment table. Additionally, it demonstrates the structure for inserting records into these tables with placeholder values for future data entry.

Uploaded by

lemasy2023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

create table doctor

(
d_no number(5) primary key ,
d_name varchar(20) NOT NULL,
specialization varchar(30) NOT NULL,
clinic_addr varchar(30) NOT NULL
);

create table medicine


(
m_no number(5) primary key,
m_name varchar(20) NOT NULL,
type varchar(10) NOT NULL,
content varchar(10) NOT NULL,
manufacturer varchar(30) NOT NULL
);

create table disease


(
dise_name varchar(20) primary key NOT NULL,
symptom1 varchar(20) NOT NULL,
symptom2 varchar(20) NOT NULL,
symptom3 varchar(20) NOT NULL
);

create table treatment


(
t_no number(5) primary key,
d_no number(5) references doctor,
dise_name varchar(20) references disease,
m_no number(5) references medicine,
dosage varchar(20) NOT NULL,
avg_cure_time date NOT NULL
);

insert into doctor values('&d_no','&d_name','&specialization','&clinic_addr');

insert into medicine values('&m_no','&m_name','&type','&content','&manufacturer');

insert into disease values('&dise_name','&symptom1','&symptom2','&symptom3');

insert into treatment


values('&t_no','&d_no','&dise_name','&m_no','&dosage','&avg_cure_time');

insert into medicine(m_no,m_name,type,content,manufacturer)


values(5,'hqtor500','regular','10mg','zydus pharma');

insert into disease(dise_name,symptom1,symptom2,symptom3)


values('polio','fever','store throar','headache');

create table treatment


(
t_no number(5) primary key,
d_no number(5) references doctor,
dise_name varchar(20) references disease,
m_no number(5) references medicine,
dosage varchar(20) NOT NULL,
avg_cure_time date NOT NULL
);

insert into treatment(t_no,d_no,dise_name,m_no,dosage,avg_cure_time)


values('1','1','cancer','1','5days','02-oct-2022');

You might also like