a guide to mysql. 2 objectives introduce premiere products, a company whose database is used as the...
TRANSCRIPT
![Page 1: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/1.jpg)
A Guide to MySQL
![Page 2: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/2.jpg)
A Guide to MySQL2
Objectives
• Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text
• Introduce Henry Books, a company whose database is used as a case that runs throughout the text
• Introduce Alexamara Marina Group, a company whose database is used as an additional case that runs throughout the text
• Introduce MySQL, a database management system
![Page 3: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/3.jpg)
A Guide to MySQL3
What Is a Database?
• Database: structure containing categories of information and relationships between these categories
• Examples of categories: sales reps, customers, orders, and parts
• Relationships between categories: sales rep to customer and customer to orders
![Page 4: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/4.jpg)
A Guide to MySQL4
The Premiere Products Database
• Premiere Products: distributor of appliances, house wares, and sporting goods
• Manual systems no longer suitable for managing customer, order, and inventory data
• Database management system will allow for current, accurate data and provide useful reports
![Page 5: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/5.jpg)
A Guide to MySQL5
Required Data for Sales Reps
• Number
• Last name
• First name
• Address
• Total commission
• Commission rate
![Page 6: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/6.jpg)
A Guide to MySQL6
Required Data for Customer
• Customer number
• Name
• Address
• Current balance
• Credit limit
• Sales rep number
![Page 7: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/7.jpg)
A Guide to MySQL7
Required Data for Parts
• Part number
• Description
• Number of units on hand
• Item class
• Number of the warehouse where item is stored
• Unit price for each part in inventory
![Page 8: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/8.jpg)
A Guide to MySQL8
![Page 9: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/9.jpg)
A Guide to MySQL9
Components of a Sample Order
• Heading (top): company name; order number and date; customer number, name, address; sales rep number and name
• Body (center): one or more order lines or line items
• Footer (bottom): order total
![Page 10: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/10.jpg)
A Guide to MySQL10
Components of a Line Item
• Part number
• Part description
• Number of units for part ordered
• Quoted price for part
• Total, or extension: result of multiplying the number ordered by the quoted price
![Page 11: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/11.jpg)
A Guide to MySQL11
Items Stored for Each Order
• Order number
• Date of the order
• Customer number
• Customer name, address and sales rep information are stored with customer information
• Sales rep name is stored with sales rep information
![Page 12: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/12.jpg)
A Guide to MySQL12
Items Stored for Each Order
• Order number, part number, number of units ordered, and quoted price
• Part description is stored with information about parts
• Order total is not stored but calculated each time order is displayed or printed
![Page 13: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/13.jpg)
A Guide to MySQL13
Sample Rep Table
![Page 14: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/14.jpg)
A Guide to MySQL14
Rep Table Example
• Three sales reps in the table identified by number
– Sales rep number: 20
– Name: Valerie Kaiser
– Address: 624 Randall St., Grove, FL, 33321
– Total commission: $20,542.50
– Commission rate: 5% (0.05)
![Page 15: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/15.jpg)
A Guide to MySQL15
Sample Customer Table
![Page 16: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/16.jpg)
A Guide to MySQL16
Customer Table Example
• Ten customers are identified by number
– Number: 148
– Name: Al’s Appliance and Sport
– Address: 2837 Greenway St., Fillmore, FL, 33336
– Current balance: $6,550.00
– Credit limit: $7,500.00
– Sales rep: 20 (Valerie Kaiser)
![Page 17: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/17.jpg)
A Guide to MySQL17
![Page 18: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/18.jpg)
A Guide to MySQL18
Part Table Example
• Ten parts are listed by part number
– Part number: AT94
– Description: Iron
– Units on hand: 50
– Item class: HW (house wares)
– Warehouse: 3
– Price: $24.95
![Page 19: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/19.jpg)
A Guide to MySQL19
Sample Order Table
![Page 20: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/20.jpg)
A Guide to MySQL20
Order Table Example
• Seven orders listed by order number
– Order number: 21608
– Order date: 10/20/2007
– Customer: 148 (Al’s Appliance and Sport)
![Page 21: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/21.jpg)
A Guide to MySQL21
Order_Line Table Example
• Nine order line items listed by order number
– Order number: 21608
– Part number: AT94 (iron)
– Number ordered: 11
– Quoted price: $21.95
![Page 22: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/22.jpg)
A Guide to MySQL22
![Page 23: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/23.jpg)
A Guide to MySQL23
Alternate Order Table Example
• Displays identical data in one table
• Each table row contains all order lines for each order
• Fifth row, order 21617 has two order lines:
– Part BV06, Qty 2, quoted price $794.95 each
– Part CD52, Qty 4, quoted price $150.00 each
![Page 24: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/24.jpg)
A Guide to MySQL24
Issues with Alternative Order Table
• Difficult to track information between columns
• Other issues:
– How much room is allowed for multiple entries?
– What if an order has more order lines than you have allowed room for?
– For a given part, how do you determine which orders contain order lines for that part?
![Page 25: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/25.jpg)
A Guide to MySQL25
Benefits of Order_Line Table
• Table is less complicated when separated
• No multiple entries
• Number of order lines is not limited
• Finding every order for a given part is simple
![Page 26: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/26.jpg)
A Guide to MySQL26
Henry Books Database
• Ray Henry owns Henry Books, a bookstore chain
• Data is to be stored in a database
• Needs forms and reports to work with the data
• In running chain of bookstores, gathers variety of information on branches, publishers, authors, books
![Page 27: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/27.jpg)
A Guide to MySQL27
Data for Branch Table
• Number
• Name
• Location
• Number of employees
![Page 28: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/28.jpg)
A Guide to MySQL28
Data for Publisher Table
• Publisher code
• Publisher name
• City
![Page 29: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/29.jpg)
A Guide to MySQL29
![Page 30: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/30.jpg)
A Guide to MySQL30
Data for Author Table
• Author number
• Last name
• First name
![Page 31: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/31.jpg)
A Guide to MySQL31
Data for Book Table
• Book code
• Title
• Publisher code
• Type of book
• Price
• Is it a paperback?
![Page 32: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/32.jpg)
A Guide to MySQL32
![Page 33: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/33.jpg)
A Guide to MySQL33
Data for Wrote Table
• Book code
• Author number
• Sequence (for books with multiple authors)
![Page 34: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/34.jpg)
A Guide to MySQL34
Data for Inventory Table
• Book code
• Branch number
• Quantity on hand
![Page 35: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/35.jpg)
A Guide to MySQL35
![Page 36: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/36.jpg)
A Guide to MySQL36
The Alexamara Marina Group Database
• Alexamara Marina Group offers in-water storage to boat owners
• Owns two marinas: East and Central
• Provides boat repair and maintenance services
• Uses database to store information for managing operations
![Page 37: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/37.jpg)
A Guide to MySQL37
Data for Marina Table
• Marina number
• Name
• Full address (street; city; state; zip code)
![Page 38: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/38.jpg)
A Guide to MySQL38
Data for Owner Table
• Owner number
• Last name
• First name
• Full address (street; city; state; zip code)
![Page 39: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/39.jpg)
A Guide to MySQL39
Data for Marina_Slip Table
• Slip ID, marina number, slip number
• Length
• Rental fee
• Boat name and boat type
• Owner number
![Page 40: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/40.jpg)
A Guide to MySQL40
![Page 41: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/41.jpg)
A Guide to MySQL41
Service Data
• Maintenance service category information is stored in the SERVICE_CATEGORY table
• Information on the services requested is stored in the SERVICE_REQUEST table
• SERVICE_REQUEST stores service category, slip information, description and status, estimated hours, hours spent, and next service date
![Page 42: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/42.jpg)
A Guide to MySQL42
![Page 43: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/43.jpg)
A Guide to MySQL43
MySQL
• Database management system (DBMS) is software that lets you:– Create a database
– Add, change, delete, sort, and view the data in a database
• Created in 1990s in Sweden• Open source software: software whose source code
is freely and publicly available
![Page 44: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/44.jpg)
A Guide to MySQL44
MySQL (continued)
• SQL (Structured Query Language): language for manipulating and retrieving database data
• Version 4.1 used in text• Windows XP operating system• http://www.mysql.com for information• http://dev.mysql.com/downloads/ for downloads
![Page 45: A Guide to MySQL. 2 Objectives Introduce Premiere Products, a company whose database is used as the basis for many of the examples throughout the text](https://reader035.vdocuments.mx/reader035/viewer/2022062422/56649f055503460f94c1ab9f/html5/thumbnails/45.jpg)
A Guide to MySQL45
Summary• Premiere Products: requires sales rep, customer,
parts, orders and order lines
• Henry Books: requires branch, publisher, author, book, and inventory
• Alexamara Marina Group: requires marina, owners, slips, service categories and service requests
• MySQL: an open-source DBMS