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

CSE302 Mid02

The document outlines the Mid Term II Assessment for the CSE 302 Database Systems course at East West University, detailing six questions that cover SQL queries, view creation, authorization graphs, and entity-relationship modeling. Each question is associated with specific course outcomes and marks, requiring students to demonstrate their understanding of database concepts and SQL syntax. The assessment includes practical tasks related to a Pizza database and a MOVIE database, along with instructions for creating diagrams and justifying relational schemas.

Uploaded by

2022-3-60-096
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)
22 views4 pages

CSE302 Mid02

The document outlines the Mid Term II Assessment for the CSE 302 Database Systems course at East West University, detailing six questions that cover SQL queries, view creation, authorization graphs, and entity-relationship modeling. Each question is associated with specific course outcomes and marks, requiring students to demonstrate their understanding of database concepts and SQL syntax. The assessment includes practical tasks related to a Pizza database and a MOVIE database, along with instructions for creating diagrams and justifying relational schemas.

Uploaded by

2022-3-60-096
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

03 Dec 2020

EAST WEST UNIVERSITY


Department of Computer Science and Engineering
B.Sc. in Computer Science and Engineering Program
Mid Term II Assessment (Online), Fall 2020 Semester
Course: CSE 302 Database Systems
Instructor: Mohammad Rezwanul Huq, PhD, Associate Professor, CSE Department
Full Marks: 40 (15 will be counted for final grading)
Time: 1 Hour and 30 Minutes (including answer uploading time)

Note: There are 6 (SIX) questions, answer ALL of them. Course Outcome (CO), Cognitive Level and Mark of
each question are mentioned at the right margin.

1. Write SQL Statements for the following queries based on the ‘Pizza’ database [CO2, C3,
schema, as given in the Appendix. Mark: 10]

a) Find the average price of each pizza type throughout all the stores. Do not
include a pizza type in the result when the average price of that pizza is less
than 9 dollars. The result must be sorted in the alphabetical order of pizza
type.
b) Rewrite the same query as mentioned in question 1.(a) using the concept of
the nested subquery.
c) Find the persons who have tasted all pizza types, which are in the menu list
of ‘Chicago Pizza’. You must use NOT EXISTS keyword to solve this query.
d) Find the name of the pizzeria and pizza that has the second lowest price.
e) Find pizzerias (pizza shops), of which the highest-priced pizza that they
serve is less than the average price of pizzas of the same type considering all
the pizzeria. You must use a WITH clause to solve the query.

2. Create a view named MushroomLovers that contains the name of persons who [CO1, C4,
had mushroom pizza. Mark: 4]

Now, assume that appropriate foreign key constraints are in place. Considering that
if the following SQL statement is executed, discuss and explain the outcome.

insert into MushroomLovers values (‘Alice’);

3. Consider the following authorization graph showing the users having SELECT [CO2, C4,
privilege on the previously created MushroomLovers view. Mark: 6]

Figure 1: Authorization Graph for Question 3

Page 1 of 4
03 Dec 2020

a) If the user U3 executes the following SQL statement, what will be the
output?
SELECT grantor, grantee, grantable
from user_tab_privs
where table_name = ‘MushroomLovers’;

b) If U1 revokes privilege from U3, does U5 still have access to the view? Draw
the changed authorization graph in support of your answer.

4. Consider a MOVIE database in which data is recorded about the movie industry. [CO3, C6,
The data requirements are summarized as follows: Mark: 10]

• Each movie is identified by title and year of release. Each movie has a length
in minutes and a plot outline.
• Each movie has a production company, and one or more directors and one
or more actors appear in it. A movie may have a number of roles. Roles are
existentially dependent on Movies. Finally, each movie has zero or more
quotable quotes, each of which is spoken by a particular actor appearing in
the movie.
• Actors are identified by name and date of birth and appear in one or more
movies. Each actor has a role in the movie.
• Directors are also identified by name and date of birth and direct one or more
movies. It is possible for a director to act in a movie (including one that he
or she may also direct).
• Production companies are identified by name and each has an address. A
production company produces one or more movies.

Design an entity-relationship model (ER diagram) for the MOVIE database. Please
note that the information is not complete and you are free to make reasonable
assumptions. Write down your assumptions if you have made any with your design.
Your design must be legible and clear.

5. Assume that there are 3 entity sets: Faculty, Department, and Instructor A single [CO3, C4,
faculty has one or more departments and has one or more instructors. A department Mark: 4]
is associated under one faculty, and a department may have many instructors.

Draw the partial ER diagram in such a way so that the resulting database schema
can answer the query - “which instructor work under which faculty”.

You do not need to consider any attributes but must show mapping cardinalities of
a relationship set.

6. Reduce the following ER model into a set of relational schemas. Justify your [CO3, C3,
answer briefly. Mark: 6]

Page 2 of 4
03 Dec 2020

Please note that, in the diagram, ellipses represent simple attributes, dashed ellipse
represents derived attributes and double ellipse represents multi-valued attributes.
1 indicates ‘one’ side and N indicates ‘many’ side in a relationship set.

Page 3 of 4
03 Dec 2020

Appendix: Pizza Database


The following database schema keeps information on several pizza-lovers, pizza shops known as a pizzeria and
different types of pizzas.
• Person ( name, age, gender )
• Frequents ( name, pizzeria )
• Eats ( name, pizza )
• Serves ( pizzeria, pizza, price )

Person relation stores information related to a person. The Frequents relation keeps the information about the
membership of a person to a particular pizzeria (pizza shop). The Eats relation holds information about the
consumption of different types of pizza by all persons. The Serves relation contains information about the menu
of a particular pizzeria (pizza shop).

Page 4 of 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy