CSE 444 Midterm Test



Similar documents
CS 245 Final Exam Winter 2013

Failure Recovery Himanshu Gupta CSE 532-Recovery-1

Transactions and Recovery. Database Systems Lecture 15 Natasha Alechina

Question 1. Relational Data Model [17 marks] Question 2. SQL and Relational Algebra [31 marks]

Transaction Management Overview

Lecture 7: Concurrency control. Rasmus Pagh

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

Concepts of Database Management Seventh Edition. Chapter 7 DBMS Functions

BCA. Database Management System

Recovery System C H A P T E R16. Practice Exercises

DATABASE NORMALIZATION

Introduction to Database Management Systems

Crashes and Recovery. Write-ahead logging

Design of Relational Database Schemas

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Databases -Normalization III. (N Spadaccini 2010 and W Liu 2012) Databases - Normalization III 1 / 31

UVA. Failure and Recovery. Failure and inconsistency. - transaction failures - system failures - media failures. Principle of recovery

Recovery: An Intro to ARIES Based on SKS 17. Instructor: Randal Burns Lecture for April 1, 2002 Computer Science Johns Hopkins University

(Pessimistic) Timestamp Ordering. Rules for read and write Operations. Pessimistic Timestamp Ordering. Write Operations and Timestamps

Introduction to Databases, Fall 2005 IT University of Copenhagen. Lecture 5: Normalization II; Database design case studies. September 26, 2005

Agenda. Transaction Manager Concepts ACID. DO-UNDO-REDO Protocol DB101

Database Sample Examination

Recovery: Write-Ahead Logging

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

Chapter 15: Recovery System

Transactions and the Internet

Recovery Principles in MySQL Cluster 5.1

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Fall 2007 Lecture 5 - DBMS Architecture

AN STUDY ON DATA CONSISTENCY IN SPATIAL DATABASE SYSTEM

Oracle Database Links Part 2 - Distributed Transactions Written and presented by Joel Goodman October 15th 2009

Distributed Architectures. Distributed Databases. Distributed Databases. Distributed Databases

Lesson 12: Recovery System DBMS Architectures

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

Distributed Database Management Systems

Database Concurrency Control and Recovery. Simple database model

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

ORACLE DATABASE: ADMINISTRATION WORKSHOP I

Unit 12 Database Recovery

Data Replication and Snapshot Isolation. Example: Cluster Replication

CSE 562 Database Systems

The University of British Columbia

10CS54: DATABASE MANAGEMENT SYSTEM

Introduction to Databases

City University of Hong Kong. Information on a Course offered by Department of Computer Science with effect from Semester A in 2014 / 2015

Normalization. Normalization. Normalization. Data Redundancy

ORACLE INSTANCE ARCHITECTURE

3. Relational Model and Relational Algebra

Chapter 10. Backup and Recovery

The first time through running an Ad Hoc query or Stored Procedure, SQL Server will go through each of the following steps.

>

ORACLE DATABASE 11G: COMPLETE

Oracle Database Security and Audit

LiTH, Tekniska högskolan vid Linköpings universitet 1(7) IDA, Institutionen för datavetenskap Juha Takkinen

Relational Database Design Theory

CSCI-GA Database Systems Lecture 7: Schema Refinement and Normalization

Review: The ACID properties

Graham Kemp (telephone , room 6475 EDIT) The examiner will visit the exam room at 15:00 and 17:00.

Part 3. MySQL DBA I Exam

Announcements. SQL is hot! Facebook. Goal. Database Design Process. IT420: Database Management and Organization. Normalization (Chapter 3)

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

DATABASE SYSTEMS. Chapter 7 Normalisation

Normalization in Database Design

An Integrated Approach to Recovery and High Availability in an Updatable, Distributed Data Warehouse

Recovery algorithms are techniques to ensure transaction atomicity and durability despite failures. Two main approaches in recovery process

Relational Database Design: FD s & BCNF

Chapter 14: Recovery System

Introduction to Database Systems. Module 1, Lecture 1. Instructor: Raghu Ramakrishnan UW-Madison

Recovery and the ACID properties CMPUT 391: Implementing Durability Recovery Manager Atomicity Durability

Chapter 10: Distributed DBMS Reliability

1.264 Lecture 15. SQL transactions, security, indexes

EZManage V4.0 Release Notes. Document revision 1.08 ( )

Encrypting MySQL data at Google. Jonas Oreland and Jeremy Cole

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

Datenbanksysteme II: Implementation of Database Systems Recovery Undo / Redo

Objectif. Participant. Prérequis. Pédagogie. Oracle Database 11g - Administration Workshop I Release 2. 5 Jours [35 Heures]

In This Lecture. Security and Integrity. Database Security. DBMS Security Support. Privileges in SQL. Permissions and Privilege.

Concurrency Control. Module 6, Lectures 1 and 2

Database Design and Normalization

Chapter 5: FUNCTIONAL DEPENDENCIES AND NORMALIZATION FOR RELATIONAL DATABASES

DataBlitz Main Memory DataBase System

Introduction to Database Systems CS4320. Instructor: Christoph Koch CS

