Carnegie Mellon University Department of Computer Science /615 - Database Applications C. Faloutsos & A. Pavlo, Spring 2014.

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

CMU - SCS / Database Applications Spring 2013, C. Faloutsos Homework 1: E.R. + Formal Q.L. Deadline: 1:30pm on Tuesday, 2/5/2013

Carnegie Mellon University Department of Computer Science /615 - Database Applications C. Faloutsos & A. Pavlo, Fall 2016

INFO 1103 Homework Project 2

Homework 2: Translating between the ER and relational models Due at 5pm on Wednesday, April 25

15-415/615 Homework 8, Page 2 of 11 Thu, 4/24/2014, 1:30pm

Review The Big Picture

Homework 2 (by Ao Zeng) Solutions Due: Friday Sept 28, 11:59pm

Homework 7. For your information: Graded out of 100 points; 2 questions total 5-10 hours for phase 1; hours for phase 2.

Carnegie Mellon University Department of Computer Science /615 - Database Applications C. Faloutsos & A. Pavlo, Fall 2015

Homework 2: E/R Models and More SQL (due February 17 th, 2016, 4:00pm, in class hard-copy please)

Project Assignment 2 (due April 6 th, 2016, 4:00pm, in class hard-copy please)

Project Assignment 2 (due April 6 th, 2015, 4:00pm, in class hard-copy please)

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

1 (10) 2 (8) 3 (12) 4 (14) 5 (6) Total (50)

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

Homework 1: RA, SQL and B+-Trees (due September 24 th, 2014, 2:30pm, in class hard-copy please)

Homework 1: Relational Algebra and SQL (due February 10 th, 2016, 4:00pm, in class hard-copy please)

Database Systems: An Application-Oriented Approach (Complete Version) Practice Problems and Solutions for Students

Homework 1: RA, SQL and B+-Trees (due Feb 7, 2017, 9:30am, in class hard-copy please)

CSE 562 Midterm Solutions

