Part I: Entity Relationship Diagrams and SQL (40/100 Pt.)



Similar documents
Database Sample Examination

VALLIAMMAI ENGNIEERING COLLEGE SRM Nagar, Kattankulathur

DATABASE MANAGEMENT SYSTEMS. Question Bank:

6.830 Lecture PS1 Due Next Time (Tuesday!) Lab 1 Out today start early! Relational Model Continued, and Schema Design and Normalization

Relational Database Design: FD s & BCNF

Design of Relational Database Schemas

Advanced Relational Database Design

Database Design and Normalization

Comp 5311 Database Management Systems. 16. Review 2 (Physical Level)

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

Theory behind Normalization & DB Design. Satisfiability: Does an FD hold? Lecture 12

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

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

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

THE UNIVERSITY OF TRINIDAD & TOBAGO

Scheme G. Sample Test Paper-I

Relational Database Design

Schema Design and Normal Forms Sid Name Level Rating Wage Hours

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

Transaction Management Overview

Lecture 7: Concurrency control. Rasmus Pagh

IT2305 Database Systems I (Compulsory)

Schema Refinement, Functional Dependencies, Normalization

Homework 8. Revision : 2015/04/14 08:13

Concurrency Control. Module 6, Lectures 1 and 2

Schema Refinement and Normalization

Transactions and the Internet

Modern Databases. Database Systems Lecture 18 Natasha Alechina

Database Tuning and Physical Design: Execution of Transactions

Functional Dependencies and Finding a Minimal Cover

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

B2.2-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Lecture Notes on Database Normalization

Chapter 8. Database Design II: Relational Normalization Theory

TYPICAL QUESTIONS & ANSWERS

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

Relational Algebra. Basic Operations Algebra of Bags

Module Contact: Dr. Beatriz de la Iglesia, CMP Copyright of the University of East Anglia Version 1

Concepts of Database Management Seventh Edition. Chapter 9 Database Management Approaches

Lesson 4 Web Service Interface Definition (Part I)

Limitations of E-R Designs. Relational Normalization Theory. Redundancy and Other Problems. Redundancy. Anomalies. Example

Functional Dependencies and Normalization

SQL DDL. DBS Database Systems Designing Relational Databases. Inclusion Constraints. Key Constraints

Contents RELATIONAL DATABASES

DATABASE NORMALIZATION

Chapter 7: Relational Database Design

SAMPLE FINAL EXAMINATION SPRING SESSION 2015

CIS 631 Database Management Systems Sample Final Exam

Why Is This Important? Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) Example (Contd.)

1 File Processing Systems

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Physical Design. Phases of database design. Physical design: Inputs.

IT2304: Database Systems 1 (DBS 1)

Physical Database Design and Tuning

Introduction Decomposition Simple Synthesis Bernstein Synthesis and Beyond. 6. Normalization. Stéphane Bressan. January 28, 2015

2) What is the structure of an organization? Explain how IT support at different organizational levels.

Relational Databases

Exercise 1: Relational Model

1. Physical Database Design in Relational Databases (1)

Goals. Managing Multi-User Databases. Database Administration. DBA Tasks. (Kroenke, Chapter 9) Database Administration. Concurrency Control

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

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

Database Design and Normal Forms

Normalization in Database Design

Relational Database Design Theory

Core Syllabus. Version 2.6 B BUILD KNOWLEDGE AREA: DEVELOPMENT AND IMPLEMENTATION OF INFORMATION SYSTEMS. June 2006

Theory of Relational Database Design and Normalization

Functional Dependencies

Chapter 10. Functional Dependencies and Normalization for Relational Databases

BCA. Database Management System

Computer Science. General Education Students must complete the requirements shown in the General Education Requirements section of this catalog.

Database Management System

Oracle Database 11g: SQL Tuning Workshop Release 2

MS Designing and Optimizing Database Solutions with Microsoft SQL Server 2008

DBMS / Business Intelligence, SQL Server

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

CS143 Notes: Normalization Theory


Week 11: Normal Forms. Logical Database Design. Normal Forms and Normalization. Examples of Redundancy

Course 6232A: Implementing a Microsoft SQL Server 2008 Database

Concurrency Control. Chapter 17. Comp 521 Files and Databases Fall

Principles of Distributed Database Systems

INFORMATION TECHNOLOGY PROGRAM

Introduction to Databases

Transactions and Concurrency Control. Goals. Database Administration. (Manga Guide to DB, Chapter 5, pg , ) Database Administration

Would-be system and database administrators. PREREQUISITES: At least 6 months experience with a Windows operating system.

Computer Information Systems

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

An Object Model for Business Applications

Unified Language for Network Security Policy Implementation

Division of Mathematical Sciences

Advice for software developers and horse racing enthusiasts: Avoid hacks.

Project 2 Database Design and ETL

Quiz! Database Indexes. Index. Quiz! Disc and main memory. Quiz! How costly is this operation (naive solution)?

CSC340S Asst3 Information System Design Detailed Marking Scheme

Security Issues for the Semantic Web

10CS73:Web Programming

Transcription:

