Jordan University of Science and Technology Faculty of Information Technology CS 728: Advanced Database Systems Midterm Exam 1 st Semester 2010/2011

Similar documents
Information Systems for Engineers. Exercise 8. ETH Zurich, Fall Semester Hand-out Due

Design theory for relational databases

Chapter 11, Relational Database Design Algorithms and Further Dependencies

Homework 2 (by Prashasthi Prabhakar) Due: Wednesday Sep 20, 11:59pm

UVA UVA UVA UVA. Database Design. Relational Database Design. Functional Dependency. Loss of Information

CSC 261/461 Database Systems Lecture 13. Spring 2018

CS322: Database Systems Normalization

Homework 2 (by Prashasthi Prabhakar) Solutions Due: Wednesday Sep 20, 11:59pm

Relational Database Design Theory Part II. Announcements (October 12) Review. CPS 116 Introduction to Database Systems

Chapter 10. Normalization Ext (from E&N and my editing)

Databases 2012 Normalization

Schema Refinement: Other Dependencies and Higher Normal Forms

Relational Database Design

Relational-Database Design

DESIGN THEORY FOR RELATIONAL DATABASES. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

Relational Design: Characteristics of Well-designed DB

Schema Refinement & Normalization Theory

Lossless Joins, Third Normal Form

SCHEMA NORMALIZATION. CS 564- Fall 2015

Introduction. Normalization. Example. Redundancy. What problems are caused by redundancy? What are functional dependencies?

Constraints: Functional Dependencies

Constraints: Functional Dependencies

Normal Forms. Dr Paolo Guagliardo. University of Edinburgh. Fall 2016

Database Design and Normalization

Schema Refinement and Normalization

Exam 1 Solutions Spring 2016

Relational Database Design

Functional Dependency and Algorithmic Decomposition

Relational Design Theory

Information Systems (Informationssysteme)

Schema Refinement & Normalization Theory: Functional Dependencies INFS-614 INFS614, GMU 1

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Problem about anomalies

Normal Forms Lossless Join.

Normalization. October 5, Chapter 19. CS445 Pacific University 1 10/05/17

Schema Refinement and Normal Forms. The Evils of Redundancy. Schema Refinement. Yanlei Diao UMass Amherst April 10, 2007

Schema Refinement and Normal Forms Chapter 19

Functional Dependencies. Getting a good DB design Lisa Ball November 2012

Functional Dependencies

Schema Refinement and Normal Forms. Why schema refinement?

CS 188 Introduction to Fall 2007 Artificial Intelligence Midterm

Schema Refinement and Normal Forms

Schema Refinement and Normal Forms. Chapter 19

Chapter 3 Design Theory for Relational Databases

CS54100: Database Systems

CSE 344 AUGUST 6 TH LOSS AND VIEWS

Databases Lecture 8. Timothy G. Griffin. Computer Laboratory University of Cambridge, UK. Databases, Lent 2009

Schema Refinement and Normal Forms

Chapter 8: Relational Database Design

12/3/2010 REVIEW ALGEBRA. Exam Su 3:30PM - 6:30PM 2010/12/12 Room C9000

Schema Refinement and Normal Forms

Shorts

Normaliza)on and Func)onal Dependencies

Consider a relation R with attributes ABCDEF GH and functional dependencies S:

Functional Dependencies & Normalization. Dr. Bassam Hammo

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Example (Contd.

The Evils of Redundancy. Schema Refinement and Normal Forms. Example: Constraints on Entity Set. Functional Dependencies (FDs) Refining an ER Diagram

Functional Dependencies and Normalization

Relational Database Design

Design Theory for Relational Databases

CS 186, Fall 2002, Lecture 6 R&G Chapter 15

MATH 1553, FALL 2018 SAMPLE MIDTERM 2: 3.5 THROUGH 4.4

Normal Forms (ii) ICS 321 Fall Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa

Chapter 7: Relational Database Design

Chapter 7: Relational Database Design. Chapter 7: Relational Database Design

Database Design: Normal Forms as Quality Criteria. Functional Dependencies Normal Forms Design and Normal forms

Design Theory for Relational Databases. Spring 2011 Instructor: Hassan Khosravi

CSC 261/461 Database Systems Lecture 8. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

FUNCTIONAL DEPENDENCY THEORY II. CS121: Relational Databases Fall 2018 Lecture 20

Functional Dependency Theory II. Winter Lecture 21

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) [R&G] Chapter 19

INF1383 -Bancos de Dados

Functional Dependencies. Applied Databases. Not all designs are equally good! An example of the bad design

The Evils of Redundancy. Schema Refinement and Normal Forms. Functional Dependencies (FDs) Example: Constraints on Entity Set. Example (Contd.

Functional Dependencies

Consider a relation R with attributes ABCDEF GH and functional dependencies S:

CMPT 354: Database System I. Lecture 9. Design Theory

Schema Refinement and Normal Forms. The Evils of Redundancy. Functional Dependencies (FDs) CIS 330, Spring 2004 Lecture 11 March 2, 2004

CSE 132B Database Systems Applications

Introduction to Data Management CSE 344

Schema Refinement. Feb 4, 2010

Design Theory. Design Theory I. 1. Normal forms & functional dependencies. Today s Lecture. 1. Normal forms & functional dependencies

CS 4604: Introduc0on to Database Management Systems. B. Aditya Prakash Lecture #15: BCNF, 3NF and Normaliza:on

Database Design and Normalization

DECOMPOSITION & SCHEMA NORMALIZATION

Design Theory: Functional Dependencies and Normal Forms, Part I Instructor: Shel Finkelstein

Problem Point Value Points

Review: Keys. What is a Functional Dependency? Why use Functional Dependencies? Functional Dependency Properties

But RECAP. Why is losslessness important? An Instance of Relation NEWS. Suppose we decompose NEWS into: R1(S#, Sname) R2(City, Status)

Exam 1. March 12th, CS525 - Midterm Exam Solutions

CSC 261/461 Database Systems Lecture 10 (part 2) Spring 2018

10/12/10. Outline. Schema Refinements = Normal Forms. First Normal Form (1NF) Data Anomalies. Relational Schema Design

Desirable properties of decompositions 1. Decomposition of relational schemes. Desirable properties of decompositions 3

EECS-3421a: Test #2 Electrical Engineering & Computer Science York University

Lectures 6. Lecture 6: Design Theory

Functional Dependencies and Normalization. Instructor: Mohamed Eltabakh

Normal Forms 1. ICS 321 Fall Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa

CSC 261/461 Database Systems Lecture 12. Spring 2018

Database Design and Implementation

Transcription:

Jordan University of Science and Technology Faculty of Information Technology CS 728: Advanced Database Systems Midterm Exam 1 st Semester 2010/2011 Student name: Student Number: 1. If only 10% of students have URL addresses, then Student(SSN, Name,., URL) is a poor design, because 90% of the last column values will be nulls. But the following is a better design. Assume that each student has up to one webpage address. a. Student(SSN, Name, ), WebPage(SSN, URL) b. Student(SSN, Name, ), WebPage(SSN, URL) c. Student(SSN, Name, ), WebPage(SSN, URL) c. Student(SSN, Name, ), WebPage(SSN, URL) e. Student(SSN, URL, Name, ) 2. Fill in the blank: Design relation schemas so that they can be with conditions on attributes that are either primary keys or foreign keys in a way which guarantees that no tuples are generated. a. created, normal, unique b. created, normal, spurious c. joined, normal, spurious d. joined, equality, unique e. joined, equality, spurious 3. A functional dependency (Y X), between X and Y specifies a constraint on the possible tuples that can form a relation instance r of R. The constraint states that for any two tuples t1 and t2 in r such that a. t1[x] = t2[y], then t1[y] = t2[x] b. t1[y] = t2[y], then t1[x] = t2[x] c. t1[x] = t2[y], then t1[x] = t2[y] d. t1[x] = t2[x], then t1[y] = t2[y] e. t1[y] = t2[x], then t1[y] = t2[x] 4. Given the following relation schema ED(S, E, B, A, D, M, G) with the following dependencies F = { S EBAD, D MG } What functional dependency can be inferred from F using decomposition rule? a. S S b. S E c. S G d. D DMG e. D S 5. If all Y-values are different and all X-values are the same in all possible r(r), does Y X in R? a. Yes b. No

6. Given the relational schema: R = (PILOT, FLIGHT, DATE, DEPARTS, TERMONAL) that satisfies the following functional dependencies: a. YES FLIGHT DEPARTS, TERMINAL FLIGHT, FLIGHT, DATE PILOT and the following instance: PILOT FLIGHTDATE DEPARTSTERMINAL Cushing 83 9 Aug 10:15am A Cushing 116 10 Aug 1:25pm B Clark 281 8 Aug 5:50pm A Clark 301 12 Aug 6:35pm C Clark 83 11 Aug 10:15am A Chin 83 13 Aug 10:15am A Chin 116 12 Aug 1:25pm B Is R consistent with the dependencies specified above? Is it a valid instant? b. NO, since FLIGHT DEPARTS is violated by r(r). c. NO, since TERMINAL FLIGHT is violated by r(r). d. NO, since FLIGHT, DATE PILOT is violated by r(r). e. NO, since FLIGHT, DATE PILOT and TERMINAL FLIGHT are violated by r(r). 7. Given the following relation state. Which of the following FDs may be a valid one? A B C D a1 b1 c1 d1 a1 b2 c1 d2 a2 b2 c2 d2 a2 b3 c2 d3 a3 b3 c2 d4 a. A B b. A C c. C A d. A D e. B D 8. The key for the universal relation R = {A, B, X, D, E, Y, G, H, Z} is Given the following set of functional dependencies: F = { BD EY, AD GH, A Z, AB X} a. AB b. ABD c. ABX d. BD e. BDZ

Consider the following relation CAR-SALE(car, salesman, date-sold, commission, discount) and FDs = {date-sold discount, salesman commission} 9. Is CAR-SALE relation in 1NF? a. Yes b. No 10. Is CAR-SALE relation in 2NF? a. Yes b. No 11. The 3NF of CAR-SALE relation is a. CAR(car, salesman, date-sold, discount), COMM(salesman, commission) b. CAR(car, salesman, date-sold, commission), DATE(date-sold, discount) c. CAR(car, salesman, date-sold), COMM(salesman, commission), DATE(date-sold, discount) d. CAR-SALE(car, salesman, date-sold, commission, discount) e. None of the above 12. Which of the following statement about normal forms is false? a. If a relation R is in BCNF, it is also in 3NF. b. If a relation R is not in BCNF, we can always obtain its BCNF by applying lossless-join decomposition on R. c. If a relation R is not in BCNF, we can always obtain its BCNF by applying decomposition which is dependency preserving on R. d. If a relation R is not in 3NF, we can always obtain its 3NF by applying lossless-join decomposition on R. e. If a relation R is not in 3NF, we can always obtain its 3NF by applying decomposition which is dependency preserving on R. 13. Consider the relation for an appliance dealer R(M, Y, R, P, C) (2) Assume that M P, MY R, P C Consider the decomposition R1 (M, Y, P) R2 (M, R, C). Does this decomposition have the lossless join property? Circle: YES NO Justify: R1 R2 = M R1 R2 = (Y, P) R2 R1 = (R, C) Because M doesn t functionally define either (R1 R2) or (R2 R1), this Decomposition is not lossless join.

14. Consider the following relation with its functional dependencies: (4) R (C, T, O, S, D) F = { C S T O CT D} Also, consider a decomposed version of the above relation: R1 (C, T, S) R2 (C, S) R3 (T, O, D) Using the algorithm for lossless join decomposition testing (Algorithm 15.3), determine if this decomposition is indeed lossless. Describe how you came to your conclusion. (2pts tableau setup and change & 2pts- explanation & correct conclusion) C T O S D R1 a1 a2 b13 a4 b15 R2 a1 b22 b23 a4 b25 R3 b31 a2 a3 b34 a5 Considers FDs { C S, T O, C, T D} C T O S D R1 a1 a2 a3 a4 b15 R2 a1 b22 b23 a4 b25 R3 b31 a2 a3 b34 a5 Since there is no row of entirely a symbols, this decomposition is not lossless. EXPLANATION: In the first row, we can set b13 to a3 because a2 a3 and a2 and a3 are present in row3. In row1 b15 cannot be set to a5 because a1, a2 a5 needs to have another row that has all of a1, a2 and a5 present in the same row. Since no such row is presented, we cannot change b15 to a5 and conclude that no row can be set to all a s.

15. Consider the relation R(T, S, D) with MVD T ->> S and T ->> D. R currently has the following tuples: (2) T S D P G U P G R P S U P S R N M U N M T N V U N V T a. The above relation is not in 4NF. Normalize it into 4NF. R1(T, S) and R2(T, D) b. What is the table look like after decomposition? T S T D P G P U P S P R N M N U N V N T

16. If speed of disk rotation (p) is 3000 rpm, what is the average rotational delay (rd)? 50 rps 1 rev. = 20 msec. (1 second = 1000 msec) rd = 10 ms a. 8.33 b. 20 c. 16.66 d. 10 e. 50 17. If track size = 25000 bytes, disk rotation (p) = 3600 rpm, and block size B = 3000 bytes. What is transfer rate (tr) in bytes/msec? tr = (25000)/(60*1000/3600) = 1500 bytes/msec a. 3000 b. 1800 c. 2400 d. 1500 e. 3600 18. If transfer rate (tr) = 1000 bytes/msec and block size (B) = 3000 bytes. What is block transfer time (btt) in bytes/msec? btt = B / tr = 3000/1000 = 3 msec a. 3 b. 0.333 c. 2 d. 1 e. 1.5 19. Consider a table emp with r = 160,000 records of R = 98 bytes each, created with the statement: create table emp (eid integer primary key, ) pctfree 20; where pctfree n clause refers to the amount of free space (%n) that must be left on each data page in placing records on the page. How many data pages (b) needed to store the records of the table emp. Assuming only 2-byte inter-record gap, page size is B = 4000 bytes, and an unspanned organization. Ignore the file header size. Hint: first, compute the file blocking factor bfr. (2) bfr = 4000*0.80/100 = 32= floor(b*0.80/(r+g)) b = Celing(160,000/32) = 5000 blocks = r/bfr

20. Consider a disk with the following characteristics: average rotational latency = 6ms, average seek time = 6ms, block transfer time = 0.5ms. How much time (in ms) would it take to read 200 blocks that are randomly stored on disk? = 200*(6+6+0.5)= 2500 ms 21. Consider a disk with block size B = 1024 bytes. Suppose we want to construct a secondary index on field xyz of size 25 bytes. What is the index blocking factor if an index pointer is 7 bytes long? Hint: compute first the size of each index entry R i. R i = V + P = 25 + 7 = 32 bfr i = B/Ri = 1024/32 = 32 22. Consider the following B + -tree. Which nodes would be accessed to find all items in the range 4 to 14, inclusive? a. 1, 2, 5, 6, and 7 b. 1, 2, 4, 5, 6, and 7 c. 1, 2, 5, 3, 6, and 7 d. 1, 2, 3, 4, 5, and 6 e. 1, 2, 4, 5, 3, 6, and 7

23. Give the B + -tree below, draw the final tree that results after inserting 10. (2) 7 3 5 6 7 8 9 14