15 which of the following sql statements deletes all

This preview shows page 11 - 15 out of 31 pages.

15. Which of the following SQL statements deletes all the data from a tableLecturer,including the table itself.(a)DROP Lecturer;(b)DELETE * FROM Lecturer;(c)DELETE FROM Lecturer;(d)DROP TABLE Lecturer;(e)DELETE Lecturer;lOMoARcPSD|4596151
SEE OVERDownloaded by Haotian Chen ([email protected])
Semester 2 Supplementary/Deferred ExaminationsFebruary 201611.CITS140216. Consider a relationR(A, B, C, D) with the following rows.A B C D1 3 2 22 3 2 43 3 3 63 1 1 6Which of the following decompositions into two relationsR1andR2islossless-join, for this particular instance?lOMoARcPSD|4596151
17. Which SQL keyword ismost similarto the relational algebrarenameoperatorρ?
SEE OVERDownloaded by Haotian Chen ([email protected])
Semester 2 Supplementary/Deferred ExaminationsFebruary 201612.CITS140218. In a database there is a trade-off between isolation levels and performance, be-cause stronger isolation reduces the ability of the system to interleave statementsfrom different transactions. Which of the following lists the possible isolation lev-els inincreasingisolation strength (and thusdecreasingperformance potential)?lOMoARcPSD|4596151
19. Suppose that a tableT(A, B, C) contains the following tuples: (1,1,3), (1,2,3),(2,1,4), (2,3,5), (2,4,1), (3,2,4) and consider the following view definition:CREATE VIEW V ASSELECT A+B AS D, CFROM T;Consider the following query over the viewVSELECT D, SUM(C)FROM VGROUP BY DHAVING COUNT(*) <> 1;Which of the following tuples is in the output?(a) (2,3)(b) (1,8)(c) (6,7)(d) (3,5)(e) (5,9)
SEE OVERDownloaded by Haotian Chen ([email protected])
Semester 2 Supplementary/Deferred ExaminationsFebruary 201613.CITS140220. Suppose that a university has a database containing two tables created as follows:CREATE TABLE Student (id INT, name VARCHAR(64));CREATE TABLE Enrolled (sid INT, uid INT);The fieldStudent.idis the student number, andEnrolled.sidis a foreign keyto this field, whileEnrolled.uidis the unique code for a unit.What does the following query produce?SELECT S.id, COUNT(E.uid) FROMStudent S LEFT OUTER JOIN Enrolled EON S.id = E.sid GROUP BY S.id(a) It produces a list of all the enrolments, listed by student number and unitcode(b) It produces a list of the number of enrolments for each student that is enrolledin at least one unit(c) It produces a list of the number of enrolments for each student in theStudenttable, including students not enrolled in any units, for which the number isgiven asNULL(d) It produces a list of the number of enrolments for each student in theStudent

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 31 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
One
Professor
N/A
Tags
HaoTian Chen

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture