@Sai_kiran_rachakonda
Treat
·
SQL
SQL
create table Treat(
Did int references Doctor(Did) on delete cascade,
Pid int references Patient (Pid) on delete set null,
Diagnosis varchar(30) not null,
treat_id int,
treat_date date
);
insert into Treat values('D_100', 'XYZ', 'ENT', 12334, 150);
insert into Treat values('D_101', 'PQR', 'ORTHO', 12455, 200);
insert into Treat values('D_102', 'LMN', 'ENT', 12256, 150);
doctor
updated
·
SQL
SQL
create table Doctor(
Did int primary key,
Dname varchar(25),
specialization varchar(20) default 'general',
Adhar_no varchar(12) unique,
consultation_fee numeric(5,2) constraint c1 check(consultation_fee > 50)
);
insert into Doctor values('D_100', 'XYZ', 'ENT', 12334, 150);
insert into Doctor values('D_101', 'PQR', 'ORTHO', 12455, 200);
insert into Doctor values('D_102', 'LMN', 'ENT', 12256, 150);