0% found this document useful (0 votes)
19 views

Mid_Term_Question_213_CSE3521

The document outlines a series of tasks related to database design and SQL queries for a university scenario, including creating a relational schema from an ER diagram and writing SQL queries for various data retrieval tasks. It also includes explanations of database keys and mapping cardinalities. Additionally, it presents a collection of relation schemes and poses questions regarding committee membership of professors.
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)
19 views

Mid_Term_Question_213_CSE3521

The document outlines a series of tasks related to database design and SQL queries for a university scenario, including creating a relational schema from an ER diagram and writing SQL queries for various data retrieval tasks. It also includes explanations of database keys and mapping cardinalities. Additionally, it presents a collection of relation schemes and poses questions regarding committee membership of professors.
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/ 2

Answer ALL of the following questions:

1. Draw the corresponding Relational Schema for the following ER-Diagram. [CO1] 4

2. Consider the following scenario: 8


A university is organized into different departments. Each department has a unique department
name. The university also stores the opening date, floor no and the phone numbers of the
department. Many students get admitted to a department and faculties work for a department.

Students get a unique student id and their name, date of birth and age is also stored. The name
consists of the first name and the last name of a student. A student pays his/her fees and the fee
date is stored. Students can select one student to be their batch leader.

Courses have their unique course name and the credit hours, number of sections and the type of
the course are stored. Students can enroll in several courses and the trimester name is stored for
each enrollment.

For each fee, it gets a fee number and the amount gets stored. The fee number can not uniquely
identify each fee but can be uniquely identified for each student. [CO1]
3. 8
Table name Column names

Student id (PK), name, dept_name (FK), course_id (FK), total_credit

Department dept_name (PK), building, budget

Instructor id (PK), name, dept_name (FK), salary

Course course_id (PK), title, dept_name (FK), credits

Section section_id (PK), course_id (FK), semester, building, room_no,


time
Write the sql queries for the following questions using the given
a. Find the names of all departments.
b. Find the names of all instructors in the History department.
c. Find all courses taught either in Fall 2020 or in Spring 2021 Semester, or both.
d. Find the names of all students who have taken at least one Computer Science course.
4. a. Briefly describe different types of keys in DBMS. 2
b. Briefly explain mapping cardinalities in DBMS. 2

5. Consider the following collection of relation schemes: 6

professor(profname, deptname)
department(deptname, building)
committee(profname,commname)
a. Find all the professors who are in any one of the committees that Professor Smith is in.
b. Find all the professors who are in at least all those committees that Professor Smith is
in.
c. Find all the professors who are in exactly (i.e., no more and no less) all those
committees that Professor Smith is in.

You might also like