4 views

Uploaded by Jonathan Mares

CS411 HW

save

- Fee Mamagement
- Normalization Steps
- Lecture 13 Functional Dependencies
- Dbms Normal Form
- Sq l Summary
- Lec_16_FDs.ppt
- Practice Q's 14-18
- Codes
- BO Questions
- Functional Dependencies
- Dbms Viva and Descriptve Questions AYAAN COLLEGE OF ENG & TECH
- Lexical Parameter is Used to Replace a Specific
- IES_POS 1.0
- Lab Manual
- advanced sql.pdf
- Item Open Interface Setup_doc_18mar08
- dbms by gs
- 7.-SQL-View
- 4) Working With DB2 Data Using SQL and XQuery PPT
- Structured Query Language
- Chapter 1 Solution
- D50317GC10 Appendix B
- App_C
- Record Finance net System
- Oracle_ch9.pptx
- Set-3 _ Interviewquestionspdf
- Oracle Fdw
- ABAP
- Cl Commands Rtvdtaara AS400 OS400 RUNQRY
- DB2v.8 Web Services Tutorial
- Lecture 4
- Problem Set 1
- Control Valve Memo (Submit)
- Revised Lab 1 Pump Curve
- Write Up
- Lecture 1 Algorithms
- Jonathan Mares Problem Set 1
- CS2800 Homework 5
- BME Final Notes
- Analysis of Peppermint Leaf and Spearmint Leaf Extracts
- Section 7 Notes CHEME 3240
- Syllabus ChemE 3230 Spring 2013

You are on page 1of 3

Assignment 3

Due Monday, March 27 at 11:59pm

General Instructions

**• Feel free to talk to other members of the class in doing the homework. You should,
**

however, write down your solutions yourself. List the names of everyone you worked

with at the top of your submission.

• Keep your solutions brief and clear.

• Please use Piazza if you have questions about the homework but do not post answers.

Feel free to use private posts or come to the office hours.

Homework Submission

**• We DO NOT accept late homework submissions.
**

• We will be using Compass for collecting the homework assignments. Please submit

your answers via Compass. Hard copies are not accepted.

• Contact the TAs if you are having technical difficulties in submitting the assignment;

attempt to submit well in advance of the due date/time.

• The homework must be submitted in pdf format. Scanned handwritten and/or hand-

drawn pictures in your documents won’t be accepted.

• Please do not zip the answer document (PDF) so that the graders can read it directly

on Compass. You need to submit one answer document, named as hw3 netid.pdf.

• Please see the assignments page for more details. In particular, we will be announcing

errata, if any, on this page.

1

R may contain duplicates tuples.e. [10] Find the names of students who are enrolled in the highest number of classes. please don’t assume otherwise. and correctness. Students. For this question. sname ) Enrolled (sid. [5] Update the name of the student with sid as 22222. to Doe. 2 1 SQL queries involving a single relation Consider a relation with just one attribute. . 2. 2 SQL queries involving multiple relations Consider the following relations: Courses (cid. cname . you may assume that there are no duplicates in R. and that R has odd number of tuples. i.cid) Express the following queries using SQL. pname ) Students (sid. Express the following queries using SQL. and correctness. pid ) Professors (pid. 3 Database Manipulation and Views Consider the relations Courses. who are not teaching any course. 1. 1. For this question. Your queries will be graded based on their simplic- ity. [10] Write a query to compute the largest value of A in R. all other students (not outputted) have taken fewer classes. You are not allowed to use the Max operator. For this question. If multiple distinct values of A are candidates. Enrolled as described in ques- tion 2. [10] Write a query to compute the mode of A in R. [5] Find the names of students who are not enrolled in any class. 3. 2. [10] Find the names of professors who teach in every room in which some course is taught. [5] Insert the following new tuple in Students: John with sid as 22222. 3. then all of them should be returned. Professors. 2. [10] Write a query to compute the median value of A in R. Your queries will be graded based on their simplicity. room .. 3. [5] Remove all professors from Professors. R(A). 1. you may assume that there are no duplicates in R.

explain why we can not set Enrolled. . Enrolled using the SQL CREATE statement. where P ⊆ {A1 . its value is propagated accordingly to Enrolled. . [10] Create the tables for Courses. containing the names of all profes- sors for whom the number of students they teach across their courses is greater than hundred. [5] A deletion or update to a sid should be handled appropriately in Enrolled. R satisfies the following functional dependency: A1 → A2 . Professors. 3 4. 1 based on a question asked on Piazza. the professor id must be present in the corresponding table 2. . An }. . (b) Also. . (a) Please rewrite the SQL CREATE statement such that when an sid gets updat- ed/deleted in Students. all the student and course ids should be present in the correspond- ing tables • For Courses. . 5 Closure of Functional Dependencies Consider a relation R(A1 . A2 . 1. Students. Professors. P → A2 An . with the following constraints: • For Enrolled. . Enrolled as described in ques- tion 2. [10] Create a materialized view BusyProfessors. we count the student only once. 3. Students.1 Note: attempt this problem at your leisure. due to the constraint as explained in the previous question. .sid to NULL when we delete that sid from Students. [0] How many logically implied functional dependencies are of the form. A2 . . An ). do not submit solutions. with n ≥ 3. 4 Constraints and Triggers Consider the relations Courses. [5] Create a trigger so that an insertion into Courses creates an tuple in Professors if the pid corresponding to the insertion doesn’t exist in Professors. 1. Note: if a student is enrolled in two different courses of the same professor.

- Fee MamagementUploaded byEr Abhay Tiwari
- Normalization StepsUploaded byAnubhav Gupta
- Lecture 13 Functional DependenciesUploaded bymuraliesea
- Dbms Normal FormUploaded bySiva Kumar Koona's
- Sq l SummaryUploaded byTed Lee
- Lec_16_FDs.pptUploaded byZain Ul Islam
- Practice Q's 14-18Uploaded byYelena Bytenskaya
- CodesUploaded byRomeo Balingao
- BO QuestionsUploaded bypruthesh_sahoo
- Functional DependenciesUploaded byMD Ibrahim Riad
- Dbms Viva and Descriptve Questions AYAAN COLLEGE OF ENG & TECHUploaded byarifafroz
- Lexical Parameter is Used to Replace a SpecificUploaded bynagkkkkk
- IES_POS 1.0Uploaded byRandy Lamarca Alabab
- Lab ManualUploaded byzinabuhaile26
- advanced sql.pdfUploaded bygazettt
- Item Open Interface Setup_doc_18mar08Uploaded byVijay Kishan
- dbms by gsUploaded byRaj
- 7.-SQL-ViewUploaded bytejudeep
- 4) Working With DB2 Data Using SQL and XQuery PPTUploaded byPraveen Shah
- Structured Query LanguageUploaded byGopi Chandu
- Chapter 1 SolutionUploaded byVandara Kam
- D50317GC10 Appendix BUploaded byАскандар Каландаров
- App_CUploaded byThilina
- Record Finance net SystemUploaded byVinod Kc
- Oracle_ch9.pptxUploaded byJenner Patrick Lopes Brasil
- Set-3 _ InterviewquestionspdfUploaded byGoliBharggav
- Oracle FdwUploaded byeguzman
- ABAPUploaded byeyalamuri
- Cl Commands Rtvdtaara AS400 OS400 RUNQRYUploaded bybeach20508217
- DB2v.8 Web Services TutorialUploaded byricci_s

- Lecture 4Uploaded byJonathan Mares
- Problem Set 1Uploaded byJonathan Mares
- Control Valve Memo (Submit)Uploaded byJonathan Mares
- Revised Lab 1 Pump CurveUploaded byJonathan Mares
- Write UpUploaded byJonathan Mares
- Lecture 1 AlgorithmsUploaded byJonathan Mares
- Jonathan Mares Problem Set 1Uploaded byJonathan Mares
- CS2800 Homework 5Uploaded byJonathan Mares
- BME Final NotesUploaded byJonathan Mares
- Analysis of Peppermint Leaf and Spearmint Leaf ExtractsUploaded byJonathan Mares
- Section 7 Notes CHEME 3240Uploaded byJonathan Mares
- Syllabus ChemE 3230 Spring 2013Uploaded byJonathan Mares