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

Similar documents
Final Examination Computer Science 420 Dr. St. John Lehman College City University of New York 21 May 2002

Exam II Computer Programming 420 Dr. St. John Lehman College City University of New York 20 November 2001

Answer Key for Exam II Computer Science 420 Dr. St. John Lehman College City University of New York 18 April 2002

Lecture 11 - Chapter 8 Relational Database Design Part 1

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

FUNCTIONAL DEPENDENCIES CHAPTER , 15.5 (6/E) CHAPTER , 10.5 (5/E)

Introduction to Database Design, fall 2011 IT University of Copenhagen. Normalization. Rasmus Pagh

CSE-3421 Test #1 Design

Relational Database Design (II)

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

Introduction to Databases, Fall 2003 IT University of Copenhagen. Lecture 4: Normalization. September 16, Lecturer: Rasmus Pagh

BIRKBECK (University of London)

Alternate Exam for CSE 480 (2017) KEY

Normalization. Anomalies Functional Dependencies Closures Key Computation Projecting Relations BCNF Reconstructing Information Other Normal Forms

Database Management

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

Databases Tutorial. March,15,2012 Jing Chen Mcmaster University

Final Review. Zaki Malik November 20, 2008

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

SAMPLE EXAM Exam 2 Computer Programming 230 Dr. St. John Lehman College City University of New York Thursday, 5 November 2009

COSC Dr. Ramon Lawrence. Emp Relation

15CS53: DATABASE MANAGEMENT SYSTEM

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

NORMAL FORMS. CS121: Relational Databases Fall 2017 Lecture 18

Alternate Exam for CSE 480 (2017)

The University of British Columbia

Chapter 8: Relational Database Design

Informal Design Guidelines for Relational Databases

Case Study: Lufthansa Cargo Database

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

Exam (Version B) for CSE 480 (2018)

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

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

Database Tables and Normalization

Unit 3 : Relational Database Design

CS145 Midterm Examination

Database Design. 6-2 Normalization and First Normal Form. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Database Normalization. (Olav Dæhli 2018)

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 6 Normalization of Database Tables

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

How To Convert An Er Diagram Into Relational Schema Example

A Deeper Look at Data Modeling. Shan-Hung Wu & DataLab CS, NTHU

Normal Forms. Winter Lecture 19

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

UNIT 3 DATABASE DESIGN

Chapter 6: Relational Database Design

Functional dependency theory

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

CSIT5300: Advanced Database Systems

Sample Exam for CSE 480 (2017) KEY

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

CSCI 585 Database Systems Prof. Dennis McLeod. Sample Midterm Exam

FINAL EXAM REVIEW. CS121: Introduction to Relational Database Systems Fall 2018 Lecture 27

AC61/AT61 DATABASE MANAGEMENT SYSTEMS DEC 2013

DATABASE MANAGEMENT SYSTEMS

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

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

CSE 444 Midterm Test

ENTITY-RELATIONSHIP MODEL

CSE 562 Database Systems

From ER Diagrams to the Relational Model. Rose-Hulman Institute of Technology Curt Clifton

Handout 3: Functional Dependencies and Normalization

Normalisation Chapter2 Contents

Sample Exam for CSE 480 (2016)

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

Relational Design 1 / 34

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 9 Normalizing Database Designs

Databases The theory of relational database design Lectures for m

ER to Relational Mapping

Refresher: ER-modeling, logical relational model, dependencies. Toon Calders

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

Lecture 4. Database design IV. INDs and 4NF Design wrapup

Relational Model and Relational Algebra A Short Review Class Notes - CS582-01

CS2255 DATABASE MANAGEMENT SYSTEMS QUESTION BANK UNIT I

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

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

Midterm Exam (Version B) CS 122A Spring 2017

The University of British Columbia

Niklas Fors The Relational Data Model 1 / 17

IMPORTANT: Circle the last two letters of your class account:

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

The Entity-Relationship Model (ER Model) - Part 2

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

Examination paper for TDT4145 Data Modelling and Database Systems

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

Exam II CIS 228: The Internet Prof. St. John Lehman College City University of New York 5 November 2009

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

