Example Examination. Allocated Time: 100 minutes Maximum Points: 250

Similar documents
INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

DATABASE MANAGEMENT SYSTEMS

Babu Banarasi Das National Institute of Technology and Management

VIEW OTHER QUESTION PAPERS

Assignment #3. CS Spring 2015 Due on Saturday, July 25, 2015, 9 AM For instructions on how to submit your assignment check the course website.

COMP7640 Assignment 2

Midterm Exam (Version B) CS 122A Spring 2017

CS348: INTRODUCTION TO DATABASE MANAGEMENT (Winter, 2011) FINAL EXAMINATION

Integrity constraints, relationships. CS634 Lecture 2

Schema Normalization. 30 th August Submitted By: Saurabh Singla Rahul Bhatnagar

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

COSC Dr. Ramon Lawrence. Emp Relation

1 (10) 2 (8) 3 (12) 4 (14) 5 (6) Total (50)

V. Database Design CS448/ How to obtain a good relational database schema

1. (a) Briefly explain the Database Design process. (b) Define these terms: Entity, Entity set, Attribute, Key. [7+8] FIRSTRANKER

University of Massachusetts Amherst Department of Computer Science Prof. Yanlei Diao

DR B.R.AMBEDKAR UNIVERSITY B.Sc.(Computer Science): III Year THEORY PAPER IV (Elective 4) PHP, MySQL and Apache

Midterm Exam #1 Version A CS 122A Winter 2017

IMPORTANT: Circle the last two letters of your class account:

Normalization. Murali Mani. What and Why Normalization? To remove potential redundancy in design

Homework 3: Relational Database Design Theory (100 points)

Examination examples

Score. 1 (10) 2 (10) 3 (8) 4 (13) 5 (9) Total (50)

MCA (Revised) Term-End Examination December,

IMPORTANT: Circle the last two letters of your class account:

NJIT Department of Computer Science PhD Qualifying Exam on CS 631: DATA MANAGEMENT SYSTEMS DESIGN. Summer 2012

The University of British Columbia

QUIZ 1 REVIEW SESSION DATABASE MANAGEMENT SYSTEMS

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2009 Lecture 4 - Schema Normalization

Schema Refinement: Dependencies and Normal Forms

Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please)

Schema Refinement: Dependencies and Normal Forms

Bachelor in Information Technology (BIT) O Term-End Examination

CS 461: Database Systems. Final Review. Julia Stoyanovich

Endterm Exam (Version B) CS 122A Spring 2017

Lecture #8 (Still More Relational Theory...!)

Relational Database Design (II)

Schema And Draw The Dependency Diagram

CS127 Homework #3. Due: October 11th, :59 P.M. Consider the following set of functional dependencies, F, for the schema R(A, B, C, D, E)

Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please)

Schema Refinement: Dependencies and Normal Forms

CS 338 Functional Dependencies

The Relational Model 2. Week 3

CSE 444, Winter 2011, Midterm Examination 9 February 2011

Chapter 8: Relational Database Design

MIDTERM EXAMINATION Spring 2010 CS403- Database Management Systems (Session - 4) Ref No: Time: 60 min Marks: 38

The Relational Model. Chapter 3

IMPORTANT: Circle the last two letters of your class account:

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

The Relational Model. Week 2

Midterm Examination CS 265 Spring 2016 Name: I will not use notes, other exams, or any source other than my own brain on this exam: (please sign)

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1

Midterm Exam #1 Version B CS 122A Winter 2017

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2009 Lecture 3 - Schema Normalization

Functional dependency theory

Unit 3 : Relational Database Design

2011 DATABASE MANAGEMENT SYSTEM

CS 474, Spring 2016 Midterm Exam #2

Database Systems Relational Model. A.R. Hurson 323 CS Building

Computer Science 597A Fall 2008 First Take-home Exam Out: 4:20PM Monday November 10, 2008 Due: 3:00PM SHARP Wednesday, November 12, 2008

Midterm Exam #2 (Version A) CS 122A Winter 2017

CSE344 Final Exam Winter 2017

UNIT 3 DATABASE DESIGN

SQL: Queries, Programming, Triggers

Attach extra pages as needed. Write your name and ID on any extra page that you attach. Please, write neatly.

Database Management System

EECS-3421a: Test #2 Queries

UNIVERSITY OF CALIFORNIA College of Engineering Department of EECS, Computer Science Division

