Answered step by step
Verified Expert Solution
Link Copied!

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: and . 87 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 Oracles driving table (+) concept.

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.

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

Proficiency with Microsoft Word, Excel, PowerPoint

Answered: 1 week ago

Question

Experience with SharePoint and/or Microsoft Project desirable

Answered: 1 week ago