You are on page 1of 7

CS309

Information and Database Systems


Fall 2023
Assignment 4
Instructor: Dr. Rohit Saluja

The first 4 pages of this pdf includes guidelines to install and use mysql workbench, and
remaining pages include the problem statements for Assignment 4.

Installation of MySQL Workbench


● Go to the official MySQL website at
https://dev.mysql.com/downloads/workbench/.
● Scroll down the page and look for "MySQL Workbench"
under "MySQL Workbench GA Releases".
● Click the download button for your operating system
(Windows, Mac, or Linux)

).
● Once the download is complete, run the installer file.
● The installation wizard will appear on the screen. Follow the
prompts and click "Next" to proceed.
● Read the license agreement and select "I accept the terms
in the license agreement" if you agree.
● Choose the installation folder and click "Next".

● Choose the type of installation (Complete, Custom or


Typical) and click "Next".
● Review the settings and click "Install".

● Wait for the installation to complete.


● Click "Finish" to complete the installation.
Assignment 4
NOTE: FOR LAST TWO QUESTIONS YOU HAVE TO SUBMIT THE MYSQL
WORKBENCH PROJECT FILE

Q.1 Consider the following tables: [5]

Employee (emp_id, name, age, department_id)


Department (department_id, department_name, manager_id)

Write a relational algebra expression to find the name and age of


all employees who work in the department managed by John.

Q.2 Consider the following tables: [5]

Customer (cust_id, name, city, state)


Order (order_id, cust_id, date, amount)

Write a relational algebra expression to find the name and city of


all customers who have placed an order.

Q.3 Consider the following tables: [5]

Student (student_id, name, major)


Course (course_id, name, credits)
Enrollment (student_id, course_id, grade)
Write a relational algebra expression to find the name and major
of all students who have taken a course worth more than 3 credits
and received a grade of A.
Q.4 Consider the following tables: [5]

Author (author_id, name)


Book (book_id, title, author_id)
Publisher (publisher_id, name)
Publication (book_id, publisher_id, year)

Write a relational algebra expression to find the titles of all books


published by publishers whose name contains the word
"Penguin".

Q.5 Consider the following tables: [5]

Product (product_id, name, price)


Order (order_id, date, customer_id)
OrderItem (order_id, product_id, quantity)

Write a relational algebra expression to find the total amount


spent by each customer on each product.

NOTE: FOR BELOW TWO QUESTIONS YOU HAVE TO SUBMIT THE MYSQL
WORKBENCH PROJECT FILE

Q.6 Create
a new database and schema for following tables in
MySql Workbench [5]

Student (student_id, name, major)


Course (course_id, name, credits)
Enrollment (student_id, course_id, grade)
Note: Make appropriate assumptions for different attributes’ data
types. Make sure keys are properly referenced.

Q.7 For the given EER diagram, convert it into relational Schema in
MySql Workbench. [30]

You might also like