Part I: Entity Relationship Diagrams and SQL (40/100 Pt.) Q.1.1) Translate the following E-R Schema to SQL-DDL tables using the CREATE Table Statement and check constraints, if needed: LatinName EnglishName Name Zoo hosts AnimalSpecies Country City manages quantity is a ZooDirector Bird Fish Name Email Adress wingspan watertype Q.1.2) Consider you have to work with a database for the e-olympics, a competition on computer (sport) games. The database you can use has the following schema: Player (playerid, RealName, e-mail, age) Game (GameName, Category, Highscore) Played (playerid,gamename, Score, Time) Medals (GameName, playerid, MedalType) Write the following eight queries in SQL: (a) Find GameNames for all games played by the players with RealName John Lee (b) Find RealName of player(s) who won the gold medal for the game with name Car Racing (c) Find playerid of all players who won at least one silver but not a gold medal (d) Find playerid of all players who won at least one silver and at least one gold medal (e) Find the playerids and realname of the youngest player, who won a gold medal (f) Find the number of different GameNames for each category (g) Find out all RealNames in the database which are not unique (h) Find out all playerids and GameNames for played games in which the player reached the highscore Part II: Schema Normalization (20/100) Given a database with Schema: 1 P a g e

R: ABCDEFGHIJK, and a set of eight functional dependencies: (a) AB->CDEFGHIJ (b) CD->E (c) C->F (d) EF->J (e) J->HI (f) J->G (g) G->HI (h) HI->B Q.2.1) Find a key for the schema given the functional dependences Q2.2) Which of the following three functional dependences is implied? Whenever the functional dependency is implied, prove this using Armstrong s Axioms, Union and/or Decomposition Rule: (a) CD -> HI (b) CHI -> F (c) CDEFGHIJ->AB Q2.3)Compute a lossless join decomposition of this schema in BCNF Q2.4)Is this decomposition also dependency preserving? Q2.5)Describe the difference between a 3NF and a BCNF. 2 P a g e

Part III: Transaction management 20/100 Q.3.1) Describe ACID properties of transactions Q.3.2) What is a locking protocol and why is it used? Describe the Two-Phase Locking (2PL) and the Strict Two-Phase Locking (Strict 2PL) protocol. What can you say about the schedules allowed by Strict 2PL protocol? Q.3.3) Examine the schedule given below. There are four transactions, T1, T2, T3, and T4. T1 R(A) W(A) Commit T2 R(B) W(B) Commit T3 R(A) W(A) R(B) W(B) Commit T4 R(B) R(A) W(B) W(A) Commit a) Draw the precedence graph for this schedule. b) What is the equivalent serialization order for this schedule? If no order is possible, then state none. c) Apply strict two-phase locking protocol to this schedule. d) Draw the waits-for graph based on strict 2PL protocol, just after the deadlock. 3 P a g e

Part IV: Questions (40/100) Q.4.1) Describe the three-tier architecture of a database-backed internet application and typical software tools used in each layer. What is the advantage of this architecture in comparison to thick client architecture? Q.4.2) Describe at least two problems related caused by redundancy in databases. What can be done to reduce redundancy in the database design phase? Q.4.3) XML and HTML are two formats used to exchange data in the internet. Explain briefly the main differences between XML and HTML and what they have in common. Q.4.4) Consider, your task is to tune the speed of a database. You can use three types of indexes and/or file organizations: (I1) Clustered B+Tree Index (I2) Unclustered B+Tree Index (I3) Sorted File (I4) Clustered Hash Index (I5) Unclustered Hash Index Choose the appropriate index to speed up queries in the following situations and give reasons for your choice. It is possible to use more than one index/file-organization: (a) The database of the education administrative center contains for each bachelor student the courses she/he has passed. The number of courses is smaller than 20 and each course is described by a course ID. A frequent query is to ask for all courses a student has passed. (b) A scientific database contains data of endangered fish species observed in the river Danube. The total number of observations records is about 1000000. The observations are stored in a sorted file (sorted by time the observation was made). Frequently, researchers ask which species have been observed in a certain range of the river (e.g. all observations between Budapest and Belgrade). (c) The IP-Address database contains a large number of IP addresses and the address of their owners. A workload analysis has shown that by far the most frequent query is to find out the owner of an IP-address is (his/her address). Another, less frequent, query is to find out the IP address of an owner. Q.4.5) What is the main difference between an operational query language (relational algebra) and a declarative query language (e.g. SQL)? Given a schema S (a,b) T(b,c,d). Which of the following queries are equivalent? Case1: (SQL) SELECT a,b FROM S, T WHERE S.b = T.b 4 P a g e

(RA) S >< T Case2: (SQL) SELECT a,b,b,c,d FROM S, T (RA) S T Case 3: (SQL) SELECT DISTINCT a FROM S,T WHERE T.b = S.b AND S.b= green (RA3) π a (σ b=green (S><T)) Case 4: (SQL) (SELECT DISTINCT b FROM S) INTERSECT (SELECT DISTINCT b FROM T) (RA) π b (S) (π a (S) - π b (S)) Note: >< stands for the natural join operation Q.4.6) List at least five advantages of using a relational database management system as compared to storing the data in a table in one big ASCII file? Are there also disadvantages? Q.4.7) Mark the correct statements about terms used in the context of databases. Multiple answers can be right Success! Q.4.8.1) Data Mining (a) is deductive system that estimates general rules based on given data (b) is a tool used to find patterns in large amounts data (c) can be used to compute the transitive closure for a set of relations Q.4.8.2) A Relational Algebra Tree (a) is a unique representation of a SQL query (b) defines the way a query is processed (c) is a graphical representation of a relational algebra query (d) is often equivalent to many other RA trees Q.4.8.3) A DTD is used (a) to check whether an XML file is valid or not (b) to check whether an XML file is well-formed or not (c) to define application specific constraints on the syntax of an XML file. (d) to specify the graphical representation of an XML file 5 P a g e