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

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

NOTE 1: This is a closed book examination. For example, class text, copies of overhead slides and printed notes may not be used. There are 11 pages.

DATABASE MANAGEMENT SYSTEMS

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

Babu Banarasi Das National Institute of Technology and Management

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

Examination paper for TDT4145 Data Modelling and Database Systems

Data Modeling and the Entity-Relationship Model

Translating Entity-Relationship to Relational Tables

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

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

Translating Entity-Relationship to Relational Tables

Database Systems Management

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

VIEW OTHER QUESTION PAPERS

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

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

Schema And Draw The Dependency Diagram

CMSC 461 Final Exam Study Guide

CSE 444, Winter 2011, Midterm Examination 9 February 2011

The University of British Columbia

B.C.A DATA BASE MANAGEMENT SYSTEM MODULE SPECIFICATION SHEET. Course Outline

Database Management Systems Paper Solution

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

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

BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT

The University of Nottingham

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

CSE 344 Final Examination

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

GUJARAT TECHNOLOGICAL UNIVERSITY

E-R Diagram to Relational Schema. Translating Entity-Relationship to Relational Tables. Representing Weak Entity Sets. Representing Strong Entity Sets

XI. Transactions CS Computer App in Business: Databases. Lecture Topics

Data Modeling and the Entity-Relationship Model

CS145 Final Examination

INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados

Goals for Today. CS 133: Databases. Final Exam: Logistics. Why Use a DBMS? Brief overview of course. Course evaluations

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

CSE 444: Database Internals. Lectures Transactions

L i (A) = transaction T i acquires lock for element A. U i (A) = transaction T i releases lock for element A

CSCI 5333 DBMS Fall 2018 Mid-Term Examination. Last Name: First Name: Student Id:

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

MaanavaN.Com DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING QUESTION BANK

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

McGill April 2009 Final Examination Database Systems COMP 421

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

15CS53: DATABASE MANAGEMENT SYSTEM

Question 1. SQL and Relational Algebra [25 marks] Question 2. Enhanced Entity Relationship Data Model [25 marks]

Introduction to Data Management CSE 414

SECOND SEMESTER BCA : Syllabus Copy

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

Homework 3: Relational Database Design Theory (100 points)

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

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

Database Management Systems MIT Introduction By S. Sabraz Nawaz

CSE 444 Midterm Exam

Rajiv GandhiCollegeof Engineering& Technology, Kirumampakkam.Page 1 of 10

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

Contact Hours / week: 4 Total hours: 64. Table of Contents Architecture 3 Data Modeling Using the Entity-

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

CS145 Final Examination

Midterm 2: CS186, Spring 2015

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

Database Systems CSE 414

CSE 344 MARCH 9 TH TRANSACTIONS

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

CSE344 Final Exam Winter 2017

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

SYED AMMAL ENGINEERING COLLEGE

CS425 Midterm Exam Summer C 2012

CMPS 181, Database Systems II, Final Exam, Spring 2016 Instructor: Shel Finkelstein. Student ID: UCSC

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

COSC Dr. Ramon Lawrence. Emp Relation

Introduction to Data Management CSE 344

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

CS 245 Midterm Exam Solution Winter 2015

Translating an ER Diagram to a Relational Schema

E.G.S. PILLAY ENGINEERING COLLEGE (An Autonomous Institution, Affiliated to Anna University, Chennai) Nagore Post, Nagapattinam , Tamilnadu.

Homework 2: Query Processing/Optimization, Transactions/Recovery (due February 16th, 2017, 9:30am, in class hard-copy please)

Sample Question Paper

INSTITUTO SUPERIOR TÉCNICO Administração e optimização de Bases de Dados

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001

BBM371- Data Management. Lecture 1: Course policies, Introduction to DBMS

UNIVERSITY OF BOLTON WESTERN INTERNATIONAL COLLEGE FZE BSC (HONS) COMPUTING SEMESTER ONE EXAMINATION 2015/2016 DATABASE THEORY AND PRACTICE

CS6302- DATABASE MANAGEMENT SYSTEMS- QUESTION BANK- II YEAR CSE- III SEM UNIT I

CS 132 Midterm Exam Winter 2002

Name Class Account UNIVERISTY OF CALIFORNIA, BERKELEY College of Engineering Department of EECS, Computer Science Division J.

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

Intro to Transactions

