Midterm Exam #1 Version A CS 122A Winter 2017

Similar documents
Midterm Exam #1 Version B 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)

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

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

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

Last Name: Doe First Name: John Student ID:

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

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

UNIT 3 DATABASE DESIGN

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

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

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

CS 222/122C Fall 2016, Midterm Exam

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

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

Database Normalization. (Olav Dæhli 2018)

The Relational Model and Normalization

Relational Database design. Slides By: Shree Jaswal

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

Database Management Systems Paper Solution

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

Endterm Exam (Version B) CS 122A Spring 2017

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

Database Design Theory and Normalization. CS 377: Database Systems

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

Relational Database Design (II)

CS 474, Spring 2016 Midterm Exam #2

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

Fundamentals of Database Systems

CS145 Midterm Examination

Chapter 8: Relational Database Design

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

Lecture 11 - Chapter 8 Relational Database Design Part 1

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

CSE 444, Winter 2011, Midterm Examination 9 February 2011

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

Midterm 2: CS186, Spring 2015

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

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

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

CSC 261/461 Database Systems Lecture 10

Functional Dependencies CS 1270

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

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

Database Management

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

Normalisation Chapter2 Contents

Database Systems CSE Comprehensive Exam Spring 2005

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

Database Management

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

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

CSE344 Midterm Exam Winter 2017

CS 461: Database Systems. Final Review. Julia Stoyanovich

Chapter 6: Relational Database Design

CSE 344 Final Examination

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

Unit 3 : Relational Database Design

In This Lecture. Normalisation to BCNF. Lossless decomposition. Normalisation so Far. Relational algebra reminder: product

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

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

DATABASE MANAGEMENT SYSTEMS

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

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

EECS-3421a: Test #1 Design

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

Distributed Database Systems By Syed Bakhtawar Shah Abid Lecturer in Computer Science

CS145 Midterm Examination

Relational Design 1 / 34

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

CSCE 4523 Introduction to Database Management Systems Final Exam Fall I have neither given, nor received,unauthorized assistance on this exam.

CS222P Fall 2017, Final Exam

CSE-3421 Test #1 Design

Exam. Question: Total Points: Score:

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

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

Handout 3: Functional Dependencies and Normalization

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

CSEP 514 Midterm. Tuesday, Feb. 7, 2017, 5-6:20pm. Question Points Score Total: 150

Combining schemas. Problems: redundancy, hard to update, possible NULLs

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

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

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

Chapter 16. Relational Database Design Algorithms. Database Design Approaches. Top-Down Design

CSE 344 Midterm Exam

CSE344 Final Exam Winter 2017

Midterm I - Solution CS164, Spring 2014

Database Programming - Section 16. Instructor Guide

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

Schema And Draw The Dependency Diagram

customer = (customer_id, _ customer_name, customer_street,

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

Transcription:

NAME: SEAT NO.: STUDENT ID: Midterm Exam #1 Version A 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 Modeling Terms 10 2 E-R Modeling 30 3 4 E-R to Relational Translation Relational Design Theory 35 25

1 TOTAL All 100 Question 1: 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 User Entity like Relationship caption Atomic attribute user_name Composite attribute search_tags Multivalued attribute expired_flag Derived attribute card_number Primary key email_address _ Candidate key rating Relationship attribute (photo_id, date)_ Super key Description feature card_number expired_flag search_tags like email_address user caption rating photo_id, date user_name

2 Question 2: 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. 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 student can only take lessons from one teacher. 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 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.

3 T A student must play an instrument. 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. Question 3: 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 Mall( mid INT, mname VARCHAR(20), address VARCHAR(20), PRIMARY KEY (mid) ); CREATE TABLE Store( sid INT, sname VARCHAR(20), phone VARCHAR(10), mid INT NOT NULL, PRIMARY KEY (sid), FOREIGN KEY (mid) REFERENCES Mall(mid) ); CREATE TABLE Restaurant(

4 sid INT, cuisine VARCHAR(20), permitno VARCHAR(10), PRIMARY KEY (sid), FOREIGN KEY (sid) REFERENCES Store(sid) ON DELETE CASCADE );

5 Question 4: Relational Design Theory (25 points) Consider a relational table with schema R (a, b, c, d, e). Each of the sub-problems below gives a different list of FDs for R. For each sub-problem, list the candidate keys for R based on the given FD list and then indicate which is the highest normal form 1NF, 2NF, 3NF, or BCNF that R is in with the given FD list. If asked (in one case below), normalize the design by decomposing R 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, b c, c d, d e a 2NF (transitive dependency from b->c ) (5 pts) (a, b) e, (a, b) c, (a, d) c, b d, d b (a, b), (a, d) 3NF (b d, and b is not a candidate key) (5 pts) (a, b) c, (a, b) d, (a, b) e (a, b) BCNF (10 pts) (a, b) c, d e (a, b, d) 1NF - Normalized BCNF design ( R1, R2, ): R1(a, b, c) R2(d, e) R3(a, b, d)

6