Mcmillan s quizzes
Download
1 / 11

McMillan’s Quizzes - PowerPoint PPT Presentation


  • 135 Views
  • Updated On :

McMillan’s Quizzes. Multiple choice, open book, open notes Not open computers, not open classmates Partial credit: if less than half the class gets a question right, he’ll give half-credit for the next best answer Not easy!. Of the following, which is an advantage of using a

Related searches for McMillan’s Quizzes

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'McMillan’s Quizzes' - anevay


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Mcmillan s quizzes l.jpg
McMillan’s Quizzes

  • Multiple choice, open book, open notes

  • Not open computers, not open classmates

  • Partial credit: if less than half the class gets a question right, he’ll give half-credit for the next best answer

  • Not easy!


Slide2 l.jpg

  • Of the following, which is an advantage of using a

  • relational database?

  • Attributes are inherited

  • Relations are related to others hierarchically

  • It is the only database approach that provides

    • data independence

  • It permits queries that are at least as powerful as

    • relational algebra

  • All of the above


Slide3 l.jpg


Slide4 l.jpg

id schema?

dno

since

Professor

WorksIn

Department

DeptHead

since

  • Of the following, what is implied by the heavy arrow from

  • “Professor” to “WorksIn”

    • Each department must have at least one professor

    • All professors work in exactly one department

    • Professors may be members of one or more

      • departments

    • All professors either work in, or head some

      • department

    • None of the above


Slide5 l.jpg

  • Why is the ‘join’ operator not one of the five schema?

  • primitive (basic) operators of relational algebra?

    • It was not included in Codd’s seminal papers

    • Joins can be accomplished by composing primitive operations.

    • It is equivalent to the Carteasian product

    • It has too many variants to be considered a primitive operator.

    • None of the Above


Slide6 l.jpg

schema?StudID1( Course1Course2( (T1(1StudID1, 2Course1, 3Semester1, 4Grade1), Transcript)

⋈StudID1=StudID2 (T2(1StudID2, 2Course2, 3Semester2, 4Grade2), Transcript)))

  • Which of the following best describes the result of this

  • relational algebra statement?

    • IDs of students who have taken at least two different courses

    • IDs of students who have taken the same course twice

    • IDs of students who have taken exactly one course

    • IDs of students who have taken exactly two courses

    • None of the above


Problem points l.jpg
Problem Points schema?

  • ER: binary, ternary, aggregate relationships. Problem: Represent supplier inventory, and who sells what to whom.

Suppliers

Products

Orders


Sql aggregate operators l.jpg
SQL: Aggregate Operators schema?

  • Example:

    sqlite> SELECT * FROM Sample;

    a|b

    1|1

    2|4

    3|9

    4|8

    5|5

    sqlite> SELECT a, MAX(b) FROM Sample;

  • What does this return? Does it even run?


Relational calculus some points l.jpg
Relational Calculus – Some points schema?

  • TRC != DRC

  • TRC Projection


Slide10 l.jpg

CREATE TABLE Courses ( schema?    number TEXT,    semester TEXT,    seats INTEGER,    PRIMARY KEY(number, semester));CREATE TABLE Enrollment (    student_name TEXT,    course_number TEXT,    course_semester TEXT,    grade INTEGER,    PRIMARY KEY(student_name, course_number, course_semester),    FOREIGN KEY student_name REFERENCES Students(name),    FOREIGN KEY (course_number, course_semester)

REFERENCES Courses(number, semester));

  • 4C: Find all classes in which no student failed (TRC)

    • Do with and without the universal quantifier


Questions l.jpg
Questions? schema?

  • Database Concepts / History

  • ER model, ER diagrams

  • Relational model

  • Relational algebra

  • Relational calculus

  • SQL

  • Database Application Development


ad