The University of British Columbia

Similar documents
The University of British Columbia

Computer Science 304

The University of British Columbia

CSIT5300: Advanced Database Systems

CSE 444 Midterm Test

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Design Theory for Relational Databases

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

Homework 3: Relational Database Design Theory (100 points)

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002

Final Examination Computer Science 420 Dr. St. John Lehman College City University of New York 21 May 2002

The University of British Columbia

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

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

BIRKBECK (University of London)

Schema And Draw The Dependency Diagram

Babu Banarasi Das National Institute of Technology and Management

CSE 444, Winter 2011, Midterm Examination 9 February 2011

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

Name: Database Systems ( 資料庫系統 ) Midterm exam, November 15, 2006

Fundamentals of Database Systems

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

Presentation on Functional Dependencies CS x265

CS145 Midterm Examination

BCNF. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong BCNF

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

UNIT 3 DATABASE DESIGN

Northern India Engineering College, New Delhi Question Bank Database Management System. B. Tech. Mechanical & Automation Engineering V Semester

Desired properties of decompositions

Chapter 6: Relational Database Design

CSE 444, Fall 2010, Midterm Examination 10 November 2010

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

CS411 Database Systems. 05: Relational Schema Design Ch , except and

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

SCHEMA REFINEMENT AND NORMAL FORMS

Exam II Computer Programming 420 Dr. St. John Lehman College City University of New York 20 November 2001

The Relational Data Model

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CS x265 Exam 3 Spring ALL questions 5 points, except question 11 I will not use a source other than my brain on this exam: (please sign)

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

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

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

The University of British Columbia Computer Science 304 Practice Final Examination

Functional Dependencies CS 1270

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

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

Introduction to Database Systems. Announcements CSE 444. Review: Closure, Key, Superkey. Decomposition: Schema Design using FD

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 304: MIDTERM EXAMINATION SET A OCTOBER 2016

ER to Relational Mapping

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

CSE 444 Midterm Exam

Exam. Question: Total Points: Score:

Translating an ER Diagram to a Relational Schema

Database Management

Midterm 2: CS186, Spring 2015

1. Considering functional dependency, one in which removal from some attributes must affect dependency is called

GUJARAT TECHNOLOGICAL UNIVERSITY

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

Final Review. Zaki Malik November 20, 2008

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

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

SOLUTIONS TO THE FINAL EXAMINATION Introduction to Database Design Spring 2011

Midterm Exam (Version B) CS 122A Spring 2017

The University of British Columbia Computer Science 304 Midterm Examination March 17, 2010

Midterm Exam #1 Version A CS 122A Winter 2017

CSE 562 Database Systems

COSC Dr. Ramon Lawrence. Emp Relation

Jordan University of Science & Technology Computer Science Department CS 728: Advanced Database Systems Midterm Exam First 2009/2010

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

Functional dependency theory

Examination examples

rate name People Consult Topics name rate name People Consult Topics name

City University of Hong Kong Course Syllabus. offered by Department of Computer Science with effect from Semester A 2017/18

Midterm Exam #1 Version B CS 122A Winter 2017

(a) Explain how physical data dependencies can increase the cost of maintaining an information

CSE344 Final Exam Winter 2017

Homework Assignment 3. November 9th, 2017 Due on November 23th, 11:59pm (midnight) CS425 - Database Organization Results

Lecture 11 - Chapter 8 Relational Database Design Part 1

Data about data is database Select correct option: True False Partially True None of the Above

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

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

CMP-3440 Database Systems

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC Second Semester CSE/IT DBMS

Schema Refinement & Normalization Theory 2. Week 15

Examination paper for TDT4145 Data Modelling and Database Systems

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

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

Chapter 9: Relational DB Design byer/eer to Relational Mapping Relational Database Design Using ER-to- Relational Mapping Mapping EER Model

DATABASTEKNIK - 1DL116

Relational Database Design (II)

VIEW OTHER QUESTION PAPERS

Review: Attribute closure

DATABASE MANAGEMENT SYSTEMS

CS403- Database Management Systems Solved MCQS From Midterm Papers. CS403- Database Management Systems MIDTERM EXAMINATION - Spring 2010

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

Introduction to Databases

FINAL EXAM REVIEW. CS121: Introduction to Relational Database Systems Fall 2018 Lecture 27

(At most 8 combina7ons of B,C,D composite values) AND (BCDà E) means (At most 8 values for E)

CSCI 403: Databases 13 - Functional Dependencies and Normalization

Transcription:

The University of British Columbia Computer Science 304 Midterm Examination February 8, 2010 Time: 50 minutes Total marks: 50 Instructor: Rachel Pottinger Name ANSWER KEY (PRINT) (Last) (First) Signature This examination has 5 pages. Check that you have a complete paper. This is a closed book, closed notes exam. No books or other material may be used. Answer all the questions on this paper. Give very short but precise answers. State any assumptions you make Work fast and do the easy questions first. Leave some time to review your exam at the end. Good Luck Question Mark Out of 1 7 2 18 3 10 4 15 Total

1. {5 marks} Consider the schema R(A, B, C, D, E, F, G, H, I) together with the functional dependencies: A B, C D. Assume that R1(A,B,C,D,E) is a relation obtained through decomposition of R. Is R1 in BCNF? Why or why not? If not, decompose into a collection of BCNF relations using the method we used in class and the book and circle the relations in your final answer. Show all your work. This is question 19.5 part 1 from the book A+=AB C+=CD therefore A is not a key of R1. Decompose on A B: R2(A,B), R3(A,C,D,E). R2 is in BC F since it has only two attributes. R3 is not in BC F since C is not a key of R3. Decompose on C D: R4(C,D), R5(ACE). Final answer: R2(A,B),R4(C,D),R5(A,C,E) Page 2

2. {20 marks} Consider the schema S(A, B, C, D, E) together with the functional dependencies: BD A AB C D A B C C E Is S in 3NF? Why or why not? If not, decompose into 3NF using the method we used in class and the book and circle all relations in your final answer. Show all your work. AB+=ABCE BD+=BDACE D+=AD B+=BCE C+=CE There is no way to get BD any other way, so BD is the only key. But the others do violate 3 F, so we need to decompose. First we have to take the minimal cover. BD A is redundant to D A. AB C is redundant to B C. So the only functional dependencies to consider are D A, B C, and C E. ote that because the cover only removes redundant functional dependencies, the original closures still holds. Start with D A. D is not a key, so decompose: S1(A,D), S2(D,B,C,E). S1 is in BC F since it is a two attribute relation. S2: B C still holds, but B is not a key of S2, so decompose: S3(B,C), S4(B,D,E). S3 is in BC F since it has only two attributes. S4 is not in BC F since B E holds in S4, but B is a key of S4. Decompose to S5(B,E), S6(B,D). All are two attribute relations, so all are in BC F. At this point our answer set is S1(A,D), S3(B,C), S5(B,E), S6(B,D). ow, we consider if there are any functional dependencies that need to be added back in. D A and B C are both covered (S1 and S3 respectively). C E is not. So we add in a new relation S5(C,E), brining our final answer to S1(A,D), S3(B,C), S5(B,E),S6(B,D),, S7(C,E) Page 3

3. {10 marks} Create an ER diagram for the following specification: A bank has a database with accounts. For each account it records the (unique) account number and the current balance. There are two types of accounts: chequing and savings. Savings accounts have an interest rate. Chequing accounts have a monthly fee. The database also has information about depositors --- their name, (unique) social-insurance number, and a single address. The bank stores, for each account, the depositor or depositors (in the case of joint accounts), that own the account. Each account must have at least one depositor. Page 4

4. {15 marks} Transform the ER diagram into a relational schema using the methods discussed in class/the book. State any assumptions that you make but your assumptions cannot contradict the facts given. a. {12 marks} Give the SQL DDL necessary to create the relational schema. You do not have to include types for any attributes ote that this problem is a modification of problem 4 on sample test 6. First, determine the relations should be without any DDL. We start with the easy ones: E(n,p), B(l,m). ext we do the weak entity: AZ(m,n,l). X is many to many, so we have to include the keys of B and Z plus the attributes of X: X(l,m,n,q). ext we need Y. As mentioned on WebCT Vista, when doing 1:1 relationships, you want to pick either entity to combine with Y. Because D has a total participation constraint with Y, you want to choose D as the entity to combine, since that way you can chose to have AZ have a not null constraint, so get rid of your earlier D entity and replace it with DY(r,s,m,n) and remember that you ll have to make m,n, not be null in the DDL. Thus, the DDL is: CREATE TABLE B( primary key (l)); CREATE TABLE E( p integer primary key (n)); CREATE TABLE DY( r integer, s integer, m integer OT ULL, n integer OT ULL, primary key (r), foreign key (m,n), references AZ(m,n) CREATE TABLE AZ( primary key (m,n), foreign key( n) references E); CREATE TABLE X( q integer, primary key (l,m,n), foreign key (m,n) references AZ(m,n), foreign key (l) references B); b. {3 marks} Are there any constraints in the relational schema that cannot be modeled without using assertions? If so, which constraint(s)? If not, why not? The constraint that B is total in X cannot be represented without assertions. Page 5