CSCI 5333 DBMS Fall 2017 Final Examination. Last Name: First Name: Student Id:

Similar documents
CSCI DBMS Spring 2017 Final Examination. Last Name: First Name: Student Id:

CSCI 5333 DBMS Spring 2018 Final Examination. Last Name: First Name: Student Id:

CSCI Design of Database Systems Spring 2018 Final Examination. Last Name: First Name: Student Id:

ITEC 3335 Database Development Fall 2018 Final Examination. Last Name: First Name: Student Id:

CSCI 5333 DBMS Fall 2018 Mid-Term Examination. Last Name: First Name: Student Id:

Homework 3: Relational Database Design Theory (100 points)

Homework 6: FDs, NFs and XML (due April 13 th, 2016, 4:00pm, hard-copy in-class please)

Fundamentals of Database Systems

Example Examination. Allocated Time: 100 minutes Maximum Points: 250

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

Functional Dependencies CS 1270

CSE 444 Midterm Test

The University of British Columbia

Grouping Data using GROUP BY in MySQL

LOGICAL DATABASE DESIGN Part #2/2

A7-R3: INTRODUCTION TO DATABASE MANAGEMENT SYSTEMS

Homework 6: FDs, NFs and XML (due April 15 th, 2015, 4:00pm, hard-copy in-class please)

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

COMP7640 Assignment 2

CSIT5300: Advanced Database Systems

Midterm Exam #1 Version B CS 122A Winter 2017

The Relational Data Model

Introduction to HTML5

Desired properties of decompositions

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

Solutions to Final Examination

Database Management

Create a cool image gallery using CSS visibility and positioning property

What is XHTML? XHTML is the language used to create and organize a web page:

Solutions to Final Examination

Functional dependency theory

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

HTML Overview. With an emphasis on XHTML

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Overview - detailed. Goal. Faloutsos & Pavlo CMU SCS /615

UNIT 3 DATABASE DESIGN

Midterm Exam (Version B) CS 122A Spring 2017

Implementing a chat button on TECHNICAL PAPER


BCNF. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong BCNF

Header. Report Section. Footer

EECS-3421a: Test #2 Queries

Examination paper for TDT4145 Data Modelling and Database Systems

Handout 3: Functional Dependencies and Normalization

DATABASE MANAGEMENT SYSTEMS

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

Design Theory for Relational Databases

Applying Spanning Tree Graph Theory for Automatic Database Normalization

SCHEMA REFINEMENT AND NORMAL FORMS

Midterm Exam #1 Version A CS 122A Winter 2017

Total No. of Questions :09] [Total No. of Pages : 02. II/IV B.Tech. DEGREE EXAMINATIONS, NOV/DEC Second Semester CSE/IT DBMS

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

CS157a Fall 2018 Sec3 Home Page/Syllabus

Review: Attribute closure

CMU SCS CMU SCS CMU SCS CMU SCS whole nothing but

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

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

CSCI 1100L: Topics in Computing Spring 2018 Web Page Project 50 points

CS145 Midterm Examination

Lectures 12: Design Theory I. 1. Normal forms & functional dependencies 2/19/2018. Today s Lecture. What you will learn about in this section

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

Web Programming Fall 2011

Unit Notes. ICAWEB411A Produce basic client-side script for dynamic web pages Topic 1 Introduction to JavaScript

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

Babu Banarasi Das National Institute of Technology and Management

Database Management Systems Paper Solution

Examination examples

Schema And Draw The Dependency Diagram

COSC Dr. Ramon Lawrence. Emp Relation

Networks and Web for Health Informatics (HINF 6220)

CSCI 6312 Advanced Internet Programming

CMP-3440 Database Systems

VIEW OTHER QUESTION PAPERS

MaanavaN.Com DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING QUESTION BANK

This lecture. Databases -Normalization I. Repeating Data. Redundancy. This lecture introduces normal forms, decomposition and normalization.

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

Exercise 9: Normal Forms

Web Programming Spring 2010

IJREAS Volume 2, Issue 2 (February 2012) ISSN: COMPARING MANUAL AND AUTOMATIC NORMALIZATION TECHNIQUES FOR RELATIONAL DATABASE ABSTRACT

The University of British Columbia

Ryan Marcotte CS 475 (Advanced Topics in Databases) March 14, 2011

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

Homework 6. Question Points Score Query Optimization 20 Functional Dependencies 20 Decompositions 30 Normal Forms 30 Total: 100

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

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

CS 474, Spring 2016 Midterm Exam #2

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

Computer Science E-75 Building Dynamic Websites

Basics of Page Format

MySQL User Conference and Expo 2010 Optimizing Stored Routines

3.1. Keys: Super Key, Candidate Key, Primary Key, Alternate Key, Foreign Key

A designers guide to creating & editing templates in EzPz

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

Database Management

Read this before starting!

Tutorial on text transformation with pure::variants

Read this before starting!

I Can t Believe It s Not

GIMP WEB 2.0 MENUS. Before we begin this tutorial let s visually compare a standard navigation bar and a web 2.0 navigation bar.

Building Desktop RIAs with PHP, HTML & Javascript in AIR. Ed Finkler, ZendCon08, September 17, 2008 funkatron.com /

Databases -Normalization I. (GF Royle, N Spadaccini ) Databases - Normalization I 1 / 24

Transcription:

CSCI 5333 DBMS Fall 2017 Final Examination Last Name: First Name: Student Id: Number: Time allowed: two hours. Total score: 100 points. This is a closed book examination but you can bring a cheat sheet. Answer all questions. Turn in the question paper, any answer sheets, the cheat sheet and all rough work. Plan your time well. Academic honesty policy will be followed strictly. Cheating will be pursued vigorously and will result in a failing grade of D or below, a permanent academic record and possibly other more serious penalty. Many questions refer to the Sakila database we have used extensively in lectures and homework. Please refer to the relation schemas in the supplementary sheets to answer these questions.

(1) [25 points] Write a PHP program, t2.php, to accept a HTTP GET parameter cid, the customer id. The program displays the categories and the numbers of rented films by the customer in these categories. For example: http://.../t2.php?cid=3 should display the following in the browser. This is because, for example, customer with id 3 has rented four films from the category Action, and so on. You may assume that there will be no error in the HTTP parameters. Please answer your question in the next page. A skeleton is provided for you below. There is no need to copy the skeleton again in your answer next page. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>csci 5333 DBMS Fall 2017 Final Examination, Question 1</title> </head> <body> <?php include('dbconfig_sakila.php'); Your code: write it in the next page. $mysqli->close();?> </body> </html>

(1) Answer question (1) here. Write in the back page if necessary.

(2) [21 points] (a) Create a view f17t2 to provide film information that can be used as below. For example: MariaDB [sakila]> select * -> from f17t2 -> where length >= 100 -> and `number of actors` >12; +---------+------------------+--------+------------------+ film_id title length number of actors +---------+------------------+--------+------------------+ 146 CHITTY LOCK 107 13 188 CRAZY HOME 136 13 249 DRACULA CRYSTAL 176 13 508 LAMBS CINCINATTI 144 15 606 MUMMY CREATURES 160 13 +---------+------------------+--------+------------------+ 5 rows in set (0.03 sec)) (b) Using the view defined in (a), provide the SQL statement to show the top four categories with the most numbers of films with at least 10 actors in the following manners. For example: +-----------+------------+ category filmcounts +-----------+------------+ Comedy 5 Sports 5 Animation 4 Action 4 +-----------+------------+ 4 rows in set (0.02 sec)

(c) Define a stored function s17a to accept two arguments, category_id and min_actors. The function returns the number of films in the category with the id category_id and has at least min_actors number of actors. You must use the view f17t2 of (a) to define your function. For example: MariaDB [sakila]> select f17t2f(5,10); +--------------+ f17t2f(5,10) +--------------+ 5 +--------------+ This can be explained by: MariaDB [sakila]> select fc.film_id, count(distinct fa.actor_id) as count -> from film_category fc, film_actor fa -> where fc.film_id = fa.film_id -> and fc.category_id = 5 -> group by fc.film_id -> having count >= 10; +---------+-------+ film_id count +---------+-------+ 188 13 410 10 529 12 680 11 858 11 +---------+-------+ 5 rows in set (0.00 sec)

(3) [7 points] Use Armstrong s axioms and rules to prove that F = {C->A, AB->D, BD->E} - BC->E (4) [14 points] True (T) or False (F) (a) The number of function dependencies (FD) of a minimal cover of a set of FD F cannot be more than the number of FDs of a canonical cover of F. (b) A trigger in MySQL can be called directly within a stored procedure but not a stored function. (c) In MySQL, the HAVING clause of a SELECT statement cannot come before the GROUP BY clause. (d) The XPath expression //film/title returns all <title> elements that is a child element of a <film> element in the document. (e) A relation in 3NF form but not in BCNF must have more than one candidate keys. (f) In MySQL, it is possible to have a transaction that is atomic but not consistent. (g) The relation R(A,B,C,D,E) must have at least one candidate key.

(5) [8 points] Consider R(A,B,C,D,E) with the set of FDs: {B->AE, AB->E, BD->C, C->AB} R is decomposed into R1(A,B), R2(B,C,D) and R3(B,E). Is the decomposition lossless? Show your reasoning. Write in the back of the page if necessary.

(6) [25 points] Consider R(A,B,C,D,E,F) with F= {A->D, BC->D, AD->E, A-> F, BCD->E, E->F} (a) What are A+, B+, C+, D+, E+ and F+? (b) What are the candidate keys? Show all prime attributes. (c) Give a canonical cover of F. (d) What is the highest normal form (up to BCNF) of R and why? (e) If R is not in BCNF, can you provide a lossless FD preserving decomposition of R into BCNF relations? If yes, show such decomposition. If no, justify your answer.