Database Management

Similar documents
Database Management

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

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

DATABASE MANAGEMENT SYSTEMS

Course Modules for MCSA: SQL Server 2016 Database Development Training & Certification Course:

Database Management Systems Paper Solution

CMSC 461 Final Exam Study Guide

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

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

BIRKBECK (University of London)

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

8) A top-to-bottom relationship among the items in a database is established by a

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

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

Relational Model History. COSC 416 NoSQL Databases. Relational Model (Review) Relation Example. Relational Model Definitions. Relational Integrity

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

Querying Data with Transact SQL

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

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

CPSC 421 Database Management Systems. Lecture 19: Physical Database Design Concurrency Control and Recovery

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

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

(All chapters begin with an Introduction end with a Summary, Exercises, and Reference and Bibliography) Preliminaries An Overview of Database

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

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

Midterm Review. Winter Lecture 13

High Level Database Models

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

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

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

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

UNIVERSITY OF CALIFORNIA College of Engineering Department of EECS, Computer Science Division


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

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

High-Level Database Models (ii)

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

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

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

MaanavaN.Com DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING QUESTION BANK

CSE 562 Database Systems

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

Functional Dependencies CS 1270

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

Unit 3 : Relational Database Design

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

The University of British Columbia

Relational Model: History

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

Running Example Tables name location

SQL Interview Questions

CSE 544 Principles of Database Management Systems

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

CS 564 Midterm Review

CS 461: Database Systems. Final Review. Julia Stoyanovich

The Relational Data Model

Informal Design Guidelines for Relational Databases

Relational Design: Characteristics of Well-designed DB

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

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

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

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

Midterm 2: CS186, Spring 2015

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

Relational Database design. Slides By: Shree Jaswal

Relational Databases

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

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

RELATIONAL ALGEBRA II. CS121: Relational Databases Fall 2017 Lecture 3

Relational Design Theory. Relational Design Theory. Example. Example. A badly designed schema can result in several anomalies.

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

Chapter 8: Relational Database Design

ROEVER ENGINEERING COLLEGE

Physical Database Design and Tuning. Review - Normal Forms. Review: Normal Forms. Introduction. Understanding the Workload. Creating an ISUD Chart

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

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

Chapter 6: Relational Database Design

CSE344 Final Exam Winter 2017

Relational Database Design (II)

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

Final Review. Zaki Malik November 20, 2008

E-R diagrams and database schemas. Functional dependencies. Definition (tuple, attribute, value). A tuple has the form

Querying Data with Transact-SQL

Lecture 11 - Chapter 8 Relational Database Design Part 1

Chapter 4. The Relational Model

Unit 2. Unit 3. Unit 4

UNIT 3 DATABASE DESIGN

; Spring 2008 Prof. Sang-goo Lee (14:30pm: Mon & Wed: Room ) ADVANCED DATABASES

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

VU Mobile Powered by S NO Group All Rights Reserved S NO Group 2013

The data structures of the relational model Attributes and domains Relation schemas and database schemas

Oracle 9i Application Development and Tuning

The Entity-Relationship Model. Overview of Database Design

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

Querying Data with Transact SQL Microsoft Official Curriculum (MOC 20761)

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out end of week start early!

Chapter 8: Working With Databases & Tables


CSIT5300: Advanced Database Systems

GUJARAT TECHNOLOGICAL UNIVERSITY

Transcription:

Database Management - 2011 Model Answers 1. a. A data model should comprise a structural part, an integrity part and a manipulative part. The relational model provides standard definitions for all three parts, whereas the entity-relationship model has no standardised manipulative part. [5] A weak entity type in the entity-relationship model is an entity type that cannot exist independently of its associated owner or identifying entity type. When translating from the entity-relationship model to the relational model, a weak entity type is represented by the primary key of its owner type, its discriminator and its other attributes. [6] b. The OUTER JOIN operator in SQL allows rows from one table that would be excluded in a normal join because they don t match rows in the other table to be included in the join, padded with null values. The LEFT OUTER JOIN includes rows from the left table that do not join, the RIGHT OUTER JOIN includes those from the right table, and the FULL OUTER JOIN includes rows from both that do not join. [6] The join of R and S will have at most m tuples in it. [1] Because B is a foreign key referencing A, every non-null B-value must appear as an A-value in R. However, if a B-value in S is null, it will not match any tuple in R and R RIGHT OUTER JOIN S will produce a different result to R JOIN S. (The original question was incorrect in stating that they would return the same result I had overlooked null values.) [4] 1

Page 2 of 5 c. A set of transactions is serialisable if they behave as if they had been run serially, that is, the effect of running them concurrently is the same as that when running them serially. [2] An example of non-serialisable execution is two transactions running concurrently and booking the same seat on a flight. The sequence in time might be as follows: 1. Transaction 1 finds seat 22A empty. 2. Transaction 2 finds seat 22A empty. 3. Transaction 1 books seat 22A. 4. Transaction 2 books seat 22A. [4] One mechanism is locking. [1] The acronym ACID stands for: atomicity, consistency, isolation and durability. [4] [Total 33 marks] c Birkbeck College 2010 COIY028U CONTINUED

Page 3 of 5 2. a. i. A key for Stocks is IS. This can be found by applying the closure algorithm. We can add D to IS + using S D, we can add B using I B, we can add Q using IS Q, and can add O using B O. [3] ii. InvestsWith(I,B,O) would not be good database design because, for example, the office of a broker would be repeated for every investor who invests with the broker. Also we could not store the office of a broker who has no investors because the primary key cannot be null. [4] iii. A 3NF decomposition of Stocks is (S, D), (I, B), (I, S, Q) and (B, O). [4] b. A decomposition being lossless ensures that we can recover the original information after decomposition. A decomposition being dependency-preserving ensures that just be checking that the projected FDs in the decomposed relations are satisfied ensures that all the original FDs are satisfied. [3] As an example of a decomposition that is not lossless consider a relation schema (child, mother, father) and a relation over this schema with tuples (a, b, c) and (d, b, e). The FDs mother child and mother father do not hold, and the decomposition into (child, mother) and (mother, f ather) is lossy. When we join the projected tuples we get additional tuples (a, b, e) and (d, b, c). [4] As an example of a decomposition that is not dependency-preserving consider the relation schemas (theatre, city) and (theatre, f ilm) along with the FDs theatre city and film city theatre. There could be relations for the two schemas that satisfy the first FD but when joined do not satisfy the second. [4] c. i. Referential integrity is the requirement that values for an attribute in one relation also appear as values in another relation. [2] ii. Data independence is the ability for the representation of data to be changed at one level without the change affecting how the data is retrieved at higher levels. [2] c Birkbeck College 2010 COIY028U TURN OVER

Page 4 of 5 iii. Entity integrity is the requirement that primary key values in a relation should not contain null values. [2] iv. Participation constraint is a constraint in the ER model that specifies whether or not every entity in an entity set must participate in a given relationship set. Participation can be optional (partial) or mandatory (total). [3] v. First normal form is the requirement that all values in relations be atomic as far as queries are concerned. [2] [Total 33 marks] c Birkbeck College 2010 COIY028U CONTINUED

Page 5 of 5 3. a. Three-valued logic is a form of logic involving the truth values true, false and unknown. It is necessary because of conditions (predicates) involving null values which represent unknown values. [2] spouse= Joe age < 50 not(spouse= Joe ) or age < 50 true true true true false false true unknown unknown false true true false false true false unknown true unknown true true unknown false unknown unknown unknown unknown [9] b. Views are useful because they provide an additional layer of abstraction above the logical model of a database and thereby isolate users from changes at lower levels. They can also be used to restrict access to parts of a database to only appropriate groups of users. [3] An SQL view is updatable if the query defining the view satisfies the following: The from clause has only one database relation. The select clause contains only attribute names of the relation (no expressions, aggregates, or distinct). Any attribute not listed in the select clause can be set to null. There is no group by or having clause. [4] If a view is defined as the join of two relations where the join attributes do not appear in the view, then an insertion of a tuple in the view might result in tuples being inserted into the base relations such that the inserted view tuple no longer appears in the view. [4] c Birkbeck College 2010 COIY028U TURN OVER

Page 6 of 5 c. XML represents data by a self-describing tree structure, that is, the schema is stored along with the nodes of the tree. Nodes can be nested to an arbitrary level and nodes of the same type can have different structures in different parts of a tree. Thus XML is more flexible than the relational model, which can be seen as allowing only rigid structures of fixed depth. [3] Three approaches to managing XML data in a database system are native XML database systems, XML-enabled database systems, and hybrid systems. In the first, XML is stored in the most appropriate structures and hence one would expect best performance. In the second, XML can be mapped to the model of the database (e.g. relational), providing flexibility but probably at the expense of performance. In the third approach, the desire is to attain the performance of native systems with the flexibility of managing multiple models. [5] The XPath expression //item[date= 1 May 2011 ]/title. [3] [Total 33 marks] c Birkbeck College 2010 COIY028U CONTINUED

Page 7 of 5 4. a. i. A relation R is in BCNF if and only if whenever a non-trivial FD X Y holds in R, X is a superkey for R. [2] ii. studio president and president address violate BCNF because title year is the only key for Films. [3] iii. A BCNF decomposition of Films is given by, say, first decomposing Films with respect to president address, giving {president, address} and {title, year, studio, president}. We can then decompose using studio president to give {title, year, studio}, {studio, president} and {president, address}. [6] b. Object-relational systems provide a number of extra features over relational systems. These include user-defined types, type inheritance, table inheritance, array and multiset types, object identity, reference types, and methods. [8] Entity-relationship features provided by object-relational systems include composite attributes and specialisation/generalisation. [3] c Birkbeck College 2010 COIY028U TURN OVER

Page 8 of 5 c. Assume that Team has n tuples and Player has m tuples. Assume that l Player tuples have a city value of London. (i) Use nested loops to iterate over each Team tuple in the outer loop and each Player tuple in the inner loop. The cost of this would be n m. (ii) First iterate over Player tuples to find those for which the city is London. Then for each of these, iterate over Team tuples to find matches. The cost would be m + l n. Assuming l is much smaller than m, this would be a big saving over (i). (iii) Assuming Player is indexed on city and Team is indexed on player, perform an index lookup on Player for tuples for which city is London. For each tuple, perform an index lookup on Team for matching player names. The cost depends on the costs of the index lookups, but should be lower than (ii). (iv) Sort-merge... (v) Hash join... [Total 33 marks] c Birkbeck College 2013 COIY028H6 END OF PAPER