DBMS_I_Practical_solution
DBMS_I_Practical_solution
Cust_id Varchar2(5),
lname char(10),
fname char(10),
area varchar2(10),
phone_no number(10)
);
Insert Record:
mv_no number(5),
title varchar2(25),
type varchar2(10),
star varchar2(25),
price number(8,2)
);
Insert Record:
3.Display customer with their fname and last name whose cust_id is a01 or a02.
4. Display all the records from cust table whose cust_id is a02 and area is Surat.
Ans: select * from cust where cust_id='a02' and area='Surat';
deptno number(2),
dname varchar2(15),
loc varchar(15)
);
Insert Record:
ename varchar2(10),
job varchar2(9),
mgr number(4),
hiredate date,
sal number(7,2),
comm number(7,2),
);
Table Created
dname varchar2(25),
Table Created
pname varchar2(25),
bdate date,
paddr varchar2(35),
);
Table Created
tdetails varchar2(50),
charges number(5( check(charges >0),
);
Table Created
app_date date,
duration number(4),
);
Table Created
3 & 7.select * from emp where deptno <>20; OR select * from emp where deptno
not in (20);
5.select ename from emp where comm is not null; OR select ename from emp
where comm >0 ;
11.select ename from emp where ename loke 'J%' OR ename like 'j%';
O/P: No rows
Assignment - 7 - Join
='DEC';
11. select doctor.dname,patient.pname,treatment.tdetails,treatment,charges from
doctor,appointment,patient, treatement where
12.select patient.pname,treatment.tdetails,treatment.charges,appointment.app_date
from patient,treatment,appointment, doctor where
doctor.dname='Mehul Patel';
o/p: No Rows
appointment.d_id,doctor.dname;
1. select empno,ename,sal from emp where sal=(select sal from emp where
ename='Ward');
3. select tdetails from treatment where t_id in(select t_id from appointment where
d_id in(select d_id from doctor where dcity='Anand'));
status='c');
5. select dname from doctor where d_id in (select d_id from appointment where
p_id in(select p_id from patient where gender='M'));
Assignment - 10 - Updating and Alteration of table and table data