LAB 3 Notes. Codd proposed the relational model in 70 Main advantage of Relational Model : Simple representation (relationstables(row,

The Relational Model. Roadmap. Relational Database: Definitions. Why Study the Relational Model? Relational database: a set of relations

Relational model continued. Understanding how to use the relational model. Summary of board example: with Copies as weak entity

Informatics 1: Data & Analysis

CIS 330: Applied Database Systems. ER to Relational Relational Algebra

Relational Model and Relational Algebra

Informatics 1: Data & Analysis

SQL DDL. CS3 Database Systems Weeks 4-5 SQL DDL Database design. Key Constraints. Inclusion Constraints

Faloutsos - Pavlo CMU SCS /615

Overview. Carnegie Mellon Univ. School of Computer Science /615 - DB Applications. Concepts - reminder. History

Carnegie Mellon University in Qatar Spring Problem Set 2. Out: January 23, 2018

CS2300: File Structures and Introduction to Database Systems

CSE 344 Midterm. Wednesday, February 19, 2014, 14:30-15:20. Question Points Score Total: 100

The Relational Model. Week 2

15-110: Principles of Computing, Spring 2018

CS 186 Midterm, Spring 2003 Page 1

Relational Database Design Part I. Announcements (September 5) Relational model: review. CPS 116 Introduction to Database Systems

CS 4604: Introduction to Database Management Systems. B. Aditya Prakash Lecture #5: Entity/Relational Models---Part 1

Database Management Systems

Relational Algebra Homework 0 Due Tonight, 5pm! R & G, Chapter 4 Room Swap for Tuesday Discussion Section Homework 1 will be posted Tomorrow

The Relational Model. Outline. Why Study the Relational Model? Faloutsos SCS object-relational model

Why Study the Relational Model? The Relational Model. Relational Database: Definitions. The SQL Query Language. Relational Query Languages

PLEASE HAND IN UNIVERSITY OF TORONTO Faculty of Arts and Science

3 February 2011 CSE-3421M Test #1 p. 1 of 14. CSE-3421M Test #1. Design

Midterm Exam (Version B) CS 122A Spring 2017

14 October 2015 EECS-3421A Test #1 p. 1 of 14. EECS-3421A Test #1. Design

CMSC Introduction to Database Systems

Informatics 1: Data & Analysis

Introduction to Data Management. Lecture #4 (E-R Relational Translation)

Part I: Structured Data

Modern Database Systems CS-E4610

Introduction to Databases

Relational Database Design Part I. Announcement. Relational model: review. CPS 116 Introduction to Database Systems

Informatics 1: Data & Analysis

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

Midterm Review. Winter Lecture 13

Relational Databases BORROWED WITH MINOR ADAPTATION FROM PROF. CHRISTOS FALOUTSOS, CMU /615

Relational Model. Topics. Relational Model. Why Study the Relational Model? Linda Wu (CMPT )

Rochester Institute of Technology Golisano College of Computing and Information Sciences Department of Information Sciences and Technologies

Introduction to Data Management. Lecture #4 (E-R à Relational Design)

CSE 444, Winter 2011, Midterm Examination 9 February 2011

Database Applications (15-415)

Advanced Relational Database Management MISM Course S A3 Spring 2019 Carnegie Mellon University

Database Design Using E/R Model

Database Systems ( 資料庫系統 )

Introduction to Data Management. Lecture #6 E-Rà Relational Mapping (Cont.)

Homework 5 (by Tupac Shakur) Due: Monday Dec 3, 11:59pm

Relational Model & Algebra. Announcements (Thu. Aug. 27) Relational data model. CPS 116 Introduction to Database Systems

CSE-3421M Test #2. Queries

Carnegie Mellon University Department of Computer Science /615 - Database Applications C. Faloutsos & A. Pavlo, Spring 2014.

CS425 Midterm Exam Summer C 2012

Overview of the Class and Introduction to DB schemas and queries. Lois Delcambre

Announcement. Relational Database Design Part I. Keys. Relational model: review. Schema vs. data. More examples of keys

Data Structure and Algorithm Homework #3 Due: 2:20pm, Tuesday, April 9, 2013 TA === Homework submission instructions ===

Think about these queries for exam

Name: Database Systems ( 資料庫系統 ) Midterm exam, November 15, 2006

The Relational Model 2. Week 3

Midterm 2: CS186, Spring 2015

Database Applications (15-415)

Modern Database Systems Lecture 1

Homework 5 (by Tupac Shakur) Solutions Due: Monday Dec 3, 11:59pm

CS 146 Database Systems

CSc 2310 Principles of Programming (Java) Jyoti Islam

Class Information. Textbooks. Grading. Final Project. Grading. CS 440: Database Management Systems. Instructor:

Digital Lab Reports. Guide for 1250 Students

University of California, Berkeley. (2 points for each row; 1 point given if part of the change in the row was correct)

Informatics 1: Data & Analysis

Homework 4: Query Processing, Query Optimization (due March 21 st, 2016, 4:00pm, in class hard-copy please)

Using the Computer for Essays

The Relational Model. Chapter 3

Relational Database Design. Announcements. Database (schema) design. CPS 216 Advanced Database Systems. DB2 accounts have been set up

McGill April 2009 Final Examination Database Systems COMP 421

The Relational Model. Chapter 3. Comp 521 Files and Databases Fall

The Relational Model. Chapter 3. Database Management Systems, R. Ramakrishnan and J. Gehrke 1

Michael Kifer, Arthur Bernstein, Philip M. Lewis. Solutions Manual

How to Build Your Course in Moodle

Where Are We? Next Few Lectures. Integrity Constraints Motivation. Constraints in E/R Diagrams. Keys in E/R Diagrams

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Homework 3: Relational Database Design Theory (100 points)

Transcription:

Carnegie Mellon University Department of Computer Science 15-415/615 - Database Applications C. Faloutsos & A. Pavlo, Spring 2014 Homework 1 IMPORTANT Plagiarism: Homework may be discussed with other students, but all homework is to be completed individually. Typeset all of your answers whenever possible. Illegible handwriting may get no points, at the discretion of the graders. Deposit hard copy of your answers in class at 1:30pm on Tuesday, February 4th. For ease of grading, please solve each of the 4 questions on a separate page. If you need more pages for one question, please staple them together. Type the full info on each page: your name, Andrew ID, course #, Homework #, Question # on each of the 4 pages. Late homeworks: If you are turning your homework in late, please email it to all TAs with the subject line exactly 15-415 Homework Submission (HW 1 and the count of slip-days you are using. For your information: Graded out of 100 points; 4 questions total Rough time estimate: 6 hours (1-2 hours for each question Revision : 2014/05/06 16:24 Question Points Score Entity-Relationship Diagram 20 SQL Tables from the ER Model 25 Relational Algebra for Video Recommendation 30 Relational Calculus 25 Total: 100 1

15-415/615 Homework 1, Page 2 of 17 1/28/2014, 1:30pm Question 1: Entity-Relationship Diagram............ [20 points] Submit on separate page Consider a database to store information about organizations on campus. The database has the following properties: Each Organization has a title, and an unique organization ID (oid. Students belong to zero or more organizations; we record start date for when they join the organization. For each student we also record the name, and a unique student ID (sid. Each student is either a part time or full time student. For part time students we record their minimum number of hours they must work per week. For full time students we record the number of credits they are taking. Each Faculty member has a name and a unique faculty ID (fid. Each organization must have at least one student member, and it must be advised by exactly one faculty member. Each organization must have one President who is a part time student (so he has enough free time to manage the organization and each student cannot be the president of more than one organization. (The president does not need to be specified as a member of the organization. Given this description of the database and its constraints, we have created a mostly correct Entity-Relationship Diagram, shown in Figure 1. (a [10 points] Find and correct any mistakes in the given ER diagram. In addition, number and list them, like, e.g. 1. delete: arrow, from x to y 2. change to bold line: thin line, from z to w 3. change to bold box: entity e (b [5 points] There may also be some missing element(s. If any, add them to the picture, and list them, numbered. E.g. 1. add: attribute a, to entity e 2. add: bold line, arrow, from c to d. 3. add: weak entity, f, with attributes.... (c [5 points] List and number all the bold lines and all the arrows that are in the final, corrected version of the diagram. E.g. 1. bold, arrow, from Organization to advises 2. (not bold, arrow, from x to y Clarifications/Hints: List your assumptions, if any. We will accept all reasonable assumptions. For your drawing convenience, a PDF of the ER diagram is at http://www.cs.cmu.edu/~abeutel/ta/dbms.s14/hw1/q1.pdf Question 1 continues...

15-415/615 Homework 1, Page 3 of 17 1/28/2014, 1:30pm oid 3tle name fid Faculty advises Organiza3on Belongs to President Students sid name Is A Part Time Full Time weekly_hour_minimum credits_taken Figure 1: Almost correct ER diagram Question 1 continues...

15-415/615 Homework 1, Page 4 of 17 1/28/2014, 1:30pm oid 3tle name fid Faculty advises Organiza3on Belongs to Start_date President Students sid name Is A Part Time Full Time weekly_hour_minimum credits_taken (a (b (c 1. Make line from Organization to President, bold with an arrow from Organization to President 2. Make arrow from President to Part Time into an arrow (not bold from Part Time to President 3. Underline attribute fid for Faculty 1. Add attribute Start date to Belongs To 1. Bold with an arrow from Organization to President 2. Arrow no bold from Part Time to President 3. Bold with an arrow from Organization to advises 4. Bold with no arrow from Organization to Belongs To Grading info: -2 points if the student forgot to underline fid Question 1 continues...

15-415/615 Homework 1, Page 5 of 17 1/28/2014, 1:30pm Due to misunderstanding, no penalties in (c for effectively skipping over relations in giving arrows (Organization to Faculty -0.5 point for extra changes to the ER diagram that are incorrect, but don t take off points for that mistake more than once. -2 in (a if forgot to make line from Organization to President bold (or another -2 if forgot to add arrow appropriately -3 for (b if student knows that the date is missing but adds it incorrectly (such as to Student rather than belongs to Homework 1 continues...

15-415/615 Homework 1, Page 6 of 17 1/28/2014, 1:30pm Question 2: SQL Tables from the ER Model......... [25 points] Submit on separate page Consider a database for the courses of a university. We give a rough description below: Each Department has a unique numeric departmentid (for example computer science is 15 at CMU and title. Each Course has a unique numeric CourseID, a title, a course capacity, and may be offered by one or more departments. Eg., intro calculus may have CourseID=0001, and offered by the physics, as well as the math departments. Each Section has a numeric SectionID, is taught by one or more teachers, meets once or more per week (at given days at given times, and is of a certain type (lecture, lab, recitation, etc.. For example, we could have a course in computer science department (15, course ID 415 (databases, with section A (of type lecture. More precisely, we have the following ER diagram: cid 3tle 3tle did Departments offered from Courses credits available for capacity name sid office Teachers Taught by Sec3ons type tid Occur at day Mee3ng Time starttime endtime (a [15 points] Following the specification from the ER diagram, give the SQL commands to create the tables necessary in this database. (Use your best judgement for attribute types. We ll accept all reasonable choices. Include in your commands appropriately PRIMARY KEY, FOREIGN KEY, CASCADE, etc.. No need to use CHECK commands. Additionally, list and number all the constraints that your DDL statements can not enforce, or type zero, if no constraint is left un-enforced. Question 2 continues...

15-415/615 Homework 1, Page 7 of 17 1/28/2014, 1:30pm CREATE TABLE Departments ( did INTEGER, title CHAR(50, PRIMARY KEY (did CREATE TABLE Courses ( cid INTEGER, title CHAR(50, credits INTEGER, PRIMARY KEY (cid CREATE TABLE Teachers ( tid INTEGER, name CHAR(50, office CHAR(20, PRIMARY KEY (tid CREATE TABLE Sections ( sid INTEGER, cid INTEGER, type CHAR(20, capacity INTEGER, PRIMARY KEY (sid, cid, FOREIGN KEY (cid REFERENCES Courses ON DELETE CASCADE CREATE TABLE MeetingTimes ( sid INTEGER, cid INTEGER, day INTEGER, starttime INTEGER, endtime INTEGER, PRIMARY KEY (sid, cid, day, starttime, endtime, FOREIGN KEY (sid, cid REFERENCES Sections ON DELETE CASCADE CREATE TABLE SectionTeachers ( sid INTEGER, cid INTEGER, tid INTEGER, PRIMARY KEY (sid, cid, tid, Question 2 continues...

15-415/615 Homework 1, Page 8 of 17 1/28/2014, 1:30pm FOREIGN KEY (sid, cid REFERENCES Sections FOREIGN KEY (tid REFERENCES Teachers CREATE TABLE DepartmentOfferings ( did INTEGER, cid INTEGER, PRIMARY KEY (did, cid, FOREIGN KEY (did REFERENCES Departments FOREIGN KEY (cid REFERENCES Courses SQL, without CHECK commands, also cannot enforce certain participation constraints: That each Section has at least one teacher, that each Course belongs to at least one Department, that each Course has at least one Section, and each Section has to have at least one meeting time. Grading info: -0.5 point for every incorrect or missing attribute. -1 point for every incorrect table. -1 point if the answer does not say what constraints can t be enforced (-1 per part. -1 points if primary key is missing. Question 2 continues...

15-415/615 Homework 1, Page 9 of 17 1/28/2014, 1:30pm Consider now the following new ER diagram with slightly nonsensical labels (on purpose - the goal is to have you apply the rules of ER-to-tables, without relying on intuition: Fa$ So$ La$ def$ ghi$ ABC$ Easy_as$ Do_Re_Mi$ Ti$ Do$ OneTwoThree$ encore$ (b [10 points] Again, following the specification from the ER diagram, give the SQL commands to create the tables necessary in this database, and to enforce as many integrity constraints as you can. Consider all attributes to be integers. No need to use CHECK commands. List and number all the constraints that your DDL statements can not enforce, or type zero, if no constraint is left un-enforced. CREATE TABLE Do_Re_Mi ( Fa INTEGER, So INTEGER, La INTEGER, Ti INTEGER, Do INTEGER, PRIMARY KEY (So CREATE TABLE ABC ( def INTEGER, ghi INTEGER, OneTwoThree INTEGER, So INTEGER NOT NULL, PRIMARY KEY (ghi, FOREIGN KEY (So REFERENCES Do_Re_Mi ON DELETE CASCADE CREATE TABLE Encore ( Question 2 continues...

15-415/615 Homework 1, Page 10 of 17 1/28/2014, 1:30pm So_From INTEGER, So_To INTEGER, PRIMARY KEY (So_From, So_To, FOREIGN KEY (So_From REFERENCES Do_Re_Mi(So ON DELETE CASCADE FOREIGN KEY (So_To REFERENCES Do_Re_Mi(So ON DELETE CASCADE SQL, without CHECK commands, also cannot enforce the participation constraint for Do Re Mi in Encore. Grading info: -0.5 point for every incorrect or missing attribute. -1 point for every incorrect table. -1 point if the answer does not say what constraints can t be enforced (-1 per part. -1 points if primary key is missing. Homework 1 continues...

15-415/615 Homework 1, Page 11 of 17 1/28/2014, 1:30pm Question 3: Relational Algebra for Video Recommendation[30 points] Submit on separate page Grading info: graded by Shen Wang (SW We discuss here a new database for recommending videos to users. We have the following tables: Users: Each user has a userid and name. Videos: Each video has a videoid, title, length (in seconds, and uploader (linked to a UserID. Ratings: Each rating is between a userid and videoid and is given a rating from 1 to 5 (as in 1 to 5 stars. We give examples of these tables below. userid U1 U2 U3 U4 U5 U6 name Jack Jill John Jane Job Jay Table 1: Users videoid title length userid V1 Michelle Obama dunks on LeBron 18 U3 V2 Michael Sherman yells at Erin Andrews 46 U3 V3 Jack Gleeson on being famous 1707 U2 V4 The Wolf of Wall Street 10780 U2 V5 Transcendence Official Trailer 152 U2 Table 2: Videos Given this database answer the following questions: (a [3 points] Which of the following is the meaning of the command σ length<20 (Videos 1. Select all videos (videoid, title, length, and userid with length under 20 seconds 2. Select the length of all videos that are less than 20 seconds 3. Select the length of each video and if the length is over 20 seconds round it down to 20 seconds 4. None of the above. The real answer is............... Question 3 continues...

15-415/615 Homework 1, Page 12 of 17 1/28/2014, 1:30pm userid videoid rating U3 V1 5 U3 V2 5 U3 V4 5 U2 V4 4 U1 V4 1 U6 V4 1 U5 V4 2 U4 V5 3 Table 3: Ratings Answer #1 (b [3 points] Which of the following commands selects the titles of all videos under 20 seconds long? 1. σ title (π length<20 (Videos 2. σ length<20 (π title (Videos 3. π title (σ length<20 (Videos 4. None of the above. The real answer is............... Answer #3 (c For the following command: Videos Ratings i. [1 point] How many, and which, are the columns (=attributes of the answer? There are 5 columns: videoid, userid, title, length, and rating. ii. [2 points] 3 iii. [3 points] How many tuples are in the results? Give, as a table, all of the tuples returned by the query. videoid userid title length rating V1 U3 Michelle Obama dunks on LeBron 18 5 V2 U3 Michael Sherman yells at Erin Andrews 46 5 V4 U2 The Wolf of Wall Street 10780 4 Question 3 continues...

15-415/615 Homework 1, Page 13 of 17 1/28/2014, 1:30pm Grading info: Since a typical problem 3 question first asks for the number of tuples and columns returned by the query and then asks for the entire query result, a wrong result will necessarily lead to a wrong number of results. Hence, to avoid double counting, the grading schema is specified as follows: if the table is wrong and the number matches with the table, only the wrong table will lead to a loss of points. if the table is correct but the number is wrong, full point of (ii will be taken because of the confusion. if the table is wrong and the number does not match with the table, then both of them will be considered wrong even if the number itself is correct. For problem 4, since R.userID > R1.userID is ambiguous, we accept both tuples: < R.userID : U1, R1.userID : U6 > and < R.userID : U6, R1.userID : U1 > For the values in the table, if the overall table seems correct but there exist some minor errors (most likely due to a copy-paste, in general no point will be taken. However, if the error could possibly lead to a confusion, such as wrong UserID, 0.5 point will be taken. If the overall table does not make much sense, then 1 tuple worths 1 point. Some students didnt list the columns but only write the number of columns for question (is. This leads to a 0.5 point loss for the entire question 3 as long as the columns listed in the table are correct. However, if there is also no column in (iii or the columns in (iii is wrong, then for each problem that has missing/wrong columns, 0.5 point will be taken. (d For the following command: σ rating>4 (Videos Ratings i. [1 point] How many, and which, are the columns of the answer? There are 5 columns: videoid, userid, title, length, and rating. ii. [2 points] 2 iii. [3 points] How many tuples are in the results? Give, as a table, all of the tuples returned by the query. videoid userid title length rating V1 U3 Michelle Obama dunks on LeBron 18 5 V2 U3 Michael Sherman yells at Erin Andrews 46 5 Question 3 continues...

15-415/615 Homework 1, Page 14 of 17 1/28/2014, 1:30pm (e For the following command {π userid,videoid (Ratings} {π videoid (σ userid= U1 (Ratings} i. [1 point] How many, and which, are the columns of the answer? There is 1 column, userid. ii. [2 points] 5 iii. [3 points] userid U1 U2 U3 U5 U6 (f For the following command How many tuples are in the results? Give, as a table, all of the tuples returned by the query. π R.userID, R1.userID (ρ R (Ratings R.videoID=R1.videoID R.rating=R1.rating R.userID>R1.userID ρ R1 (Ratings i. [1 point] How many, and which, are the columns of the answer? There are 2 columns: R.userID, R1.userID. ii. [2 points] 1 iii. [3 points] R.userID U6 How many tuples are in the results? Give, as a table, all of the tuples returned by the query. R1.userID U1 Homework 1 continues...

15-415/615 Homework 1, Page 15 of 17 1/28/2014, 1:30pm Question 4: Relational Calculus..................... [25 points] Submit on separate page Grading info: graded by Ming Zhong (MZ We will again use the video recommender database from the last question. We begin by looking at statements using tuple relational calculus. (a [2 points] Which of the following is the meaning of the statement {V V Videos V.length < 20} 1. Select all videos tuples with length under 20 seconds 2. Select the length of all videos that are less than 20 seconds 3. Select the length of each video and if the length is over 20 seconds, round it down to 20 seconds 4. None of the above. The real answer is............... Answer #1 (b [3 points] Which of the following commands gives the tuples from Users who liked (gave at least 4 stars to video V4 (i.e., The Wolf of Wall Street : 1. {P U Users, R Ratings(R.userID = U.userID P.userID = U.userID R.videoID = V 4 P.videoID = V 4 R.rating 4} 2. {U U Users R Ratings(R.userID = U.userID R.videoID = V 4 R.rating 4} 3. {U R Ratings(R.userID = U.userID R.videoID = V 4 R.rating 4} 4. None of the above. The real answer is............... Answer #2 (c For the following command: {P U Users, V 1 Videos, V 2 Videos, V 3 Videos( V 1.videoID V 2.videoID V 2.videoID V 3.videoID V 1.videoID V 3.videoID V 1.userID = V 2.userID V 2.userID = V 3.userID U.userID = V 3.userID V 1.userID = P.userID i. [1 point] How many, and which, are the columns of the answer? There are 2 columns: userid and username. ii. [2 points] 1 iii. [3 points] How many tuples are in the results? Give, as a table, all of the tuples returned by the query. P.username = U.name} Question 4 continues...

15-415/615 Homework 1, Page 16 of 17 1/28/2014, 1:30pm userid username U2 Jill (Big Hint: Check out example Q7 on Page 121 of the textbook. (d For the following command: {U U Users V Videos(U.userID = V.userID} i. [1 point] How many, and which, are the columns of the answer? There are 2 columns: userid and name. ii. [2 points] How many tuples are in the results? 2 iii. [3 points] Give, as a table, all of the tuples returned by the query. userid name U2 Jill U3 John Question 4 continues...

15-415/615 Homework 1, Page 17 of 17 1/28/2014, 1:30pm Next we will look at commands that use domain relational calculus. (e [2 points] Which of the following commands gives the names of the users who liked (gave at least 4 stars to videoid = V4 (ie., The Wolf of Wall Street? 1. { N U, V, R( U, N Users V Videos U, V, R Ratings R 4 V = V 4 } 2. { N U, V, T, L, R( U, N Users V, T, L, U Videos U, V, R Ratings R 4} 3. { N U, V, R( U, N Users U, V, R Ratings R 4 V = V 4 } 4. None of the above. The real answer is............... Answer #3 Note, Answer #2 is incorrect because it requires that the same user uploaded the video and did the rating. (f For the following command: { V, T L, U( V, T, L, U Videos U2, R( U2, V, R Ratings R = 5} i. [1 point] How many, and which, are the columns of the answer? There are 2 columns: videoid and title. ii. [2 points] 3 iii. [3 points] videoid V1 V2 V4 Grading info: How many tuples are in the results? Give, as a table, all of the tuples returned by the query. title Michelle Obama dunks on LeBron Michael Sherman yells at Erin Andrews The Wolf of Wall Street -1 point for every incorrect column name. Full points are deducted if there is any missing/wrong entry in the result. Also, if the table is correct but the number of entries is wrong, full point of (ii will be taken. End of Homework 1