Final_CMPS180_Winter2018_LongAnswers.pdf

Final_CMPS180_Winter2018_LongAnswers.pdf - CMPS 180 Final...

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

View Full Document Right Arrow Icon
CMPS 180, Final Exam, Winter 2018, Shel Finkelstein Student Name: ____________________________________________________ Student ID: ____________________________________________________ UCSC Email: ____________________________________________________ Final Points Part Max Points Points I 42 II 24 III 36 Total 102 The first Section (Part I) of the Winter 2018 CMPS 180 Final is multiple choice and is double-sided. Answer all multiple choice questions on your Scantron sheet. You do not have to hand in the first Section of the Exam, but you must hand in the Scantron sheet, with your name, email and student id on that Scantron sheet. Please be sure to use a #2 pencil to mark your choices on this Section of the Final. This separate second Section (Parts II and III) of the Final is not multiple choice and is single-sided, so that you have extra space to write your answers. If you use tha t extra space, please be sure to write the number of the problem that you’re solving next to your answer. Please write your name, email and student id on this second Section of the Exam, which you must hand in. You may use any writing implement on this Section of the Exam. At the end of the Final, please be sure to hand in your Scantron sheet for the first Section of the Exam and also this second Section of the Exam , and show your UCSC id when you hand them in. Also hand in your 8.5 x 11 “cheat sheet” , with your name written in the upper right corner of the sheet.
Image of page 1

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

View Full Document Right Arrow Icon
Part II: (24 points, 6 points each) Question 21: Here are statements creating two relations R and S: CREATE TABLE S ( c INT PRIMARY KEY, d INT ); CREATE TABLE R ( a INT PRIMARY KEY, b INT, FOREIGN KEY(b) REFERENCES S(c) ON UPDATE CASCADE ); Relation R(a,b) currently contains the four tuples, (0,4), (1,5), (2,4), and (3,5). Relation S(c,d) currently contains the four tuples, (2,10), (3,11), (4,12), and (5,13). Indicate all changes that happen to both R and S when the following SQL statements are executed upon the R and S instances that are shown above. That is, you should ignore changes made by earlier parts of this question when you answer later parts. 21a): UPDATE S SET c=7 WHERE d=13; Answer 21a): Changes made to the original R: Changes made to the original S: 21b): UPDATE R set b=5 WHERE a=0; Answer 21b): Changes made to the original R: Changes made to the original S: 21c): DELETE FROM S WHERE c=4; Answer 21c): Changes made to the original R: Changes made to the original S:
Image of page 2
Question 22a): Why have any indexes in a database? Give two different clear reasons. If you give more than two, only first two will be graded.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
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