DBMS_P_SHITS[1]
DBMS_P_SHITS[1]
Q1)
a) List the distinct names of customers who are either
employees, or investors or both.
A=select emp_name from e,i where e.emp_id=i.emp_id
union select emp_name from e;
Q2
a) List the names of employees who are also investors.
A= select emp_name from e,i where e.emp_id=i.emp_id;
b)List the information of Investors whose name start
with ‘R’
B= select*from e where emp_name like 'R%';
Q3)
a)List the names of customers who are either
employees, or investors or both.
A= select emp_name from e,i where e.emp_id=i.emp_id
union all select emp_name from e;
b)Delete the employee whose names starts with ‘S’
B= delete from e where emp_name like'S%';
Q2)
Project (P_No, P_Name,P_Type,Duration)
Employee (E_no, E_Name,Qualification,JoinDate)
Project and Employee: M-M relationship, with
descriptive attributes as start_date (date),
no_of_hours_worked (integer).
Assume appropriate data types for all the attributes.
aproject=project
ebmeployee=employee
e_p=join table
create table aproject(P_No int primary key, P_Name
varchar(20),P_Type text,Duration int);
create table ebmployee(E_no int primary key ,E_Name
varchar(20),Qualification text,JoinDate date);
create table e_p(start_date date,no_of_hours_worked
int,E_no int references ebmployee on delete cascade,P_no int
references aproject on delete cascade);
Q1)
a) Find the employees whose name starts with ‘A’.
= A= select*from ebmployee where e_name like'a%';
A
Q2)
a) Find the names of the employees whose duration is
more than 10 years
A= select*from ebmployee,aproject,e_p where
duration>10 and e_p.p_no=aproject.p_no and
e_p.e_no=ebmployee.e_no;
b) Find the details of employees working on the project
“Robotics”.
B= select*from ebmployee,aproject,e_p where
p_name='Robotis' and e_p.p_no=aproject.p_no and
e_p.e_no=ebmployee.e_no;
Q3)
a) Find the employee numbers of the employees, who
do not work on project “Robotics”.
A= select*from ebmployee,aproject,e_p where p_name
not in('Robotis') and e_p.p_no=aproject.p_no and
e_p.e_no=ebmployee.e_no;
b) Find the names of the employees whose duration is
more than three years.
B= select*from ebmployee,aproject,e_p where
duration>3 and e_p.p_no=aproject.p_no and
e_p.e_no=ebmployee.e_no;
Q1
a) List the names of movies with the highest budget.
A=select m_name from movie where budget=(select
max(budget) from movie);
b) List the names of producers who produce the same
movie as “Tanhaji”.
B= select * from producer0,movie where m_name =
'tanhaji' and
producer0.producer_id=movie.producer_id;
Q2)
a) Gives count of movies whose budget is greater than 3
crores.
A=select count(*)from movie where budget > 30000000;
Q3)
a) List the movie name starting with ‘S’.
A=select m_name from movie where m_name like's%';
D=
Consider the following database maintained by a
college about students and competitions.
STUDENT (sreg_no, name , class)
COMPETITION (c_no , name , C_type)
The relationship is as follows:
STUDENT-COMPETITION: M-M with described
attributes rank and year.
Class should be ‘FYBCA’ , ‘SYBCA’ and ‘TYBCA’
Assume appropriate data types for all the
attributes.
se