Answered step by step
Verified Expert Solution
Question
1 Approved Answer
f. Add two more students to the Stu table as follows: and . 87 Display all the student names (snames) and majorDescs, whether the students
f. Add two more students to the Stu table as follows:
g. Display all the student names (snames) and majorDescs. Make sure all the students as well as all the majors are shown in the result set, whether the students have a major or not, and whether the major has students or not.
3-1 Create two tables, Stu(sname, majorcode) and Major(majorcode, majordesc) with the data shown. Use VARCHAR2 (2) for codes and appropriate data-types for the other attributes. Stu snamemajorCode Jones Smith Evans Adams CS CS AC MA AC Cs MA Accounting Computer Science Math a. Display the Cartesian product (no WHERE clause). Use SELECT *.... How many rows did you get? How many rows will you always get when combining two tables with n and m rows in them (Cartesian product)? Display an equi-join of Stu and Major on majorCode (show this both ways: first using an appropriate WHERE clause; and second, using ANSI SQL standard syntax). Use table aliases. How many rows did you get? b. c. Leave off the column qualifiers (the aliases) on the equi-join in step b. What do you get? This will give an error because of ambiguous column names. d. Use the COUNT() function instead of SELECT in the query. Use COUNT to show the number of rows in the result set of the equi-join and the Cartesian product. Do the equi-join first with COUNT, then comment out the WHERE clause for the second answer (put--in front of the word WHERE) Add two more major codes to the Major table as follows:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started