Relational Database Example in Access - Order System Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
Database Relationships in Access As you recall, the data in a database is stored in tables. In a relational database like Access, you can have multiple.
Advertisements

Relational Terminology. Normalization A method where data items are grouped together to better accommodate business changes Provides a method for representing.
Order Entry System Please use speaker notes for additional information!
The Relational Database Model:
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Project and Data Management Software
Interpreting SQL Code. SQL (The language used to query a database) S is used to specify the you want to include. F is used to specify the the selected.
Relational example using donor, contrib and drive tables Please use speaker notes for additional information!
Database Relationships Objective 5.01 Understand database tables used in business.
ITS232 Introduction To Database Management Systems Siti Nurbaya Ismail Faculty of Computer Science & Mathematics, Universiti Teknologi MARA (UiTM), Kedah.
The Relational Database Model
Working with Derby. RHS – Creating tables We know how to create a database in Derby – an empty database Next step is to add tables to the database.
CS&E 1111 AcInnerJoins Inner Joins Objectives: Creating Queries with data from Multiple Tables Joining two tables using an Inner Join Referential Data.
Access Primer UoN workshop Naivasha, 30 July – 4 August 2006.
Data-mining & Data As we used Excel that has capability to analyze data to find important information, the data-mining helps us to extract information.
2005 SPRING CSMUIntroduction to Information Management1 Organizing Data John Sum Institute of Technology Management National Chung Hsing University.
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
More on relational databases, including 1 to 1, 1 to many and many to many relationships Please use speaker notes for additional information!
Module III: The Normal Forms. Edgar F. Codd first proposed the process of normalization and what came to be known as the 1st normal form. The database.
Concepts of Relational Databases. Fundamental Concepts Relational data model – A data model representing data in the form of tables Relations – A 2-dimensional.
資料庫正規化 Database Normalization 取材自 AIS, 6 th edition By Gelinas et al.
Chapter 7 1 Database Principles Data Normalization Primarily a tool to validate and improve a logical design so that it satisfies certain constraints that.
GUS: 0262 Fundamentals of GIS Lecture Presentation 3: Relational Data Model Jeremy Mennis Department of Geography and Urban Studies Temple University.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
Applicants Please use speaker notes for additional information!
Relationships and Advanced Query Concepts Using Multiple Tables Please use speaker notes for additional information!
SQL Schemas DATA SCIENCE BOOTCAMP. Schema The structure of the database (relationships between tables)
DAY 12: DATABASE CONCEPT Tazin Afrin September 26,
More about Databases. Data Entry through Forms Table View (Data sheet view) is useful for data entry of new records But sometimes customization would.
1 Outline  What is a Primary Key?  AutoNumber primary keys  Single-field primary keys  Composite-field primary key  About Foreign Keys  Database.
Databases MIS 21. Some database terminology  Database: integrated collection of data  Database Management System (DBMS): environment that provides mechanisms.
Tutorial 9 Using Action Queries and Advanced Table Relationships.
Database Application Design and Data Integrity AIMS 3710 R. Nakatsu.
1 Chapter 6 Database Administration. 2 Introduction Database administration The process of managing a database Database administrator A person or an entire.
ITN Table Normalization1 ITN 170 MySQL Database Programming Lecture 3 :Database Analysis and Design (III) Normalization.
Exceptions in PL/SQL Please use speaker notes for additional information!
RDBMS MySQL. MySQL is a Relational Database Management System MySQL allows multiple tables to be related to each other. Similar to a Grandparent to a.
Multiple Table Queries 1: Inner Joins CS 320. Introduction: Join Queries Usually queries combine data from multiple tables:  List how much (pounds) of.
Quiz questions. 1 A data structure that is made up of fields and records? Table.
Lesson 2: Designing a Database and Creating Tables.
Advanced Data Modeling. Heterogeneous Mapping Heterogeneous Mapping is the ability of MSTR7 tools to join on unlike column names. Heterogeneous Mapping.
SqlExam1Review.ppt EXAM - 1. SQL stands for -- Structured Query Language Putting a manual database on a computer ensures? Data is more current Data is.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
Relational Database in Access Student System As always please use speaker notes!
Connecting (relating) Data Tables to get Custom Records (Queries) Database Basics.
Postgresql East Philadelphia, PA Databases – A Historical Perspective.
Alighieri: Introduction to MS Access 1 What is a Database? RELATIONAL DATABASE A database is an organized collection of information. A database is designed.
Logical Database Design and the Relational Model.
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 2.
Working with MySQL. SWC – Creating tables We know how to create a database in MySQL – an empty database Next step is to add tables to the database.
1 CPE 332 Introduction DBMS: Relational Database Managment Systems Instructor:Suthep Madarasmi, Ph.D. ดร. สุเทพ มาดารัศมี
Join Queries CS 146. Introduction: Join Queries  So far, our SELECT queries have retrieved data from a single table  Usually queries combine data from.
Teanna Clarke 6aQ What is a Entity-Relationship Diagram?  An Entity-Relationship Diagram (ERD) is a tool that graphically shows the connections among.
Data Resource Management Application Layer TPS A RCHITECTURE Data Layer Sales/MarketingHR Finance/Accounting Operations Spreadsheet Data MS Access Accounts.
Lecture 7 Data Model Implementation Dan Ames Hydroinformatics Fall 2013 This work was funded by National Science Foundation Grants EPS and EPS.
Database (Microsoft Access). Database A database is an organized collection of related data about a specific topic or purpose. Examples of databases include:
DAY 20: ACCESS CHAPTERS 5, 6, 7 Larry Reaves October 28,
IFS180 Intro. to Data Management Chapter 10 - Unions.
Database Relationships
Database Management Systems II
Database Management  .
Chapter 11 Database Design
Databases & Consistency
Looking at using multiple tables
This shows the tables that I made for the order system.
Database Relationships
Microsoft Access Date.
Course Instructor: Supriya Gupta Asstt. Prof
Presentation transcript:

