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

Mid_Term_Question_241_CSE3521

The document outlines the midterm exam for the Database Management Systems course, detailing the exam format, rules, and topics covered. It includes tasks such as designing an ER diagram for an event organizing company, explaining DBMS vs RDBMS, writing SQL queries for a bookstore database, and creating tables for a magazine subscription system. Additionally, it requires the application of relational algebra on a given schema related to trips and drivers.
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)
11 views4 pages

Mid_Term_Question_241_CSE3521

The document outlines the midterm exam for the Database Management Systems course, detailing the exam format, rules, and topics covered. It includes tasks such as designing an ER diagram for an event organizing company, explaining DBMS vs RDBMS, writing SQL queries for a bookstore database, and creating tables for a magazine subscription system. Additionally, it requires the application of relational algebra on a given schema related to trips and drivers.
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

Midterm Exam, Trimester: Spring 2024

Course Code: CSE-3521 Course Title: Database Management Systems


Total Marks: 30 Duration: 1 hour 30 minutes

Any examinee found adopting unfair means will be expelled from the trimester / program
as per UIU disciplinary rules.

1. An event organizer Company named “Elite” is currently try to convert their analog file- 7
system to a digital database. They want it to be able to handle the current processes.

For every event, they store the name of the event, start date, end date, venue, description
in their books. They also store detailed information about the venue like address,
capacity etc. They also assign one of their employee as the supervisor for the event. The
supervisor’s contact info and previous arranged events are needed to be accessed the
current customers.

Elite also keeps information about their employees. For each event they also keep track
of the expenses. They stores the services expenses and expense for buys item/materials
separated books. They want to keep this same when converting to data base system.

They also keep track of the guest list and people who attended the event. Elite want a
database that can handle the above functionalities

Now, design an ER diagram for “Elite” the serves their requirements.

2. Explain the difference between a DBMS and an RDBMS


2

3 Write the corresponding schema of the following ER diagram (Diagram 1). 5

Page 1 of 4
Diagram 1

4. Consider the following schema for a bookstore database: 1+2


2+2
Books Table: [BookID (Primary Key), Title, AuthorID (Foreign Key, referencing Authors Table),
Genre, Price]

Authors Table: [AuthorID (Primary Key), FirstName, LastName, Nationality]

Page 2 of 4
Customers Table: [CustomerID (Primary Key), FirstName, LastName, Email, Phone]

Orders Table: [OrderID (Primary Key), CustomerID (Foreign Key, referencing Customers
Table), Date, TotalAmount]

OrderDetails Table: [OrderDetailID (Primary Key), OrderID (Foreign Key, referencing Orders
Table), BookID (Foreign Key, referencing Books Table), Quantity, Subtotal]

Now, write SQL queries for the following:


i. Retrieve the titles of all books along with their corresponding authors' first and last
names.
ii. Find the total amount spent by each customer, whose last name starts with “s”, in the
year 2021. Include the customer's first and last names in the result set.
iii. Calculate the total sales generated from book sales in each genre. Display the genre
names along with the total amount, sorted in descending order of revenue.
iv. Write a query to identify customers who have purchased books from more than one
genre. Include the customer's first and last names in the result set, along with the
number of genres they've purchased books from.

5. Create the following tables: 3+1


+2
Publishers (id, name, country)
Magazines (id, title, publisher_id(fk), frequency, price)
Subscriptions (id, customer_id(fk), magazine_id(fk), start_date, end_date)

i. Create tables/entities mentioned above (with the primary key & foreign keys).
ii. Add an attribute 'website' to the Publishers table.
iii. Remove 'id' from the Publishers table and make 'name' the primary key. Show the necessary
steps needed to be taken sequentially with corresponding SQL queries.

6. Consider the following relational database schema: 3


Passenger (p_id, name, password, location)
Driver (d_id, name, password, v_id)
Vehicles (v_id, d_id, name, status)
Trips (t_id, p_id, date, time, route, cost)

Answer the following questions using relational algebra:

i) Find all the information of trips between 1000 to 5000 tk on 29th February.

Page 3 of 4
ii) Find the names and vehicle id of drivers who had vehicles whose status are “Unfit”.
iii) Find the output for the following:

Π (t_id, date, route) (σ (cost > 3000 ^ route = (Π location(Passenger))) trips)

Note: Date format is YYYY-MM-DD. And for the last question, write a sentence describing
what
the query will return.

Example: All passenger names whose location is Dhaka.

Page 4 of 4

You might also like