Question: Need help setting this Oracle exercise up. Exercises for Chapter 3 As you do the exercises, it is a good idea to copy/paste your query

 Need help setting this Oracle exercise up. Exercises for Chapter 3

Need help setting this Oracle exercise up.

Exercises for Chapter 3 As you do the exercises, it is a good idea to copy/paste your query as well as your query result into a word processor 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 sname Jones Smith Evans Adams majorCode cs AC MA CS Major majorCode majorDesc AC Cs MA Accounting Computer Science Math a. Display the Cartesian product (no WHERE clause). Uise SELECT ..How many rows did you get? How many rows will you always get when combining two tables with n and m rows in th m (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 allases. How many rows did you get? b. c. Leave off the column qualfiers (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. Uise 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 (putin front of the word WHERE) Add two more major codes to the Major lable as follows: eIT, "Intormation Technology' and . Display all the student names (snames) and major Deses, but I would also like to see all the majors listed, even if there are no students taking that major. Show your query in both ways: first, using ANSI sQt, standard syntax, and then using Oracle's driving table(+) concept. e. r. Add two more students to the Stu table as follows: 'Arpan', NULL> and 'Ayona, NULL>. Display all the student names (snames) and majorDescs, whether the students have a major or not. Show you query both ways: first, using ANSI SQL standard syntax, and then using the Oracle's driving table (+) concept. g. Display all the student names (snames) and majorDeses. 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!