customer = (customer_id, _ customer_name, customer_street,

Database Foundations. 3-9 Validating Data Using Normalization. Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

The Relational Model

Relational Design: Characteristics of Well-designed DB

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010

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

CS430 Final March 14, 2005

Schema And Draw The Dependency Diagram

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

CT13 DATABASE MANAGEMENT SYSTEMS DEC 2015

SAMPLE EXAM Final Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 16 December 2010

GUJARAT TECHNOLOGICAL UNIVERSITY

Transcription:

Exam I Computer Science 420 Dr. St. John Lehman College City University of New York 12 March 2002 NAME (Printed) NAME (Signed) E-mail Exam Rules Show all your work. Your grade will be based on the work shown. The exam is closed book and closed notes. When taking the exam, you may have with you pens or pencils, and an 8 1/2 x 11 piece of paper filled with notes, programs, etc. You may not use a computer or calculator. All books and bags must be left at the front of the classroom during this exam. Do not open this exams until instructed to do so. Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Question 7 Question 8 Question 9 Question 10 TOTAL

1. True or False: (a) All database management systems are relational. (b) Only relationships can have attributes in E/R diagrams. (c) Every bag is a set. (d) Every key is a superkey. (e) Every superkey is a key. (f) Attributes that are keys cannot appear in functional dependencies. (g) If for a relation R, X all attributes, then X is a key for the relation R. (h) Every functional dependency is a multivalued dependency. (i) You cannot embed a query inside another query. (j) Views can queried as if they were tables. 2. Answer the following in two sentences or less: (a) What is a constraint? (b) What is the difference between a bag and a set? 3. Consider the relation R(A, B, C, D) with the function dependencies: (a) What are the keys of R? B C and B D (b) How many superkeys are there of R? Justify your answer.

4. (a) Draw an E/R diagram for the following situations. Indicate any keys, weak entity sets, or subclasses: Entity sets Teams, Players and Fans. A team has its name, its players, its team captain (one its players), and the colors of its uniform. For each player, you should keep track of his/her name. And, for each fan, we have his/her name, favorite teams, favorite players, and favorite color. (b) Translate your E/R diagram into a relation schema. Indicate keys for each relation as well as any functional dependencies that hold about each relation.

5. For each of the following types of situations, give an example and draws its E/R diagram: (a) a weak entity set: (b) a relationship with roles: 6. (a) Consider a relation R(A, B) with two tuples: R = {(1, 2), (2, 3)}. i. Does A B hold for this instance of R? ii. Does A B hold for this instance of R? (b) Now consider a relation R(A, B, C) with two tuples: R = {(5, 2, 1), (7, 2, 6)}. i. Does A B hold for this instance of R? ii. Does B C hold for this instance of R? iii. Does AB C hold for this instance of R? 7. Given the relation schema: Movie(title, year, length, incolor, studioname) (a) Write a query that lists all movies made after 1990: (b) Write a query that lists all movies with Star in the title:

8. Given the relation schema R(A, B, C, D) with the functional dependencies A B B C C A A D (a) Indicate all the Boyce Codd Normal Form violations. Do not forget to consider dependencies that are not in the given set, but follow from them. However, it is not necessary to give violations that have more than one attribute on the right side. (b) Indicate all the Third Normal Form violations. Do not forget to consider dependencies that are not in the given set, but follow from them. However, it is not necessary to give violations that have more than one attribute on the right side. (c) Decompose the relations, as necessary, into a collection of relations that are in Third Normal Form.

9. Given the relation schema: Employee(ID, Name, Address, Phone, YearHired) where ID is the employee s company identification number and the key for relation. Name, Address, and Phone are the employee s name, address, and phone number. The year the employee was hired is stored in YearHired. (a) Write the SQL statement that will create the table above. Remember to include the types of the data as well as any keys. Include the constraints that the Name must not be NULL and the default value for Address is 1600 Pennsylvania Avenue. (b) Write the SQL statements that will add the following employees to the table: Abraham Lincoln, employee number 16, no known phone, hired: 1861 George W. Bush, employee number 42, 202-456-1414, hired: 2001 Bill Clinton, employee number 43, address: 55 W 125 Street, NY, NY, hired: 1993 [You do not need to worry about information not provided above. You only need to insert into the table the data provided.] (c) What is the result of the following query on your database: SELECT name, address, phone FROM Employee;

10. (a) Define Boyce-Codd Normal Form (BCNF): (b) Define Third Normal Form (3NF): (c) Define Fourth Normal Form (4NF): (d) Is every relation in Third Normal Form also in Fourth Normal Form? If yes, explain why. If no, give an example that shows why this is not true. (e) Is every relation in Fourth Normal Form also in Boyce Codd Normal Form? If yes, explain why. If no, give an example that shows why this is not true.