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

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

Integrity Constraints in the Relational Model

Database Management

Database Management

LABSHEET 1: creating a table, primary keys and data types

Supplier-Parts-DB SNUM SNAME STATUS CITY S1 Smith 20 London S2 Jones 10 Paris S3 Blake 30 Paris S4 Clark 20 London S5 Adams 30 Athens

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

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

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

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

CS 338 Functional Dependencies

Database Systems. Basics of the Relational Data Model

Home Page. Title Page. Page 1 of 14. Go Back. Full Screen. Close. Quit

Lecture 15: Database Normalization

DATABASE MANAGEMENT SYSTEMS

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

Unit 2. Unit 3. Unit 4

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

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

Niklas Fors The Relational Data Model 1 / 17

Essay Question: Explain 4 different means by which constrains are represented in the Conceptual Data Model (CDM).

CS211 Lecture: Database Design

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

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

UNIT 3 DATABASE DESIGN

BIRKBECK (University of London)

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

Databases The theory of relational database design Lectures for m

Course Outline Faculty of Computing and Information Technology

Informal Design Guidelines for Relational Databases

Chapter 6: Relational Database Design

Case Study: Lufthansa Cargo Database

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

Concepts from

KINGDOM OF SAUDI ARABIA-JAZAN UNIVERSITY COLLEGE OF COMPUTER SCIENCE & INFORMATION SYSTEMS 221 INFS 3 DATABASE SYSTEMS-1 REVIEW QUESTIONS

The Relational Model and Normalization

Schema And Draw The Dependency Diagram

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

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

M S Ramaiah Institute of Technology Department of Computer Science And Engineering

DATABASE DEVELOPMENT (H4)

Schema Refinement: Dependencies and Normal Forms

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

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

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

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

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

SQL Interview Questions

Schema Refinement: Dependencies and Normal Forms

Relational Design: Characteristics of Well-designed DB

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, normal forms. University of Edinburgh - January 25 th, 2016

VIEW OTHER QUESTION PAPERS

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms

Database Normalization. (Olav Dæhli 2018)

Schema Refinement: Dependencies and Normal Forms

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

Relational Database design. Slides By: Shree Jaswal

Examination paper for TDT4145 Data Modelling and Database Systems

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

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

Querying Data with Transact-SQL

CSE 544 Principles of Database Management Systems

AC61/AT61 DATABASE MANAGEMENT SYSTEMS DEC 2013

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

Database Processing. Fundamentals, Design, and Implementation. Global Edition

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

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

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

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

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

CSE 444 Midterm Test

Relational Model, Key Constraints

High-Level Database Models. Spring 2011 Instructor: Hassan Khosravi

Relational Model. Rab Nawaz Jadoon DCS. Assistant Professor. Department of Computer Science. COMSATS IIT, Abbottabad Pakistan

Database Management Systems Paper Solution

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

CS2300: File Structures and Introduction to Database Systems

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

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

Normalisation Chapter2 Contents

Lecture 4. Database design IV. INDs and 4NF Design wrapup

Relational Algebra. Spring 2012 Instructor: Hassan Khosravi

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

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

CS275 Intro to Databases

12. MS Access Tables, Relationships, and Queries

Birkbeck (University of London)

IS 263 Database Concepts

Applied Databases. Sebastian Maneth. Lecture 5 ER Model, Normal Forms. University of Edinburgh - January 30 th, 2017

DOWNLOAD PDF INSIDE RELATIONAL DATABASES

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

Database Design Theory and Normalization. CS 377: Database Systems

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

Announcements (January 20) Relational Database Design. Database (schema) design. Entity-relationship (E/R) model. ODL (Object Definition Language)

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

CSE 544 Principles of Database Management Systems

Lecture 11 - Chapter 8 Relational Database Design Part 1

Unit 3 : Relational Database Design

A Sample Solution to the Midterm Test

Transcription:

Birkbeck (University of London) BSc/FD EXAMINATION Department of Computer Science and Information Systems Database Management (COIY028H6) CREDIT VALUE: 15 credits Date of examination: Monday 9th June 2014 Duration of paper: (14:30 16:30) There are five questions on this paper. Answer only four of the five questions. Each question carries 25 marks in total. The paper is not prior-disclosed. The use of electronic calculators is not permitted. COIY028H6 Page 1 of 6 c Birkbeck College 2014

1. (a) The relational model requires that all relations be in first normal form. Explain what this means. Recall that the entity-relationship (ER) model allows for multi-valued attributes. Explain why these are incompatible with the first normal form requirement of the relational model. Given an entity type with a multivalued attribute in an ER model, how would you represent this in the relational model? (e) SQL allows the use of (table) aliases (also know as tuple variables) in a query. How are aliases declared in SQL? Describe one situation in which the use of aliases is essential, and one situation in which their use is helpful. Explain the differences between (i) a superkey and a key, and (ii) a superkey and a functional dependency. Consider an example relation schema Reviews, with schema(reviews) = {Book, Rating, Author} on which a single functional dependency Book Author holds. Let a relation over Reviews be given by Book Rating Author Amsterdam Good McEwan Amsterdam Excellent McEwan Disgrace Good Coetzee Disgrace Average Coetzee If we decompose Reviews into {Book, Rating} and {Rating, Author} and then perform the natural join of the decomposed relations, we get back two tuples that were not in the original relation. i. What is the name given to this type of join or decomposition and why is it considered undesirable? (3 marks) ii. In general, what condition on decomposing a relation schema will prevent the above situation arising? (2 marks) When SQL is used along with a language such as PHP, there is a possibility of using placeholders in the SQL. Explain the purpose of placeholders. Name the two different kinds of placeholder, demonstrating their use with examples. COIY028H6 Page 2 of 6 c Birkbeck College 2014

2. (a) Using the entity-relationship (ER) model, assume that we want to model the rates relationship type between users of Amazon and products available for sale on Amazon. So a rates relationship between user u and product p represents the fact that user u has rated product p on Amazon. What multiplicity and participation constraints should be specified for the rates relationship type? Justify your answers. When creating a table definition for a table T, say, in SQL, one can specify constraints such as (i) primary key (A 1,..., A n ) (ii) foreign key (A 1,..., A n ) references R where A 1,..., A n refer to column names and R denotes a table name. Explain precisely what conditions the DBMS will enforce as a result of each of the above two constraints. SQL provides a number of different ways in which a normal (inner) join operation (i.e., not a natural join or outer join) can be specified. Describe three different syntactic constructs in SQL which specify join operations. Let U be a relation schema with schema(u) = CT HRSG, where the meaning of the attributes is as follows: C (course), T (teacher), H (hour), R (room), S (student) and G (grade). Let F be the following a set of functional dependencies (FDs) over U: C T, i.e. a course has one teacher. HR C, i.e. a room can only have one course at any time. HT R, i.e. a teacher can only be in one room at any time. CS G, i.e. a student has one grade per course. HS R, i.e. a student can only be in one room at any time. i. Compute the closure of the set of attributes CH, explaining each step of the computation. (2 marks) ii. Find a key for U, explaining why it is a key. (2 marks) iii. Now produce a decomposition of U into Third Normal Form, explaining each step you used to arrive at the decomposition. (6 marks) COIY028H6 Page 3 of 6 c Birkbeck College 2014

3. (a) Consider a relational database schema in which there are four relations, Part, Supplier, Project and Supply. The schemas of the relations are as follows: schema(part) = { PNum, PName }, schema(supplier) = { SNum, SName }, schema(project) = { JNum, JName }, schema(supply) = { SNum, PNum, JNum, Qty }. Primary key attributes have been underlined above. Draw an entity-relationship diagram which models the same information and from which the above relation schemas might have been derived. (10 marks) In SQL, we can group a sequence of statements into a transaction. Transactions can end their execution in one of two ways. Give the names for the two operations which end a transaction and explain how the database is affected by each. The relational model allows the use of NULL values to represent unknown or inapplicable values. While this feature is very useful, it also causes some complications. Describe three situations in which the use of NULL values either complicates the syntax of SQL or makes query processing more involved. Compare Boyce-Codd Normal Form and Third Normal Form in terms of their relative advantages and disadvantages. COIY028H6 Page 4 of 6 c Birkbeck College 2014

4. (a) Assume that a database contains a relation Sales with schema(sales) = {Invoice, Day, Month, Amount}. Explain what the query SELECT Month, SUM(Amount) FROM Sales GROUP BY Month HAVING COUNT(Invoice) < 10; returns when executed on the database. Consider the following relation over the schema Films, representing information about films and actors: Title Year Genre StarName Star Wars 1977 SciFi Carrie Fisher Star Wars 1977 SciFi Harrison Ford Raiders... 1981 Action Harrison Ford Raiders... 1981 Adventure Harrison Ford When Harry... 1989 Comedy Carrie Fisher Assume that Title Year is the only functional dependency which holds on the schema Films. i. What is the only key for Films? (2 marks) ii. Give an example of a redundancy problem for Films. (2 marks) iii. Give an example of an insertion anomaly for Films, explaining why it is an anomaly. (2 marks) iv. Decompose Films into relation schemas in Boyce-Codd Normal Form, explaining how you arrived at the decomposition. (4 marks) SQL transactions are meant to be atomic. Explain what the term atomic means, and demonstrate, using an example, a problem which would arise if a transaction were not atomic. Name five features provided by object-relational database systems which are not available in (pure) relational database systems. COIY028H6 Page 5 of 6 c Birkbeck College 2014

5. (a) Database systems provide three levels of abstraction which support data independence. Describe the three levels and the extent to which they can guarantee data independence. Assume that we have a relation over schema Supply(Supplier, Part, Quantity) and a view defined as follows: CREATE VIEW bigsuppliers AS SELECT Supplier, Part FROM Supply WHERE Quantity > 1000; A user issues the following SQL command: INSERT INTO bigsuppliers VALUES ( ABC Ltd, Axle ); What condition(s) must be true in order for this command to execute without generating an error message? What is the result of the command, assuming that it executes successfully? Give a short explanation of what is meant by each of the following terms: i. embedded SQL ii. dirty read iii. left outer join iv. correlated subquery v. dependency preservation (10 marks) Assume that you are using PHP to issue a query to a relational database such as MySQL, and that the answer of the query is returned in the variable $result. Explain how you would print out all the attribute values in each row of the result. You can use a fragment of code to illustrate your answer if you wish. COIY028H6 Page 6 of 6 c Birkbeck College 2014