The University of British Columbia

Similar documents
CS 317 Mid Term Exam

The University of British Columbia

The University of British Columbia

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

GUJARAT TECHNOLOGICAL UNIVERSITY

Babu Banarasi Das National Institute of Technology and Management

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

Database Systems CSE Comprehensive Exam Spring 2005

Fundamentals of Database Systems

The University of British Columbia Computer Science 304 Practice Final Examination

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

The University of Nottingham

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

Database Management Systems (COP 5725) (Spring 2007)

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

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

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

CS145 Midterm Examination

Relational model continued. Understanding how to use the relational model. Summary of board example: with Copies as weak entity

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

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

Database Management Systems (Classroom Practice Booklet Solutions)

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

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

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

MaanavaN.Com DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING QUESTION BANK

Examination examples

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

Chapter 2: Intro to Relational Model

Computer Science 304

Homework 3: Relational Database Design Theory (100 points)

CS 564 Final Exam Fall 2015 Answers

EECS-3421a: Test #2 Queries

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

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

CSE-3421 Test #1 Design

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

CSE 444, Winter 2011, Midterm Examination 9 February 2011

Midterm Exam (Version B) CS 122A Spring 2017

Final Review. Zaki Malik November 20, 2008

Chapter 2: Intro to Relational Model

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

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

PART III SOLUTIONS TO REVIEW QUESTIONS AND EXERCISES

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

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

Database Design Theory and Normalization. CS 377: Database Systems

Schema And Draw The Dependency Diagram

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

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

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

COSC Dr. Ramon Lawrence. Emp Relation

Section 1: Redundancy Anomalies [10 points]

CS/B.Tech/CSE/New/SEM-6/CS-601/2013 DATABASE MANAGEMENENT SYSTEM. Time Allotted : 3 Hours Full Marks : 70

D.K.M COLLEGE FOR WOMEN(AUTONOMOUS),VELLORE DATABASE MANAGEMENT SYSTEM QUESTION BANK

Introduction to Databases Exam

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

DATABASE MANAGEMENT SYSTEMS

FUNCTIONAL DEPENDENCIES

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

VIEW OTHER QUESTION PAPERS

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

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

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

SCHEMA REFINEMENT AND NORMAL FORMS

CSE 444 Midterm Test

1. (a) Explain the Transaction management in a database. (b) Discuss the Query Processor of Database system structure. [8+8]

CS 474, Spring 2016 Midterm Exam #2

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CSE 544 Principles of Database Management Systems

Optimizing logical query plans

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

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

CSIT5300: Advanced Database Systems

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

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

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 exam is open book; any written materials may be used, as well as on-line or

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Relational Model and Relational Algebra A Short Review Class Notes - CS582-01

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

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Database Management Systems Paper Solution

Objective. The goal is to review material covered in Chapters 1-5. Do the following questions from the book.

Database Management Systems (Solutions for Vol 1_Classroom Practice Questions)

UNIVERSITI SAINS MALAYSIA. CIT503 Databases and E-Commerce Rapid Application Development. CSI512 Database Management Systems

CSE 414 Midterm. April 28, Name: Question Points Score Total 101. Do not open the test until instructed to do so.

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

CHALMERS UNIVERSITY OF TECHNOLOGY Department of Computer Science and Engineering Examination in Databases, TDA357/DIT620 Thursday 27 March 2008, 08:30

Unit- III (Functional dependencies and Normalization, Relational Data Model and Relational Algebra)

2011 DATABASE MANAGEMENT SYSTEM

CSE 544 Principles of Database Management Systems

SAMPLE FINAL EXAM SPRING/2H SESSION 2017

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

McGill April 2009 Final Examination Database Systems COMP 421

EECS-3421a: Test #1 Design

Databases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24

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

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

Transcription:

The University of British Columbia Computer Science 304 Midterm Examination February 23, 2005 Time: 50 minutes Total marks: 50 Instructor: George Tsiknis Name (PRINT) (Last) (First) Signature This examination has 8 pages. Check that you have a complete paper. MARKS This is a closed book exam. No books or other material may be used. Answer all the questions on this paper. Give very short but precise answers. Always use point form where it is appropriate. Work fast and do the easy questions first. Leave some time to review your exam at the end. The marks for each question are given in {}. Use this to manage your time. Do not spend on a question more minutes than the marks assigned to it. 1. 2. 3. 4. Total Good Luck

