Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overview Joining tables can be confusing at first. To complicate matters there are several methods that can be used. Oracle had its traditional method and

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Overview Joining tables can be confusing at first. To complicate matters there are several methods that can be used. Oracle had its traditional method and then the ANSI organization added its various methods of joining tables together. In all there are four methods that can be used. Some queries could be done with all four methods while others might only be able to use 2 or 3 methods. Try to use the 4 methods, compare your results. Download the script for NORTHWOODS.SQL from Blackboard and run the script to create the tables you will require for this exercise. Task 1 - Preparing your environment Please copy the script northwogdssigh to your desktop and run it as previously discussed to your database on CALVIN. Task 2 - Your Lab! Practice Questions INNER JOINS with 2 Tables Look at the following diagram and then enter the query on the next page that is given to you. The query is in Oracle traditional format you also need to rewrite the query in ANSI format using the JOIN ... ON keywords. Oracle Traditional Method - Join is accomplished in the WHERE clanse Figure 3-43 Query joining two tables ANSI JOIN...ON Method - Join is accomplished in the JOIN ... ON clanse SEILCT s_id, s_last, s_first, student.f_id, f_last FRou student Joti faculty ON studenc.f_1d = faculty.f_1d; Now enter a query based on three tables. Here is the ERD showing the three tables. Id) FA Figure 3-44 Joining three tables Here is the query: Do this as an ANSI query, in addition to the traditional format shown on the next page. ANSI JOIN...ON Method - Join is accomplished in the JOIN ... ON clause Oracle Traditional Method - Join is accomplished in the WHERE clause Figure 3-45 Query joining three tables Now try a couple on your own in both used previously formats. You will likely find it a little challenging at first, practice will make it easier. Questionl Display the TERM_DESC, COURSE_NAME, BLDG_CODE and ROOM for every course ever taught by faculty member John Blanchard. Question 2 Display the S_LAST, S_FIRST, COURSE_NAME, TERM_DESC and GRADE values for every student taught by faculty member John Blanchard. Question 3 Display S_LAST, S_FIRST, COURSE_ID, COURSE_NO, COURSE_NAME for all course taken by Daniel Black. This query will use 4 tables. Please submit a word document with each question having the SQL statement followed by the screenshot. Overview Joining tables can be confusing at first. To complicate matters there are several methods that can be used. Oracle had its traditional method and then the ANSI organization added its various methods of joining tables together. In all there are four methods that can be used. Some queries could be done with all four methods while others might only be able to use 2 or 3 methods. Try to use the 4 methods, compare your results. Download the script for NORTHWOODS.SQL from Blackboard and run the script to create the tables you will require for this exercise. Task 1 - Preparing your environment Please copy the script northwogdssigh to your desktop and run it as previously discussed to your database on CALVIN. Task 2 - Your Lab! Practice Questions INNER JOINS with 2 Tables Look at the following diagram and then enter the query on the next page that is given to you. The query is in Oracle traditional format you also need to rewrite the query in ANSI format using the JOIN ... ON keywords. Oracle Traditional Method - Join is accomplished in the WHERE clanse Figure 3-43 Query joining two tables ANSI JOIN...ON Method - Join is accomplished in the JOIN ... ON clanse SEILCT s_id, s_last, s_first, student.f_id, f_last FRou student Joti faculty ON studenc.f_1d = faculty.f_1d; Now enter a query based on three tables. Here is the ERD showing the three tables. Id) FA Figure 3-44 Joining three tables Here is the query: Do this as an ANSI query, in addition to the traditional format shown on the next page. ANSI JOIN...ON Method - Join is accomplished in the JOIN ... ON clause Oracle Traditional Method - Join is accomplished in the WHERE clause Figure 3-45 Query joining three tables Now try a couple on your own in both used previously formats. You will likely find it a little challenging at first, practice will make it easier. Questionl Display the TERM_DESC, COURSE_NAME, BLDG_CODE and ROOM for every course ever taught by faculty member John Blanchard. Question 2 Display the S_LAST, S_FIRST, COURSE_NAME, TERM_DESC and GRADE values for every student taught by faculty member John Blanchard. Question 3 Display S_LAST, S_FIRST, COURSE_ID, COURSE_NO, COURSE_NAME for all course taken by Daniel Black. This query will use 4 tables. Please submit a word document with each question having the SQL statement followed by the screenshot

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

How does an organization know if it is pursuing optimal strategies?

Answered: 1 week ago

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago