Purchase Solution

Outer and Inner Joins in Databases

Not what you're looking for?

Ask Custom Question

Use the attached WEEK2_ACCESS2000.mdb database

I just need the SQL code, which can be cut and pasted into a word document.

1. Perform an inner join between the BOOKS table and the ORDER_LINES table. Show the titles from the BOOK table and quantity column from the ORDER_LINES table
-------------------------------------------------------------------------------------------------------
2. Perform an inner join between tables CUSTOMERS and ORDERS (on the customer_numb column), joining on the customer_numb column. Find the customer first and last name where the order_date is between 11/1/1999 and 1/1/2000.

Order by the order_date.

NOTE: Don't forget to surround the dates with # signs. For example ...WHERE orders.order_date Between #11/1/1999# And #1/1/2000#

HINT: Basically, fill in the blanks below to answer the question.

SELECT ____, _____ (if you'd like, you can select more than just the customer first and last names)
FROM ________ INNER JOIN ___________ ON ____. ____ = ____. _____

WHERE _______ between ______ and _______

ORDER BY _____;

-------------------------------------------------------------------------------------------------------
3. Perform an inner join on tables BOOKS and SOURCES. Find the source cities for publisher_name "Random House" using the LIKE command to restrict record selection. I'm purposely not telling you which field to do the JOIN on, but its obviously got to be the same field in each table (there's only one field that meets that criteria. You can click on TOOLS and then RELATIONSHIPS in Access to get a visual look at how the two tables are related (the line connecting the tables shows how the primary and foreign key relate between the two tables & the columns that the line connects are obviously the columns you'd want to do your JOIN on)

------------------------------------------------------------------------------------------------------

4. Perform a Left Outer Join using tables BOOKS and ORDER_LINES. Show all the ISBNs in the BOOKS table and any associated ISBNs in the ORDER_LINES table.

------------------------------------------------------------------------------------------------------

5. Perform a Left Outer Join using tables BOOKS and ORDER_LINES. Show the titles from the BOOKS table that don't have ISBNs that appear in the ORDER_LINES table.
------------------------------------------------------------------------------------------------------
6. Perform a UNION of two tables, customers and sources, selecting customer_state and source_state into one column.

Purchase this Solution

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.