Course Title: Introduction to Database Management System Course Code: CSIT116 Course Level: UG Course Credits:04 L T P/ S SW/F W

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

Queen s University Faculty of Arts and Science School of Computing CISC 432* / 836* Advanced Database Systems

2011 DATABASE MANAGEMENT SYSTEM

Textbook: Chapter 4. Chapter 5: Intermediate SQL. CS425 Fall 2016 Boris Glavic. Chapter 5: Intermediate SQL. View Definition.

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

DATABASE MANAGEMENT SYSTEM

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

The DBMS accepts requests for data from the application program and instructs the operating system to transfer the appropriate data.

Transcription:

CS348: INTRODUCTION TO DATABASE MANAGEMENT (Winter, 2011) FINAL EXAMINATION INSTRUCTOR: Grant Weddell TIME: 150 minutes WRITE YOUR NAME AND ID HERE: NOTE 1: This is a closed book examination. For example, class text, copies of overhead slides and printed notes may not be used. There are 21 pages. Answer all questions in the space provided. NOTE 2: Some of the questions in this examination are open ended; however, they can be answered to an appropriate level by short organized answers. It is recommended that you spend part of your time organizing your answer, rather than writing down ideas in the order they occur to you. The conciseness and organization of your answers will be taken into consideration in the grading. NOTE 3: There are 100 marks in total. As a guide to managing your time, the marks awarded for each question are indicated in parenthesis at the start of each question. NOTE 4: You are also being tested on your ability to understand the questions. In the case of a perceived ambiguity, state a clear assumption and proceed to answer the question. NOTE 5: Write all your answers on the space provided on the exam. NOTE 6: Cheating is an academic offense. Your signature below indicates that you understand and agree to the University s policies regarding cheating on exams. PLEASE SIGN HERE: 1

I. (20 marks; continued on next two pages) Questions on relational database design, on functional dependencies and on normalization theory. Answer each part. (a) In no more than two sentences, explain each of the following. 1. deletion anomaly 2. completeness of Armstrong s axioms 3. first normal form 2

(b) Describe an algorithm that efficiently solves each of the following two problems. (Assume that a relation scheme consists of a set of attributes R and a set of functional dependencies F over those attributes.) 1. Given R and F together with a binary decomposition, determine if the latter is a lossless-join decomposition. 3

2. Given R and F and an alternative set of functional dependencies G, determine if F + is the same as G +. 4

(c) Indicate whether each of the following statements is true or false. In each case justify your answer with no more than three sentences or examples. 1. Given a set of attributes R and a set of functional dependencies F over those attributes, the number of candidate keys on R is O( F k ), where k is some constant and where F is the number of occurrences of attributes in F. 2. Primary keys behave differently from candidate keys. 5

3. Limiting functional dependencies by allowing at most two attributes on their lefthand-side and a single attribute on their right-hand-side does not reduce their expressiveness. 6

II. (24 marks; continued on next three pages) Consider the following SQL data definition for maintaining information about employees at a hypothetical company. CREATE TABLE emp ( num INTEGER NOT NULL, name VARCHAR(20) NOT NULL, dept VARCHAR(20) NOT NULL, salary INTEGER NOT NULL, boss INTEGER NOT NULL, PRIMARY KEY (num), FOREIGN KEY (boss) REFERENCES emp (num) ); You can assume that there is one president that has herself/himself as the boss, that all other employees have a boss that is someone else and that there are no cycles in the boss hierarchy for anyone other than the president. (A cycle would exist if, for example, Fred was the boss of Mary and Mary was in turn the boss of Fred.) Translate each of the following queries on this schema to SQL. In each case, also indicate if the query can be expressed in the relational algebra. (a) The number and name of each employee, excluding the president, together with the number and name of the employee s boss. The result should be sorted by the name of the boss and then by the name of the employee. 7

(b) The names of the departments with the highest average salary of their employees. (c) The numbers and names of employees who have the president as their boss, and that have a salary among the lowest of those employees who do not have the president as their boss. 8

Now write queries in the relational calculus and relational algebra on the same schema to answer each of the following. (d) The numbers, names and departments of employees that are not the boss of any other employees. (e) The numbers, names and departments of employees that have the highest saleries in their respective departments. 9

III. (14 marks; continued on the next page) Questions on advanced SQL and on programming applications. Answer each of the five parts using no more than three sentences in each case. (a) Consider developing an application using a SQL DBMS. 1. Consider the assertion: it is not possible to avoid the overhead of query optimization if one uses the dynamic embedded SQL standard. Is this true or false? Justify your answer. 2. When writing application programs using C and the embedded SQL standard, explain how code written in C communicates with code written in SQL. 10

(b) Explain the purpose of each of the following. 1. an embedded SQL preprocessor 2. a cursor 3. the ROLLBACK WORK command 11

(c) Explain why it might be worthwhile to code SQL stored procedures when developing an application. For example, is there any incentive relating to performance? 12

IV. (12 marks; includes next page) Your company is starting the development of a patient billing system to be marketed to private medical practices in Ontario. The system is to be called PATMAN (short for PATient billing MANager), and is to run as a remote client-server system using several commodity grade personal computers and a local area network. An initial analysis phase of the project has resulted in the following description of the relevant data for PATMAN. A practice has a number of patients and doctors. Doctors are identified by name. Each patient has a number used to identify the patient called the OHIP number, a name and an age. Each patient is either a male or female and has a next of kin identified by name. Each medical procedure paid by the government of Ontario is identified by a procedure code and has a description and a charging category. Each charging category has a dollar value. Each patient has a number of billing records, with each billing record recording the medical procedure, the date on which the procedure was performed, the examining doctor and some additional comments on the part of the examining doctor. Billing records are either outstanding or paid in full. Draw an ER diagram on the next page that represents the PATMAN data. include comments below to explain any unusual representation decisions. In addition, 13

14

V.(15 marks) Further questions on ER diagrams. Do each part. (a) Draw an ER diagram with an entity set E that is over constrained, that is, for which it is not possible for E to have any entities. 15

(b) Your company has been awarded a contract to implement an information system for a foreign company. The contract includes a specification of the relevant information in the form of the following ER diagram. CourseNum Term Course (0, N) SectionOf (1, 1) CourseName SectionNum (1, 1) Section (6, 50) TaughtBy EnrolledIn Mark Professor Off Site Section Student GPA ProfName Location StudentName ProfNum StudentNum Convert the ER diagram to a relational schema on the next page. Your schema can be described by a set of CREATE TABLE commands or by using the UML-like box notation used in class. Using a single sentence for each case, explain any constraints reflected in the ER diagram that are not captured by your relational schema. 16

17

VI. (15 marks; continue on next three pages) Questions on transactions, concurrency control and recovery. Answer each part. Assume there is a part table given by the following when relevant. pnum pname color price dept 1 Disk Red 200.00 Machining 2 Axle Blue 120.00 Machining 4 Cog Blue 30.00 Milling 5 Block Green 500.00 Milling Consider the following sequence of operations on the database, assumming all four clients are operating at isolation level 0, that access and update tuples in the part table. T 1 : begin T 1 : read the price of part 4 T 2 : begin T 2 : change the color of part 4 to yellow T 3 : begin T 3 : read the price of part 4 T 1 : read the color of part 1 T 4 : begin T 4 : change the name of part 1 to Block T 2 : change the price of part 5 to 150.00 T 3 : read the price of part 2 T 2 : commit T 4 : change the department of part 5 to Machining T 1 : commit T 3 : commit T 4 : commit 18

(a) Assume a database engine accomplishes concurrency control by a strict two-phase locking protocol, with locks being granted on individual tuples. For example, the fourth request requires that transaction T 2 successfully acquires an exclusive lock on the first tuple before executing. List the requests in a possible order of actual execution by the engine when all clients are operating at isolation level 3. 19

(b) Suppose that a system failure occurs after the requests shown above have been processed (according to the strict 2PL protocol). Indicate the fate (commit or abort) of each of the transactions whose requests appear in the sequence above. Also, show the contents of the part table after the system has recovered from the failure, and before any new transactions are allowed to run. (c) Briefly explain why the SQL standard enables applications to set isolation levels. Also, outline an example of a circumstance in which it makes sense for a client on behalf of some application to set the isolation level to 0. 20

(d) Indicate whether each of the following statements is true or false. In each case, justify your answer with no more than three sentences. 1. Given an arbitrary schedule for interleaving the execution of a given set of transactions, there is an efficient algorithm to determine if the schedule is serializable. 2. Given that a system failure had occurred, there is an efficient algorithm to recover all transactions that were aborted by using a log. 21