0% found this document useful (0 votes)
32 views4 pages

Assignement 2

The document outlines Assignment 2 for the KCS 501 Database Management System course, detailing tasks to be completed between July and December 2024. It includes questions on relational algebra, database definitions, applications of DBMS, and SQL queries related to student enrollment and airline flight information. Additionally, it requires the creation of ER diagrams and SQL DDL statements for various database schemas.

Uploaded by

rockyiamtheboss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views4 pages

Assignement 2

The document outlines Assignment 2 for the KCS 501 Database Management System course, detailing tasks to be completed between July and December 2024. It includes questions on relational algebra, database definitions, applications of DBMS, and SQL queries related to student enrollment and airline flight information. Additionally, it requires the creation of ER diagrams and SQL DDL statements for various database schemas.

Uploaded by

rockyiamtheboss
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

KCS 501 Database Management System

(July 2024 – December 2024)

Assignment 2

Date of Issue: 24-09-2024 Last of date of Submission: 30-09-2024

Mode of Submission: Offline on Assignment Book / Laboratory


-----------------------------------------------------------------------------------------------------------------------------

SECTION- A
1. Explain basic relational algebra operations and explain them?
2. Define the data, database and database management system.
3. Write ten applications area of DBMS,
4. Discuss the advantages and disadvantages of DBMS.
5. What are the database languages? Describe the types of languages.
6. Define the super key, candidate key and foreign key.
7. What are data models? Describe in brief.
8. Describe the types of database user on the basis of their work.
SECTION - B
9. Consider the following relations for a database that keeps track of student enrollment
in courses and the books adopted for each course-
STUDENT(SSN, Name, Major, Bdate)
COURSE (Course#, Cname, Dept)
ENROLL( SSN, Course#, Quarter, Book_ISBN)
TEXT( Book_ISBN, Book_Title, Publisher, Author)
Specify the foreign keys for this schema. Write SQL-DDL statement for creation of
above relations. Illustrate integrity constraints as deem fit for above database.

10. Consider the following relational database, where the primary keys are underlined
Employee(person_name, street, city)
Works(person_name, company_name, salary)
Company(company_name, city)
Manages(person_name, manager_name)
Give an expression in the relational algebra and SQL statements to express each of
the following queries:
1|Page
a. Find the name of all employees who live in the same city and on the same
street as do their managers.
b. Find the name of all employees in this database who do not work for “First
Bank Corporation”.
c. Find the name of all employees who earn more than every of “Small Bank
corporation”.
d. Give all managers in this database a 10 percent salary raise.
e. Find the name of all employees who work for “First Bank Corporation”.
f. Find the name, street and cities of residence of all employee who work for “First
Bank Corporation and earn more than 10000 per annum.
g. Find the name of all employees who live in the same city as the company for
which they work.
h. Delete tuples in the relation works for employees of “Small bank Corporation”.
i. Assume the companies may be located in several cities. Find all companies
located in every city in which “Small Bank Corporation” is located.
j. Give all managers in this database a 10 percent salary raise, unless the salary
would be greater than 100000. In such case, give only a 3 percent raise.
k. Find the company with the most employees.
l. Find those companies whose employees earn a higher salary, on average , than
the average salary at “ First Bank Corporation”.

11. Draw an ER diagram for a railway reservation system having the following
information : ( Explain your assumptions clearly, if any)
a) The train starts from a city station identified by the station_ID.
b) Each train has a train_number, a name, and mention the numbern of seats
available in three classes of service and the number of comportments assigned
to each class.
c) Each train has a route which consists of a series of stations.
d) Based on the type of reservation, there is a fixed fare between each pair of station
along the route.
e) The type of reservation depends on the day the week on which the train operates.
f) The train has scheduled arrival and departure time for each station.
g) During reservation, the customer name, phone number and address are recorded.
2|Page
h) The reservation provides a seat_number/sleeper_number.

12. Design a relational database for the question no.11.


13. The following relational database keep track of airline/flight information:

Flights ( flno : integer, aid : integer, from : string, to : string, distance : integer,
departs : time, arrives : time, price : real)
Aircraft (aid : integer, aname : string, cruisingrange : integer)
Certified (eid : integer, aid : integer)
Employees (eid : integer, ename : string, salary : integer)

Note that the Employees relation describes pilots and other kinds of employees as
well; every pilot is certified for some aircraft, and only pilots are certified to fly.

Give relational Algebra expression and SQL statements to express each of the
following queries:

1) Find the names of pilots certified for some Boeing aircraft.


2) Print the list of all pilots and their salary. (Hint. Only Pilots are certified
employees for aircraft)
3) Print the name and salary of all employees who are not pilots.
4) Find the aids of all aircraft that can be used on routes from Los Angeles to
Chicago.
5) Print the enames of pilots who can operate planes with cruising range greater
than 3000 miles but are not certified on any Boeing aircraft.
6) Print the name and salary of every non-pilot whose salary is more than the
average salary for pilots.
7) Print the names of employees who are certified only on aircrafts with cruising
range longer than 1000 miles.
8) Print the names of employees who are certified only on aircrafts with cruising
range longer than 1000 miles, but on at least two such aircrafts.
9) Print the names of employees who are certified only on aircrafts with cruising
range longer than 1000 miles and who are certified on some Boeing aircraft.

3|Page
SECTION – B (Laboratory)

Write SQL (DDL) statement to create above tables. Include integrity constraints
wherever required for Q9, Q10, Q12 and Q13.

4|Page

You might also like