Scott_OR3.docx - Scott Kruschke COP4710 202001 Database...

This preview shows page 1 - 3 out of 9 pages.

Scott KruschkeCOP4710 202001Database SystemsApril 25, 2020OR Chapter 33-1a. Display the Cartesian product (no WHERE clause). Use SELECT *....How many rows didyou get? How many rows will you always get when combining two tables with n and m rows inthem (Cartesian product)?
b. Display an equi-join of Stu and Major on majorCode (show this both ways: first using anappropriate WHERE clause; and second, using ANSI SQL standard syntax). Use table aliases.How many rows did you get?
c. Leave off the column qualifiers (the aliases) on the equi-join in step b. What do you get? Thiswill give an error because of ambiguous column names.d. Use the COUNT(*) function instead of SELECT * in the query. Use COUNT to show thenumber of rows in the result set of the equi-join and the Cartesian product. Do the equi-join firstwith COUNT, then comment out the WHERE clause for the second answer (put -- in front of theword WHERE).e. Add two more major codes to the Major table as follows: <’IT’, ‘Information Technology’>and <’ST’, ‘Statistics’>. Display all the student names (snames) and majorDescs, but I wouldalso like to see all the majors listed, even if there are no students taking that major. Show yourquery in both ways: first, using ANSI SQL standard syntax, and then using Oracle’s drivingtable(+) concept.

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 9 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
Brooks
Tags
Cartesian product

Newly Uploaded Documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture