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)

Database Management

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

Database Management

CS 338 Functional Dependencies

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

BIRKBECK (University of London)

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

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Schema Refinement: Dependencies and Normal Forms

Schema Refinement: Dependencies and Normal Forms

Schema Refinement: Dependencies and Normal Forms

DATABASE MANAGEMENT SYSTEMS

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

Chapter 6: Relational Database Design

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

VIEW OTHER QUESTION PAPERS

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

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

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

Part II: Using FD Theory to do Database Design

COSC Dr. Ramon Lawrence. Emp Relation

Relational Database Design (II)

Examination paper for TDT4145 Data Modelling and Database Systems

The University of Nottingham

Homework 3: Relational Database Design Theory (100 points)

CSE 562 Database Systems

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

Dr. Lyn Mathis Page 1

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

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

CSIT5300: Advanced Database Systems

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

UNIT 3 DATABASE DESIGN

CSE344 Final Exam Winter 2017

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

Informal Design Guidelines for Relational Databases

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

Relational Database design. Slides By: Shree Jaswal

Chapter 8: Relational Database Design

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

Database Management Systems Paper Solution

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

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

Database design III. Quiz time! Using FDs to detect anomalies. Decomposition. Decomposition. Boyce-Codd Normal Form 11/4/16

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Desired properties of decompositions

4. Entity Relationship Model

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

Unit 3 : Relational Database Design

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

Database Normalization. (Olav Dæhli 2018)

CSE 544 Principles of Database Management Systems

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

The Relational Model and Normalization

Exam (Version B) for CSE 480 (2018)

Normalisation. Normalisation. Normalisation

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

Steps in normalisation. Steps in normalisation 7/15/2014

Theory of Normal Forms Decomposition of Relations. Overview

DATABASTEKNIK - 1DL116

CMSC 461 Final Exam Study Guide

Relational Data Structure and Concepts. Structured Query Language (Part 1) The Entity Integrity Rules. Relational Data Structure and Concepts

Babu Banarasi Das National Institute of Technology and Management

. : B.Sc. (H) Computer Science. Section A is compulsory. Attempt all parts together. Section A. Specialization lattice and Specialization hierarchy

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

Final Review. Zaki Malik November 20, 2008

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

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

Functional dependency theory

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

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

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

Functional Dependencies and Finding a Minimal Cover

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

Fundamentals of Database Systems

CSCI 403: Databases 13 - Functional Dependencies and Normalization

Course Outline Faculty of Computing and Information Technology

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

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

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

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

The Relational Model

Lecture 5 Design Theory and Normalization

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

Databases The theory of relational database design Lectures for m

DBS Database Systems Designing Relational Databases

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up

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

Homework 6. Question Points Score Query Optimization 20 Functional Dependencies 20 Decompositions 30 Normal Forms 30 Total: 100

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

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

Relational Design: Characteristics of Well-designed DB

Unit 2. Unit 3. Unit 4

L Information Systems for Engineers. Final exam. ETH Zurich, Autumn Semester 2017 Friday

CSE 444, Winter 2011, Midterm Examination 9 February 2011

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

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

Functional Dependencies and Normalization

Exam (Version B) for CSE 480 (2018) KEY

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: 9 June 2016 Duration of paper: (14:30 16:30) There are five questions on this paper. Answer only four of the five questions. If you answer more than four questions, only the best four answers will count. 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 2016

1. (a) Consider the following fragment of an Entity-Relationship Diagram: Sno Price Pno Supplier Supplies Part i. What is the cardinality (or multiplicity) of the Supplies relationship type? (1 mark) ii. Describe the participation constraints represented above. iii. How would the Supplies relationship type be represented in the relational model (i.e., give the relation schema and any necessary constraints)? You can assume that the Supplier and Part entity types are represented by relation schemas of the same names. Consider a relation schema Course, with schema(course) = {Code, Name, Level, Textbook}, where Code is the course code, Name its name, Level its FHEQ level (4, 5, 6, 7), and Textbook the name of a textbook recommended for the course. Assume we have established that the following functional dependencies (FDs) hold: Code Name Code Level Name Code Name Level i. Identify a redundant FD among the four given above, explaining why it is redundant. ii. Identify two keys for the Course schema, demonstrating why they are keys. (4 marks) iii. Decompose the Course schema into Boyce-Codd Normal Form (BCNF), explaining each step of the decomposition. When comparing the value of an attribute, say Spouse, to a NULL value in SQL, one is required to use the syntax Spouse IS NULL or Spouse IS NOT NULL (rather than using = or!=). Explain why this special syntax is required. COIY028H6 Page 2 of 6 c Birkbeck College 2016

2. (a) Assume that we have relation schemas Visits(person,store), Sells(store,item) and Likes(person,item), representing the stores people visit, the items sold by stores, and the items liked by people, respectively. Now consider the following SQL query: (d) (e) select person, store from Visits V where store not in (select store from Sells S, Likes L where S.item=L.item and L.person=V.person); i. What is the name given to constructs such as those represented by V, S and L in the above SQL query? (1 mark) ii. The subquery in the above SQL query is known as a correlated subquery. Explain what this term means, with reference to the above example. iii. Describe what will be returned by the query, i.e., what the relationship is between each person and store returned in the answer. Let U be a relation schema with schema(u) = ABCDEG. Let F be the following set of functional dependencies (FDs) over U: AB C AD E B D AG B i. Compute the closure of the set of attributes AB, explaining each step of the computation. ii. Find a key for U, explaining in detail why it is a key. Describe the four steps needed to arrive at a Third Normal Form decomposition of a set of attributes U, given a set of functional dependencies F. (4 marks) Name the three different types of update anomaly which can occur in a relational database. Describe two different situations which can give rise to two of these anomalies. How are null values handled by aggregation operators in SQL? How are null values handled by the GROUP BY construct in SQL? COIY028H6 Page 3 of 6 c Birkbeck College 2016

3. (a) Assume that we have the following three relation schemas Module(m_code, m_name) Student(s_id, s_name) Result(s_id, m_code, grade) with primary keys m code, s id and (s id, m code), respectively. Relation Module associates each module code with its name, relation Student associates each student id with a student name, and relation Result stores the grade achieved by each student in each module taken. i. Describe (in full) any foreign key constraints you would expect to be specified. What purpose would these constraints serve? ii. Now consider the following view definition: create view Transcript(student, module, mark) as select s_name, m_name, grade from Student S, Module M, Result R where S.s_id=R.s_id and M.m_code=R.m_code; Describe (in full) the output returned by the following SQL query: select * from Transcript where student like %Jones ; iii. The view defined in 3(a)ii above is not updatable according to the SQL specification. State why, from a syntactic point of view, Transcript is not updatable. Now explain the problems a database system would have if it did try to execute the following statement: insert into Transcript values ( A.N. Other, Database Management,85); You should consider all possible scenarios in your answer. Consider the following fragment of PHP code: while ($row = $result->fetch()) { print ("<tr>"); for ($i = 0; $i < $result->columncount(); $i++) { print ("<td> $row[$i] </td>"); } print ("</tr>"); } where the variable $result contains the result returned by some query to a database. Explain in detail what the above fragment of code does, also explaining the meaning and use of fetch() and columncount(). (8 marks) COIY028H6 Page 4 of 6 c Birkbeck College 2016

4. (a) One of the properties of transactions is that they should execute atomically. What is meant by the term atomically? Use an example, consisting of a specific sequence of instructions, to illustrate what can go wrong if transactions do not execute atomically. (8 marks) Give three limitations of the relational model which have led to alternative data models being proposed. Name four of these alternative models. (7 marks) Consider a relation over the schema contributes(artist, song, role), where a tuple such as (a, b, c) denotes the fact that artist a contributes to song b in the role c (e.g., singer or drummer ). Explain precisely what each of the following statements means (do not say whether or not you believe they are true). i. The functional dependency artist role is satified by the relation. ii. The functional dependency artist song is violated by the relation. Now for each of the following functional dependencies iv. artist, song role v. artist, role song vi. song, role artist explain why you would not expect them to hold on the contributes relation schema. COIY028H6 Page 5 of 6 c Birkbeck College 2016

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. (d) One desirable property of relational database design is that the relation schemas should preserve dependencies. i. What does it mean to say that a design is dependency preserving? ii. Which normal form can guarantee that dependencies are preserved? (1 mark) iii. Assume that the dependency AB C is not preserved. What would the database system have to do to ensure that the constraint specified by the dependency is satisfied at all times? When defining a foreign key constraint in SQL, we can specify the actions the database system should take when a corresponding primary key value is deleted or updated. Explain what actions can be specified as well as what happens in each case when a primary key value is deleted or updated. Give a short explanation of what is meant by each of the following terms (2 marks each): i. first normal form ii. weak entity type iii. lossless join iv. transaction commit v. dynamic SQL (10 marks) COIY028H6 Page 6 of 6 c Birkbeck College 2016