Answers to the review questions can be found in the listed sections. What are the components of a workload description? (Section 20.1.

Name :. Roll No. :... Invigilator s Signature : DATABASE MANAGEMENT SYSTEM

Sankalchand Patel College of Engineering, Visnagar B.E. Semester III (CE/IT) Database Management System Question Bank / Assignment

Midterm 2: CS186, Spring 2015

Chapter 10. Normalization. Chapter Outline. Chapter Outline(contd.)

6 February 2014 CSE-3421M Test #1 w/ answers p. 1 of 14. CSE-3421M Test #1. Design

Database Applications (15-415)

The University of British Columbia Computer Science 304 Practice Final Examination

INTRODUCTION TO DATABASE SYSTEMS

GUJARAT TECHNOLOGICAL UNIVERSITY

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CSE 444 Midterm Test

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The University of British Columbia

Database Management Systems Paper Solution

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

The Entity-Relationship (ER) Model 2

CSE 344 Midterm. Wednesday, February 19, 2014, 14:30-15:20. Question Points Score Total: 100

Database Management

Chapter 10. Chapter Outline. Chapter Outline. Functional Dependencies and Normalization for Relational Databases

Birkbeck. (University of London) BSc/FD EXAMINATION. Department of Computer Science and Information Systems. Database Management (COIY028H6)

Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition Chapter 10-2

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

QUERY-BY-EXAMPLE (QBE)

Functional Dependencies & Normalization for Relational DBs. Truong Tuan Anh CSE-HCMUT

Section 1: Redundancy Anomalies [10 points]

The Relational Data Model

From ER to Relational Model. Book Chapter 3 (part 2 )

CSE 562 Database Systems

CPS 216 Spring 2003 Homework #1 Assigned: Wednesday, January 22 Due: Monday, February 10

Transcription:

CS542 EXAMPLE EXAM Elke A. Rundensteiner Example Examination Allocated Time: 100 minutes Maximum Points: 250 STUDENT NAME: General Instructions: This test is a closed book exam (besides one cheat sheet). Write your answers in the space provided, use the back sides of sheets, if necessary. If a question seems vague, make reasonable assumptions, and answer the question under those assumptions. Make sure to show your work and to state any assumptions you make! The points for each question are as indicated and roughly indicate the number of minutes you should need to answer the question. Good Luck! PROBLEMS: MAXIMUM SCORE YOUR SCORE problem 1: 60 problem 2: 30 problem 3: 70 problem 4: 30 problem 5: 60 total: 250 1

Problem 1: SQL Queries. [60pts] Consider the following database: Suppliers(sid : integer, sname: string, address: string); Parts(pid : integer, pname: string, color: string); Catalog(sid : integer, pid : integer, cost: real); Give an SQL query expression for each of the queries below. Whenever possible, use one expression per query without views and temporary variables. (1) Find the snames of suppliers who supply every part. (2) Find the pnames of parts supplied by Widget-Guys Suppliers and by no one else. (3) Find the sid of suppliers who charge more for some part than the average cost of that one part (averaged out over all suppliers who supply that part). (4) Find the sid of suppliers who supply only red parts. 2

Problem 2: Constraints in SQL. [30pts] Consider the following relational schema and briefly answer the questions below: Emp(eid : integer, ename: string, age: integer, salary: real); Works(eid : integer, did : integer, pct-time: integer); Dept(did : integer, budget; real, managerid: integer); 1. Define a table constraint on Dept that will ensure that all managers have age > 30. 2. Define an assertion on Dept that ensures that all managers have (age > 30). 3. Compare the assertion in #2 with the table constraint in #1 above, and explain which one is better and why? 3

Problem 3: ER modeling. [70pts] Given below information about a university environment. 3.1. Draw an ER diagram for each of the statements below that most appropriately takes into account the assertion given in that one statement. Use as many different types of ER constructs, such as, inheritance, aggregation, keys, 1-1 versus 1-n relationships, relationships with different arity, etc., whenever possible, represent the semantics of the problem. Indicate if a given assertion cannot be captured by ER constructs, and/or if additional constraints or functional dependencies are necessary to capture them. [45pts] A professor always has a unique name and an address. A professor may teach none, one or more courses in a given term. All courses are taught by only one professor. A student can be both a university employee and also a student. A student has a name and a gpa, and a university employee has a name and a salary. A student is either a graduate student or an undergraduate student, but not both. An undergraduate student has an MQP and an IQP project, whereas a graduate student has a major research area. Only graduate students can be teaching assistants, whereas both graduate and undergraduate students can be graders. All teaching assistants must be graduate students. 4

3.2. Now combine the above smaller ER diagrams from 3.1 to form one complete ER design that most appropriately takes into account all assertions. [25pts]. 5

Problem 4: Mapping from ER models to SQL. [30pts] Give the SQL table definitions for problem 3.1.c., explaining the use of keys, foreign keys, etc.. Justify your particular choice for doing this mapping (versus alternate options). 6

Problem 5: About functional dependencies and normalization. (60 pts) Answer each question yes or no, plus a brief explanation justifying each answer. 1. The set of FDs { AB > CandA > B } is functionally equivalent to the set { A > CandA > B }. 2. Given two subsets of attributes A and B of the relational scheme R. If A is a superkey of R, then the functional dependency A > BalwaysholdsforR. 3. Given the set of FDs F = { A > BC and B > D }. Then the set { A > CandA > BD } is a minimal cover of F. 4. Given the set of FDs F = { A > BC and B > A }. Then the set { A > C, A > B, B > A } is a minimal cover of F. 5. Given the set of FDs F = { A > BCD and B > CA }. Then the attribute C in the dependency A > BCD is extraneous. 6. What are the main reasons for transforming a relational design into 3NF format (as opposed to no normalization at all)? 7. A 3NF design is better than a BCNF design, because a BCNF design does not preserve dependencies. 8. During normalization, it is more important to preserve dependencies than to achieve a lossless join decomposition. 7