Midterm Exam #1 Version B CS 122A Winter 2017

Similar documents
Midterm Exam #1 Version A CS 122A Winter 2017

Midterm Exam (Version B) CS 122A Spring 2017

Midterm Exam #1 (Version B) CS 122A Spring 2018

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

Homework 3: Relational Database Design Theory (100 points)

Midterm Exam #2 (Version B) CS 122A Spring 2018

Spring 2013 CS 122C & CS 222 Midterm Exam (and Comprehensive Exam, Part I) (Max. Points: 100)

Midterm Exam #2 (Version B) CS 122A Spring 2018

Midterm Exam #2 (Version C) CS 122A Spring 2018

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

CS 222/122C Fall 2016, Midterm Exam

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

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

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

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

UNIT 3 DATABASE DESIGN

Chapter 14. Database Design Theory: Introduction to Normalization Using Functional and Multivalued Dependencies

Relational Database design. Slides By: Shree Jaswal

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

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

Endterm Exam (Version B) CS 122A Spring 2017

Database Normalization. (Olav Dæhli 2018)

Functional Dependencies and. Databases. 1 Informal Design Guidelines for Relational Databases. 4 General Normal Form Definitions (For Multiple Keys)

Informal Design Guidelines for Relational Databases

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

CS 474, Spring 2016 Midterm Exam #2

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

Database Management Systems Paper Solution

The Relational Model and Normalization

Chapter 14 Outline. Normalization for Relational Databases: Outline. Chapter 14: Basics of Functional Dependencies and

Midterm 2: CS186, Spring 2015

Lecture 11 - Chapter 8 Relational Database Design Part 1

Last Name: Doe First Name: John Student ID:

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

CSC 261/461 Database Systems Lecture 10

CS145 Midterm Examination

More Normalization Algorithms. CS157A Chris Pollett Nov. 28, 2005.

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

Draw A Relational Schema And Diagram The Functional Dependencies In The Relation >>>CLICK HERE<<<

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

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

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

Database Management

CSE 444, Winter 2011, Midterm Examination 9 February 2011

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

Relational Database Design (II)

Database Design Theory and Normalization. CS 377: Database Systems

Chapter 8: Relational Database Design

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

Database Management System Prof. Partha Pratim Das Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

ADVANCED DATABASES ; Spring 2015 Prof. Sang-goo Lee (11:00pm: Mon & Wed: Room ) Advanced DB Copyright by S.-g.

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

Chapter 6: Relational Database Design

The strategy for achieving a good design is to decompose a badly designed relation appropriately.

Fundamentals of Database Systems

Introduction to Data Management. Lecture #11 (Relational Languages I)

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615

Database Management

CSE 344 Midterm. Monday, November 9th, 2015, 9:30-10:20. Question Points Score Total: 70

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

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

CS145 Midterm Examination

CS 338: Computer Applications in Business: Databases

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

CSE 344 Final Examination

CSE344 Midterm Exam Winter 2017

CS403- Database Management Systems Solved Objective Midterm Papers For Preparation of Midterm Exam

The University of British Columbia

A Deeper Look at Data Modeling. Shan-Hung Wu & DataLab CS, NTHU

Computer Security Fall 2006 Joseph/Tygar Midterm 3

CSCI 5333 DBMS Fall 2017 Final Examination. Last Name: First Name: Student Id:

DATABASE MANAGEMENT SYSTEM SHORT QUESTIONS. QUESTION 1: What is database?

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

Functional Dependencies CS 1270

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

Normalisation Chapter2 Contents

EECS-3421a: Test #1 Design

Functional Dependencies and Normalization for Relational Databases Design & Analysis of Database Systems

Relational Design 1 / 34

DATABASE MANAGEMENT SYSTEMS

Introduction to Data Management. Lecture #7 (Relational Design Theory)

Database Systems CSE Comprehensive Exam Spring 2005

Database Programming - Section 16. Instructor Guide

Schema And Draw The Dependency Diagram

CSE-3421 Test #1 Design

University of California, Berkeley. (2 points for each row; 1 point given if part of the change in the row was correct)

CSCI DBMS Spring 2017 Final Examination. Last Name: First Name: Student Id:

Data Modelling and Databases. Exercise Session 7: Integrity Constraints

Learning outcomes. On successful completion of this unit you will: 1. Understand data models and database technologies.

Steps in normalisation. Steps in normalisation 7/15/2014

Unit 3 : Relational Database Design

Integrity constraints, relationships. CS634 Lecture 2

CSE 444 Midterm Test

CSC 261/461 Database Systems Lecture 13. Fall 2017

Handout 3: Functional Dependencies and Normalization

Homework 6. Question Points Score Query Optimization 20 Functional Dependencies 20 Decompositions 30 Normal Forms 30 Total: 100

Structure and Interpretation of Computer Programs

CS Database Design - Assignments #3 Due on 30 March 2015 (Monday)

CS211 Lecture: Database Design

Transcription:

NAME: SEAT NO.: STUDENT ID: Midterm Exam #1 Version B CS 122A Winter 2017 Max. Points: 100 (Please read the instructions carefully) Instructions: - The total time for the exam is 50 minutes; be sure to budget your time accordingly. - The exam is closed book and closed notes but open cheat sheet. - Read each question first, in its entirety, and then carefully answer each part of the question. - If you don t understand something, ask one of the exam proctors for clarification. - If you still find ambiguities in a question, note the interpretation you are taking. QUESTION TOPIC POINTS SCORE 1 E-R Modeling 30 2 Modeling Terms 10 3 4 Relational Design Theory E-R to Relational Translation 25 35 TOTAL All 100 Question 1: E-R Modeling (30 points)

(30 pts) Consider the E-R model below and then indicate whether each of the statements that follow it are true (T) or false (F) by writing the appropriate letter in the space to the left of the statement. T A pro may also be a lesson-giving teacher. F A teacher may also be a lesson-taking student. F A teacher s fee may be different for each student. F A pro can have contracts with multiple bars. F Some musicians may be neither a pro nor a student nor a teacher. T A student must play an instrument. F An instrument can have multiple names. T An instrument can have multiple colors. F An instrument can have multiple teachers who teach it. T An instrument can have multiple musicians who play it. F A bar must have a contract with some pro. F A teacher must teach at least one instrument. T A musician may have a different skill level for each instrument played. T Two musicians may have the same first and last names. F A student can only take lessons from one teacher.

Question 2: Modeling Terms (10 points) (10 pts) Consider the following description of the data involved in a new cloud-based photo management application you ve been asked to develop a database design for: Users have a unique ssn (social security number), a name (consisting of a first name, last name, and middle initial), a unique email address, an age, and a password. Photos have a unique photo id, a date, a caption, and a set of search tags (e.g., birthday, night, cat, music ). Every photo must have been taken by some user (who may have taken other photos as well). Credit cards have a cardholder name, a card type (e.g., Visa ), a unique card number, an expiration date, and an expired flag that is true if the expiration date is in the past and false otherwise. Credit cards are owned by users and in some cases a card may be owned by several users. Users may like photos and can specify a rating (on a scale from -5 to +5) to show just how well they like them. Match each of the modeling constructs in the left column below with their best-matching feature (drawn from the description above) in the right column below. Indicate your answer by writing the relevant description feature in the blank to the left of each modeling construct. (Hint: You should end up using each feature once, and you might find it quicker to go down the list of features looking for constructs rather than going down the list of constructs looking for features.) Modeling construct search_tags Multivalued attribute (photo_id, date)_super key expired_flag Derived attribute User Entity caption Atomic attribute user_name Composite attribute card_number _ Primary key email_address_ Candidate key rating Relationship attribute like Relationship Description feature email_address user_name user card_number search_tags like caption rating photo_id, date expired_flag

Question 3: Relational Design Theory (25 points) Consider a relational table with schema S (a, b, c, d, e). Each of the sub-problems below gives a different list of FDs for S. For each sub-problem, list the candidate keys for S based on the given FD list and then indicate which is the highest normal form 1NF, 2NF, 3NF, or BCNF that S is in with the given FD list. If asked (in one case below), normalize the design by decomposing S into several BCNF relations that have the lossless join and dependency-preserving properties. (Reminder: Be sure to include parentheses wherever you are indicating a composite key.) (5 pts) (a, b) c, (a, b) d, (a, b) e - Candidate key(s) for S: 3 (a, b) - Highest normal form: 2 BCNF (5 pts) (a, b) e, (a, b) c, (a, d) c, b d, d b - Candidate key(s) for S: (a, b), (a, d) - Highest normal form: 3NF (b d, and b is not a candidate key) (5 pts) a b, b c, c d, d e - Candidate key(s) for S: a - Highest normal form: 2NF (transitive dependency from b->c ) (10 pts) (a, b) c, d e 10 - Candidate key(s) for S: 3 (a, b, d) - Highest normal form: 3 1NF - Normalized BCNF design (S1, S2, ): 4 S1(a, b, c) 1 S2(d, e) 1 S3(a, b, d) 2

Question 4: E-R to Relational Translation (35 points) (35 pts) Using the delta tables approach to ISA relationship handling, translate the following E-R schema into an appropriate set of SQL tables. Avoid having more tables than needed, and be sure that your translated design expressed as CREATE TABLE statements in SQL includes any/all appropriate (i) primary keys, (ii) unique keys, (iii) NOT NULL constraints, (iv) FOREIGN KEY constraints, and (v) ON DELETE options. CREATE TABLE Center( cid INT, cname VARCHAR(20), address VARCHAR(20), PRIMARY KEY (cid) ); CREATE TABLE Business( bid INT, bname VARCHAR(20), phone VARCHAR(10), cid INT NOT NULL, PRIMARY KEY (bid), FOREIGN KEY (cid) REFERENCES Center(cid) ); CREATE TABLE Eatery( bid INT, cuisine VARCHAR(20), permitnum VARCHAR(10), PRIMARY KEY (bid), FOREIGN KEY (bid) REFERENCES Business(bid) ON DELETE CASCADE );