Inner Join vs. Outer Join

Slides:



Advertisements
Similar presentations
Topic: Sales Tax and 1099 Reporting
Advertisements

Information Retrieval from Relational Databases
The Sales/Collection Business Process Accounts Receivable Query Join & Null to Zero (NZ) considerations 1.
Costpoint Credit Card Training Log In
Chapter 6 UNDERSTANDING AND DESIGNING QUERIES AND REPORTS.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Chapter Information Systems Database Management.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
Table design screen Field name Data type Field size Other properties.
Accounting Interface:
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Setting Up the INVENTORY & SERVICES Module Slideshow 8 A.
Welcome to... A Game of X’s and O’s. Rules Only one person is asked and can answer NO NOTES Go around the room in order 3 in a row wins the game If no.
© 2014 Cengage Learning. All Rights Reserved. Learning Objectives © 2014 Cengage Learning. All Rights Reserved. LO4Record cash and credit card sales using.
CORE 2: Information systems and Databases STORAGE & RETRIEVAL 2 : SEARCHING, SELECTING & SORTING.
Virtual Enterprises, International 1 ACCOUNTING DEPARTMENT WORKFLOW VIRTUAL ENTERPRISES, INTERNATIONAL.
© 2014 Cengage Learning. All Rights Reserved. Do Now: ●Where do you get new shoes? ●Have you ever had to wait for a size you need to be brought out to.
©2008 TTW Where “Lean” principles are considered common sense and are implemented with a passion! Product Training Cash and Cash Management.
CENTURY 21 ACCOUNTING © Thomson/South-Western LESSON 10-2 Journalizing Cash Receipts Using a Cash Receipts Journal Original created by M.C. McLaughlin,
Concepts of Database Management, Fifth Edition
SQL 資料庫查詢語言 取材自 EIS, 3 rd edition By Dunn et al..
CSC 240 (Blum)1 Joins. CSC 240 (Blum)2 Relational algebra Recall relational algebra was the study of actions that are performed on one or more tables.
2013.  Modify QuickBooks Preferences  Customize QuickBooks Menus and Windows  Customize the Icon Bar and Display Settings  Use the Item List and Other.
Access Queries Office 2013/ Queries Most common type of Query is selection(projection) Specify sources for data retrieval table(s) and/or query(ies)
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Analyzing Data For Effective Decision Making Chapter 3.
Chapter 9 Joining Data from Multiple Tables
CENTURY 21 ACCOUNTING © 2009 South-Western, Cengage Learning LESSON 10-2 Journalizing Cash Receipts Using a Cash Receipts Journal.
Concepts of Database Management Seventh Edition
© 2014 Cengage Learning. All Rights Reserved. Learning Objectives © 2014 Cengage Learning. All Rights Reserved. LO4Record cash and credit card sales using.
People © 2013 The Sleeter Group All rights reserved. Intuit, the Intuit logo and QuickBooks, among others, are registered trademarks of Intuit Inc. Other.
Using Special Operators (LIKE and IN)
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
COMPREHENSIVE Access Tutorial 3 Maintaining and Querying a Database.
Premium 2011 Setting Up the INVENTORY & SERVICES Module.
Premium 2011 Processing Transactions in the DIVISION (Project) Module.
Learning Objectives © 2015 Cengage Learning. All Rights Reserved. LO4 Explain the impact of sales discounts on the collection of accounts receivable. LO5.
1 2 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 2 The Relational Model 1: Introduction, QBE, and Relational Algebra.
(SQL - Structured Query Language)
PeopleSoft Financials Advanced Query Training Financial Information Systems and Reporting Controller’s Division
Lecture Access – Queries. What’s a Query? A question you ask a database –ie: “Who are my Stockton customers?” –ie: “How much did Bob sell on the 14th?”
QUERY CONSTRUCTION CS1100: Data, Databases, and Queries CS1100Microsoft Access1.
7 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel 7.6 Advanced Select Queries SQL provides useful functions that.
Chapter 10 JOURNALIZE SALE SAND CASH RECEIPTS USING SPECIAL JOURNALS.
Managing Revenue Chapter 2. PAGE REF #CHAPTER 2: Managing Revenue SLIDE # 2 Objectives Set up customer records in the Customer:Job list Record Sales Receipts.
Chapter 2 Page ref. Chapter 2 Managing Revenue 31.
0 Glencoe Accounting Unit 4 Chapter 17 Copyright © by The McGraw-Hill Companies, Inc. All rights reserved. Unit 4 The Accounting Cycle for a Merchandising.
© 2014 Cengage Learning. All Rights Reserved. Learning Targets © 2014 Cengage Learning. All Rights Reserved. Lesson 10-1 Accounting for Sales on Account.
Reports. Reports display information retrieved from a database in an attractive printed format. Reports can be created directly from tables, but More.
Sales Tax Chapter 4. PAGE REF #CHAPTER 4: Sales Tax SLIDE # 2 2 Objectives Activate and Set Sales Tax Preferences Use Sales Tax Items on Sales Forms Set.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Reports and Graphs Chapter 5. PAGE REF #CHAPTER 5: Reports and Graphs SLIDE # 2 Objectives Describe several types of QuickBooks reports Set QuickBooks.
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
© 2014 Cengage Learning. All Rights Reserved. Learning Objectives © 2014 Cengage Learning. All Rights Reserved. LO1 Explain the relationship between the.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Accounting for sales and cash receipts
DATABASE CONCEPTS A database is a collection of logically related data designed to meet the information needs of one or more users Data bases are store-houses.
Review of Main Database Features
© 2014 Cengage Learning. All Rights Reserved.
© 2014 Cengage Learning. All Rights Reserved.
© 2014 Cengage Learning. All Rights Reserved.
Joins CSC 240 (Blum).
Cash and Cash Management
© 2014 Cengage Learning. All Rights Reserved.
LESSON 10-3 Accounting for Cash and Credit Card Sales
Views for Excel and Reporting
Presentation transcript:

Inner Join vs. Outer Join Information Retrieval from Relational Databases

Query Languages Relational Algebra Structured Query Language (SQL) Three main operators: Select, Project, Join Provides the conceptual basis for SQL and QBE Structured Query Language (SQL) The user enters commands according to a pre-defined syntax to retrieve desired data. Query By Example (QBE) The user starts with a sample of the table(s) columns and marks the fields he or she wants to include in the answer. Defaults are available for summarizing and manipulating the data.

SQL (Structured Query Language) Each query statement follows the same structure: SELECT attribute name(s) FROM table name(s) WHERE criteria is met;

Relational Algebra Select Project Join includes only certain rows from a database table in its “answer”. Project includes only certain columns from a database table in its “answer” Join combines two or more database tables on the basis of one or more common attributes

Join Types Inner join(default in access) Outer join includes only the records from both tables that have the exact same values in the fields that are joined I.e., Outer join includes all records from one table, and matches those records from the other table for which values in the joined fields are equal Left Outer Join Right Outer Join

Example Tables

Relationship View

Query to List ALL Employees and Description of any Training Courses Taken ( Inner Join)

Note: We have 6 employees Example Tables Note: We have 6 employees

Does this This Give Us What we Need? The above based upon the default join which is the inner join and will not give us employees that have not taken training classes SQL code created by access for QBE on previous slide

Using Outer Joins Note change

SQL code created by access for QBE on previous slide

The Revenue Cycle of M&M M&M sells its agleclaps to customers through a network of company salespeople. Each type of agleclap is bought from a particular vendor and is given an initial list price. Each salesperson services a separate group of customers and is allowed to offer them various discounts from list to induce sales. Each sale can include one or more types of agleclaps and can be paid for in any one of three ways: (1) immediately in cash, (2) on the 15th of the following month, or (3) over the course of six months. When cash is received, a cashier deposits it into a company bank account. Sales are signaled by invoices; cash receipts by remittance advices

Relationship View

Example Tables (Incomplete Enterprise Database) from Dunn & McCarthy (2004) working paper

SQL and Relational Algebra Inner Join vs. Outer Join Find all details of all sales and the cash receipt number and amount applied of any cash receipts related to those sales Data we need for this example is in 2 tables Summary sales totals have been stored in sales table If summary figure not stored, you would need also need the sale-inventory relationship table to calculate sales totals Note: there have been no cash receipts related to sales transaction 6 & 7. We examine here the same example for which we previously needed a Left Outer Join of Sale and Sale-CashRecDuality. The equivalent SQL statement and query result are shown. Notice that the Left Outer Join is accomplished in the FROM and WHERE clauses of the SQL statement.

Relational Algebra Inner Join in QBE Details of all sales, related cash receipts

Relational Algebra Inner Join in QBE Details of all sales, related cash receipts

Default join is inner Join If you double click on the join you will see the join properties box. Item 1, the inner join is the default

Inner Join Results Sales transactions 6 & 7 are not listed since there was no cash receipts associated with them. Does this create a potential problem?? SELECT Sale.SaleNumber, Sale.Amount, Sale.Date, Sale.CustomerNumber, [Sale-CashRecDuality].RemittanceAdviceNumber, [Sale-CashRecDuality].Applied FROM Sale INNER JOIN [Sale-CashRecDuality] ON Sale.SaleNumber = [Sale-CashRecDuality].SaleNumber;

Relational Algebra Outer Join in QBE Details of all sales, related cash receipts Double-click on the join line

Relational Algebra Outer Join in QBE Details of all sales, related cash receipts Click on appropriate join type Click OK

Relational Algebra Outer Join in QBE Details of all sales, related cash receipts Note change in Join line

Relational Algebra Outer Join in QBE Details of all sales, related cash receipts Result

Joins Compared Outer Join Inner Join