Oracle Database 11g: Administration Workshop I Release 2

iservdb The database closest to you IDEAS Institute

Configuring Apache Derby for Performance and Durability Olav Sandstå

Information Systems. Computer Science Department ETH Zurich Spring 2012

Oracle Database 11g: Administration Workshop I Release 2

normalisation Goals: Suppose we have a db scheme: is it good? define precise notions of the qualities of a relational database scheme

The Oracle Universal Server Buffer Manager

David Dye. Extract, Transform, Load

Expert Oracle. Database Architecture. Techniques and Solutions. 10gr, and 11g Programming. Oracle Database 9/, Second Edition.

Transcription:

CSE 444 Midterm Test Autum 2008 Name: Total time: 50 Question 1 /40 Question 2 /30 Question 3 /30 Total /100 1

1. SQL [40 points] We have a database of documents. Each document consists of several sections, each section contains several words: Doc(docID, doctitle) Section(docID, secnumber, sectitle) WordOcc(docID, secnumber, word) documents sections word occurrences Section(docID) is a foreign key to Doc(docID); WordOcc(docID, secnumber) is a foreign key to Section(docID, secnumber). Eac document has at least one section; each section has at least one word. (a) [10 points] Write a SQL query that computes for each document the total number of distinct words used in that document. The answer should consists of triples: document id, document title, word-count. 2

(b) [5 points] Write a SQL query that finds all documents containing both keywords midterm and solution in the same section. For each such document you should return its document id and title. 3

(c) [20 points] Next, you are given a table QW(word) of keywords. Write a SQL query that finds all documents that contain all the keywords listed in QW. For each such document you should return its document id and title. (d) [5 points] Let Answers 1b be the set of answers returned by the query you wrote for question (1b). Assume QW contains eactly two keywors, midterm and solution, and let Answers 1c be the set of answers return by the query you wrote for question (1c). Circle all the statements below that guaranteed to be true: Answers 1b Answers 1c Answers 1b = Answers 1c Answers 1b Answers 1c 4

2. [30 points] Conceptual Design (a) [10 points] Design an E/R diagram for a database of documents, authors, and readers. The database has the following entities and relationships: Document: has a docid (the key), title. Section: each document consists of several sections; each a section has a title, and a number (1, 2, 3,... ). The section number is unique within each document. Author: each author is the creator of several documents. Each document was created by exactly one author. Reader: each reader reads several documents, and each document is read by several readers. Person: has name, address. Authors and readers are persons. You have to turn in an E/R diagram. 5

(b) [10 points] Database Normalization. Consider a relation R(A, B, C, D, E, F, G) with the following functional dependencies: A B C AD CE B EF C Compute the Boyce-Codd Normal Form (BCNF) decomposition of R. Indicate each step you make in your computation, by showing the relation to which you apply the step and the violation of BCNF that you use during that decomposition step. Indicate clearly your end result: the relations, their attributes, and their keys. (c) [10 points] Consider a relation R(A, B, C, D, E). A set of attributes X is called closed if X+ = X. Given an example of functional dependencies on R such that the only closed sets are A, B, AC, BD, ABE. 6

3. [30 points] Transactions (a) [20 points] After a systems failure, the undo-redo recovery log has the following entries: <START T1> <T1 A 1 2> <START T2> <COMMIT T1> <START T3> <T3 A 2 3> <START T4> <CKPT(T2,T3,T4)> <T2 B 10 20> <COMMIT T2> <START T5> <T5 D 1000 2000> <T4 C 100 200> <COMMIT T5> <START T6> <END CKPT> <T6 D 2000 3000> An entry <T, X, u, v> means that transaction T has updated the value of X from u (the old value) to v (the new value). <CKPT(...)> denotes the beginning of a checkpoint and lists the currently active transactions. <END CKPT> is written to disk once all dirty pages of the active transactions have been flushed to disk. The redo phase preceeds the undo phase during the recovery. i. [5 points] Which are the transactions whose actions the recovery manager needs to redo? ii. [5 points] Which are the transactions whose actions the recovery manager needs to undo? 7

iii. [10 points] Indicate the actions of the recovery manager on all the elements, separately during the Redo and the Undo phase. Redo Undo A= B= C= D= E= (b) [10 points] Indicate for each statement below if it is true or false. You do not have to justify your answer: i. Every schedule that is possible under a timestamp based concurrency control scheduler is also possible under a multiversion concurrency control scheduler. Yes or No? ii. Every schedule that is possible under a multiversion concurrency control scheduler is also possible under a timestamp based concurrency control scheduler. Yes or No? iii. Suppose that every transaction T i has the form ST i, RD i (X), W T i (Y ), CO i, for some elements X and Y. Then a 2-phase locking scheduler that uses shared locks for read operations and exclusive locks for write operations will never result in a deadlock. Yes or No? iv. Suppose that all transactions are either read-only (i.e. they have the form ST i, RD i (X), RD i (Y ),..., CO i ), or they consists of a single write (i.e. they have the form ST i, W T i (X), CO i ). Then a 2-phase locking scheduler that uses shared locks for read operations and exclusive locks for write operations will never result in a deadlock. Yes or No? 8