doctor- special_fee

Sai_kiran_rachakonda · March 26, 2022
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);
insert into Doctor values('D_103', 'ABC', 'GEN.MED', null, 150);
insert into Doctor values('D_106', 'KLM', 'PEDIATRIC', 12987, 200);
insert into Doctor values('D_104', 'JACK', 'CARDIAC', 13567, 200);

alter table Doctor add column special_fee numeric(5,2);

update doctor set special_fee = 100 where Did = 'D_100';
update doctor set special_fee = 150 where Did = 'D_101';
update doctor set special_fee = 125 where Did = 'D_102';
update doctor set special_fee = 175 where Did = 'D_103';
update doctor set special_fee = 200 where Did = 'D_106';
update doctor set special_fee = 225 where Did = 'D_104';

select special_fee + consultation_fee from Doctor;

Output

Comments

Please sign up or log in to contribute to the discussion.