DBMS-Question Paper (Set-1)
DBMS-Question Paper (Set-1)
DBMS-Question Paper (Set-1)
(Category -1, Deemed to be University estd. u's. 3of the UGC Act, 1956)
Accredited by NAAC as 'A+*>Approved by AlCTE ISO 21001:2018 Certifled
Campus: Green Fields, Vaddeswaram - 522 302, Guntur Distrlct, Andhra Pradosh, INDIA
Phone No, +91 8645 - 350 200; www.klef.ac.in; www.klef.edu. in; www.kluniversily.in
Admin Oft: 29.36-38, Museum Road, Governorpet, Vjayawada - 520 002. Ph: +91 -866-3500122, 2576129
Page 1 of 4
Employees
EmplopyeelD FirstName LastName DepartmentlD
1
Alice Johnson 101
2 Bob Smith 102
carol Williams 101
Departments
DepartmentlD DepartmentName
101 HR
102 IT
101
Marketing
Slove the following SQL Queries using below tables (a)
ldentify the
sailors who have reserved a red or a green Boat (b) ldentify the names
of
names
sailors who have reserved at least two boats (c) ldentify the sids of
of
with age over 20 sailors
who have not reserved a red boat.
Sailor
Reserves
sid Sname rating age sid bid day
22 Dustin 7 45.0 22 101 10-10-98
29 Brutas 1 33.0 22 102 10-10-98
Lubber 55.5 22 103 10-8-98
32 Andy 25.5 22 104 10-7-98
58 Rusty 10 35.0 31 102 11-10-98
64 Horatio 35.0 31 103 11-6-98
2.D 71 Zorba 10 16.0 31 104 11-12-98 CO2 BTL-3
74 Horatio 9 35.0 64 101 9-5-98
85 Art 3 25.5 64 102 9-8-98
95 Bob 63.5 74 103 9-8-98
Boats
bid bname color
101 Interlake Blue
102 Interlake Red
103 Clipper Green
104 Marine Red
Page 2 of 4
for each day,the places and times the classes are
held.Each course has a code
and a title and any course can be given any number of
times. Each time a
particular course is given, we will call it an 'edition' of the course. For each
edition, we represent the start date, the end date, and the number of
participants. If a trainee is self employed, we need to know her area of
expertise, and, if appropriate, her title. For somebody who works for a
company, we store the level and position held. For each instructor (about
300), we will show the surname, age, place of birth, the edition of the course
taught, those taught in the past and the courses that the tutor is qualified to
teach. All the instructors' telephone numbers are also stored. An instructor
can be permanently employed by the training company or freelance
OR
Answer all Questions (6M +5M =11 M]
Extend the following E-R diagram into relations Schema.
TOW
day
Number
To light Bookings
alrcraft Hlights
CO1 BTL-2
4.A To Cust Seal
Customers
Custl0
name
phone Address
CO1 BTL-2
4.B Explain Data Independence and its types in detail?
SECTION -D [ANSWER Q5 OR Q6)
5 Answer all Questions [6M + 5M = 11 M)
Make use of the Following Worker Table i) Develop the PostgreSQL query to
fetch "FlIRST NAME" from Worker table using the alias name as ii) Develop
the PostgreSQL query to fetch "FIRST_NAME" from Worker table in upper
case
WORK FIRST NA LAST NAM JOINING_D
ME E SALARY ATE DEPARTMENT
ER_ID
Monika Arora 100000 20-02-2014 HR
1
Page 3 of 4
Make use of the Following Tables to sove the Queries using joins?
A) ldentify an SQL query to display all departments and the employees in each
department, including employees who are not assigned to any department
using Right Outer Join
8) ldentify SQL query to display al! employees and their corresponding
department names, including employees without departments and
departments without employees using FullOuter Join
Employees
EmplopyeelD FirstName LastName DepartmentiD
1 Alice Johnson 101
5.8 CO2 BTL-3
2 Bob Smith 102
3 carol Williams 101
Departments
DepartmentlD DepartmentName
101 HR
102 IT
101 Marketing
OR
6 Answer all Questions [6M + SM = 11 M)
For the following relation schema:
Employee (employee-name, street, city)
Works (employee-name, company-name,salary)
Company (company-name, city)
6.A
Manages (employee-narne, manager-name) CO2 BTL-3
Give an expression in SQL for each of the following queries:
a) Find the names, street address, and cities of residence for all employees
who work for 'First Bank Coporation' and earn more than $10,000.
b) Find the names of all employees in the database who live in the same cities
as the companies for which they work.
For the Following Database Schema
emp (eno, ename, bdate, title, salary, dno)
proj (pno, pname, budget, dno)
dept (dno, dname, mgreno)
6.B workson (eno, pno, resp, hours) C02 BTL-3
1)Write an SQL query that returns the project number and name for projects
with a budget greater than $100,000.
2) Write an SQL query that returns all works on records where hours worked
is less than 10 and the responsibility is 'Manager'.
Page 4 of 4