Relational Database Example in Access - Order System Please use speaker notes for additional information!

The inventory table (inven) contains all information directly related to the items we carry. The primary key is itemno and all elements of the table relate directly to itemno. The department table (department) was created because it would not meet the rules of third normal form to carry the department name and manager on the inven table because they relate to the department number rather than to the itemno. The customer table (invcust) carries all information related to the customer. The primary key is custid. We could not carry the information about the sales representatives such as name and commission rate on this table because they relate to the sales representative number not to the custid. Therefore we created a new sales representative table (salesrep). Orders have header information that applies to the whole order and line item information that applies to the particular item that is being ordered. The relationship between the order header and the order line items is a one to many relationship. One order has many line items but each line item belongs to one order. Therefore this system has an order header table (orderz) that contains information about the order such as order number, customer number and the date of the order. It also has an order line item table (ordline) that contains the order number, the item number of the item being ordered and the number ordered. Because of the one to many relationship this table has a primary key consisting of the order number and the item number. Table design

Table: inven The ItemNo is the primary key for this table.

Table: invcust The Custid is the primary key for this table. Notice Indexed is Yes with no duplicates.

There is a one to many relationship between the order header table (orderz) and the order line item table (ordline). This means for every order there can be multiple line items, but for each line item there is only one order. I can find out the line items by going into the ordline table and retrieving all records that match the order number for a given order. Because there are multiple line items with the same order number, I have to use the combination or order number and item number to make a unique primary key. Tables: orderz & ordline Ordno is the primary key. Ordno and Itemno are the primary keys.

The primary key is Slsrep. Tables: Salesrep & Department The primary key is Dept.

Relationships

Query: Inven & Department SELECT Inven.ItemNo, Inven.ItemName, Inven.Dept, Department.Deptname, Department.Manager FROM Department INNER JOIN Inven ON Department.Dept = Inven.Dept; SELECT ItemNo, ItemName, Inven.Dept, Deptname, Manager FROM Inven, Department WHERE Department.Dept = Inven.Dept; Access SQL code. My SQL code. From inven. From department.

Queries: Orderz & Invcust SELECT Orderz.Ordno, Orderz.Custid, Invcust.Custname, Orderz.Ordate FROM Invcust INNER JOIN Orderz ON Invcust.Custid = Orderz.Custid; SELECT Ordno, Orderz.Custid, Custname, Ordate FROM Orderz, InvCust WHERE Invcust.Custid = Orderz.Custid; Access SQL code My SQL code Custname from Invcust table - the rest from Orderz table.

SELECT Orderz.Ordno, Orderz.Custid, Orderz.Ordate, Ordline.Itemno, Ordline.Numord FROM Orderz INNER JOIN Ordline ON Orderz.Ordno = Ordline.Ordno; SELECT Orderz.Ordno, Custid, Ordate, Itemno, Numord FROM Orderz, Ordline WHERE Orderz.Ordno = Ordline.Ordno; Query: Orderz & Ordline Access SQL code My SQL code From Orderz From ordline

SELECT Orderz.Ordno, Ordline.Itemno, Inven.ItemName, Ordline.Numord FROM Inven INNER JOIN (Orderz INNER JOIN Ordline ON Orderz.Ordno = Ordline.Ordno) ON Inven.ItemNo = Ordline.Itemno; Query: Orderz, Ordline, Inven SELECT Orderz.Ordno, Ordline.Itemno, Inven.ItemName, Ordline.Numord FROM Orderz, Ordline, Inven WHERE Orderz.Ordno = Ordline.Ordno AND Inven.ItemNo = Ordline.Itemno; Access SQL My SQL

Query on 4 tables SELECT Orderz.Ordno, Orderz.Custid, Invcust.Custname, Orderz.Ordate, Ordline.Itemno, Inven.ItemName, Ordline.Numord FROM (Invcust INNER JOIN Orderz ON Invcust.Custid = Orderz.Custid) INNER JOIN (Inven INNER JOIN Ordline ON Inven.ItemNo = Ordline.Itemno) ON Orderz.Ordno = Ordline.Ordno; SELECT Orderz.Ordno, Orderz.Custid, Custname, Ordate, Ordline.Itemno, ItemName, Numord FROM Invcust, Orderz, Ordline, Inven WHERE Invcust.Custid = Orderz.Custid AND Inven.ItemNo = Ordline.Itemno AND Orderz.Ordno = Ordline.Ordno; Access SQL My SQL