1. {8 marks, 1 mark per question} Circle only one answer per question: a. In designing relational databases, we always desire our final tables to be in BCNF and we can always decompose any design to a BCNF design. b. A weak entity set in an ER diagram represents a collection of entities for which we have not discovered a key yet. Later in the design phase when we learn more about the domain, this set will be converted into a strong entity set by adding the appropriate attributes. c. A relation may have a number of candidate keys, but has only one primary key. d. If every attribute of a table functionally depends on the primary key, the table is in 3NF. e. Every table with 2 single valued attributes is in 1NF, 2NF, 3NF and BCNF. YOU ARE NOT RESPONSIBLE FOR THE 1NF & 2NF PART OF THIS QUESTION f. A table is in the second normal form (2NF) if every attribute is determined by every candidate key, but is not determined by any pure subset of a candidate key. YOU ARE NOT RESPONSIBLE FOR THIS QUESTION g. If r(a, C) and s(a, D) are any relations with the given attributes, the following RA expressions are equivalent. i) r s ii) π A,C, D ( σ r.a=s.a ( r x s)) h. The Relational Algebra, the Tuple Relational Calculus and the Domain Relational Calculus are three equivalent formalisms that can be used to express queries for relational databases. Page 2

2. {12 marks} Answer the following questions in the space provided. Be brief and precise. a. {4 marks} Consider the following ER diagram: A B where A, B and C are entity sets. C i) Specify the condition(s) that is(are) necessary in order to represent all three sets with a single table. ii) Specify the condition(s) that is(are) necessary in order to represent all three sets with two tables, one for B and one for C. b. {4 marks} Consider the schema R = (A, B, C, D, E) together with the functional dependencies: A C A, B D C, D E Suppose we decompose R into R1 = (A, B, C, D) and R2 = (A, D, E) Prove that this decomposition is a lossless join decomposition Page 3

c. {4 marks} Suppose we define a database about the customers of a bank and the loans they have received from the bank. For each customer we need to record information about their name, address, phone number and the company they work for. For each loan we need to record the amount, the interest rate, date the loan was issued, and the date the loan should be paid off. i) Is it a good idea to represent the company for which a customer works as an attribute of the customer or as a relationship? Briefly justify your answer. ii) Which is the best way to represent the relationship between the customer and their loans: by defining the loan as an attribute of the customer, or by making the loan a separate entity set and defining a relationship set between it and the customer? Briefly justify your answer. Page 4

3. {12 marks} Consider the following ER diagram that models a patient database of a local hospital. In this diagram, phn, pname, illness, and ward are a patient's personal health number, name, reported illness and hospital ward she/he has been admitted to, while dname,and specialization are a doctor's name and specialization. Medical tests have a name and a lab type required for the test, and are authorized by a doctor. Finally, if a patient had any such test, the date and the results of the test are recorded. address pname phn illness Patient date ward result testname Had Test labtype dname Authorizes specialization Doctor Suppose we have also discovered the following functional dependencies: fd1: phn pname, address, illness fd2: pname, address phn fd3: illness ward fd4: testname labtype a. {2 marks}suppose we define a table Patient(phn, pname, address, illness, ward). List all the candidate keys for this table Candidate keys: Page 5

b. {6 marks}show the tables you get by applying the ER to table algorithm we discussed in the class to this ER diagram. In each table underline the primary key. If a table has many candidate keys, chose the shortest one as the primary key. c. {4 marks}show the BCNF tables we get by applying normalization techniques to the tables in part (b). Underline the primary keys of the new tables. Page 6

4. {18 Marks} Consider a relational database about hotels, customers (guests) and their bookings that is maintained by an on line hotel booking company. The database consisting of the following tables(where the primary keys are underlined): Hotel (hid, hname, haddress, hcity) Guest( gid, gname, gaddress, gcity) Room( hid, roomno, type, price ) Booking(gId, hid, roomno, fromdate, year, noofdays ) Where, hid and gid are identifiers for the hotels and the guests, and the Booking relation indicated that a guest booked a hotel room for a specified number of days (noofdays) starting from fromdate of a given year. For instance, a tuple < g12345, h5555, 220, Jan05, 2005, 8> in Booking indicates that guest g12345 booked room 220 of the h5555 hotel for 8 days starting on Jan 5, 2005. a. {6 Marks}Write a relational algebra expression that returns the ids of the hotels located in Vancouver which were not booked at all in the year 2005. Page 7

b. {6 Marks}Write a relational algebra expression that returns the ids of the guests who have booked at least one room of type suite in every hotel located in Vancouver. c. {6 Marks}Write a Tuple Relational Calculus (TRC) query that finds the ids and names of the hotels for which every one of our guests had made a booking during the year 2004. YOU ARE NOT RESPONSIBLE FOR THE MATERIAL IN THIS QUESTION. BUT DO KNOW HOW TO READ A DOMAIN RELATIONAL CALULUS QUERY Page 8