Question

Please explain Left Outer Join and Right Outer Join. Show the difference with a small example....

Please explain Left Outer Join and Right Outer Join. Show the difference with a small example.

Write a Left outer join query between AP.Vendors and AP.Invoices table and display a sample of recordset (Please don’t display all the records of the output)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Differences between Left outer join and Right outer join with an example

a) Left outer join: Essentially returns complete rows list of a table on left side of join operation. . When there is no matching for the row then result comprises of NULL in right side.

SELECT Teacher.TeacherName,
       TeacherCourse.Course_ID
FROM Teacher
LEFT OUTER JOIN TeacherCourse 
ON TeacherCourse.ErollNo = Teacher.ErollNo
ORDER BY TeacherCourse.Course_ID

b) Right Outer Join; Same as that of Left Outer Join operation, however right replaces left in the query.

SELECT Teacher.TeacherName,

TeacherCourse.Course_ID

FROM Teacher

RIGHT OUTER JOIN TeacherCourse

ON TeacherCourse.ErollNo = Teacher.ErollNo

ORDER BY TeacherCourse.Course_ID

2) Left outer join query between AP.Vendors and AP.Invoices table

SELECT AP.invoice_number, AP.vendorname

FROM AP.vendors LEFT OUTER JOIN AP.invoice

ON AP.vendors.vendor-id = AP.invoices.vendor-id

ORDER BY AP.invoice_number

Add a comment
Know the answer?
Add Answer to:
Please explain Left Outer Join and Right Outer Join. Show the difference with a small example....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Match the type of join to the situation A. RIGHT B. INNER C. LEFT D. OUTER...

    Match the type of join to the situation A. RIGHT B. INNER C. LEFT D. OUTER All records are returned. If they can be matched, they are. If they cannot be, they are attached to NULL values for the other table All of the first table's records are returned, even if they cannot be matched All of the second table's records are returned, even if they cannot be matched The only returned records are the ones where the joined fields...

  • QUERY EXAMPLE2 SELECTfrom Employee em (Refer to query example 2 to answer questions 12- 13) 12....

    QUERY EXAMPLE2 SELECTfrom Employee em (Refer to query example 2 to answer questions 12- 13) 12. You plan to join the Location table and fear there may be some employees with no location. You want to make sure that the query returns a list of all employee What join clause would you add to the query above? records. A. LEFT JOIN Location lo ON em.LocationlD lo LocationID B. RIGHT JOIN Location lo ON em.LocationID lo.LocationlD C. INNER JOIN Location lo...

  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • w with explanation please Pg. 02 Question Two Leaming Outcomers) Question Two 10 Marks Create a...

    w with explanation please Pg. 02 Question Two Leaming Outcomers) Question Two 10 Marks Create a SQL statement to retrieve information from a relational database Consider the relations: requested STUDENT | Student# Std-Name Address Khan Madina Muhammad Yanbu 3 Ahmad Riyadh |+| COURSE Student# Course | Course-Name 1 IT342Enterprise Systems 2 IT407Professional Issues 2 IT445DSS Write a query using the Right Outer Join to retrieve the record from the two relations. Also, construct the table displaying the output of your...

  • Match the keyword with its function Makes something new, typically a table Provides values to a...

    Match the keyword with its function Makes something new, typically a table Provides values to a table Declares a constraint on a table Chooses or reorders columns Declares which tables are present Identifies records of interest Renames either a column or a table Combines two tables or queries with equivalent structure Finds records that are shared between two tables or queries Determines items from a table or query that are not in the other table or query Extends records from...

  • Please show step by step, complete solution and explain if possible. Thank you so much. 3....

    Please show step by step, complete solution and explain if possible. Thank you so much. 3. Six-Sided Die Display Circuit In this problem, you will design a logic circuit to display the six faces of a die using 7 LEDs. For example, the value 5 is shown on the display below. Your circuit takes three bits XYZ as input and outputs the patterns shown in the table below, by lighting up the correspondind LEDs. For example, for the value 5,...

  • please explain the difference between right and left skewed graphs, how you can tell from this...

    please explain the difference between right and left skewed graphs, how you can tell from this graph, and additionally how to calculate a percentile range for part b A middle-school teacher teaches a class of 36 pupils. She decides to plot a histogram of her students' weight (shown below) 2. 16 14 t 12 10 6 4 2 0.5 35.5 40.5 45.5 50.5 55.5 60.5 65.5 Weights (in kg)> a. (2 points) What is the skew of the weight distribution?...

  • Explain and show an example of the difference between between STRH for big endian and little...

    Explain and show an example of the difference between between STRH for big endian and little endian in ARM.

  • The left and right brain may sample information at a different rate. Please explain which hemisphere...

    The left and right brain may sample information at a different rate. Please explain which hemisphere (right or left) takes shorter samples with more samples being collected overall and which hemisphere takes longer samples with fewer samples being collected overall? Explain how this may impact speech processing in the left and right hemisphere, including how this type of information processing relates to the sampling rate?

  • Please show all work Fluids Continuity.QP.KC.1: At one point on the left-hand side of a flowing...

    Please show all work Fluids Continuity.QP.KC.1: At one point on the left-hand side of a flowing water pipe the radius of the pipe is 1 cm. At another point on the right-hand side, it has a radius 2.5 times larger. (a) If the pipe is setup so that each of these points have the same pressure, which end, left or right, is higher in elevation? Explain. (b) If the water flowing through it could fill a 1 liter bottle ina...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT