341quiz2-2017.Solutions.pdf - Spring 2017 Meral Ozsoyoglu...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Spring 2017 Apri 11, 2017 Meral Ozsoyoglu ECES 341: Introduction to Database Systems Quiz #2 Solutions This is a closed book Quiz. There are 3 questions with multiple parts. The duration of the quiz is 45 minutes . Name:___________________________ Q1. a.________ b.________ Q2. a.________ b.________ c.________ Q3. a.________ b.________ c.________          
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
(35 points) 1 . Consider a relation               StudentsGrades (name, cid, examid, score)  on students grades in exams of courses student is enrolled in a particular year, where a student may be in  one or more courses and each course may have one or more exams, and each score is out of 100.  a) What are the groupings generated by the following  SQL query with GROUP BY ROLL UP?      SELECT name, cid, examid, AVG (score)      FROM StudentGrades      GROUP BY ROLLUP  (name, cid, examid);    Answer:   A set of 4 groupings    { (name, cid, examid), (name, cid), (name), () }    b) Show the result of the query in part (a) if the relation instance of  StudentGrades relation is as  follows:  StudentGrades:   name     cid  examid  score  John  EECS 341  MT1  55  John  EECS 341  MT2  85  John  EECS 340  MT1  60  John 
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern