Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to MIS1 Copyright © 1998-2002 by Jerry Post Introduction to MIS Chapter 6 Database Management Systems.

Similar presentations


Presentation on theme: "Introduction to MIS1 Copyright © 1998-2002 by Jerry Post Introduction to MIS Chapter 6 Database Management Systems."— Presentation transcript:

1 Introduction to MIS1 Copyright © by Jerry Post Introduction to MIS Chapter 6 Database Management Systems

2 Introduction to MIS2 Database Management Systems Database DBMS Programs Sales and transaction data Reports and ad hoc queries

3 Introduction to MIS3 Outline Relational Databases Queries Designing a Database Database Applications Database Administration Database and e-Business Cases: Airlines Appendix: Building Forms in Access

4 Introduction to MIS4 DBMS & People Data Database Management System Program Business Operations Ad Hoc Queries and Reports Programmer Analyst Database Administrator Business Needs Programs & Revisions Managers (Standards, Design, and Control) Data Collection and Transaction Processing

5 Introduction to MIS5 PhoneNameAddressCity Jones123 MainChicago Smith456 OakGlasgow Juarez887 RiberaPhoenix Olsen465 ThorMinneapolis Customer Table CustomerDateSalespersonTotal_sale /3/ /4/ /9/ /7/ Orders Table Relational Databases Tables Rows Columns Primary keys Data types Text Dates & times Numbers Objects

6 Introduction to MIS6 Invoice Program Billing Program file 1 customers file A file B Programming Approach Problems with Programming Data and programs Undocumented files Files & many programs Multiuser Changes

7 Introduction to MIS7 All Data Files Database Management System Invoice Program Billing Program Database Advantages Focus on data Stable data Programs change. Data independence Change programs without altering data. Data integrity Accuracy. Time. Concurrency. Security. Ad hoc queries Speed of development Report writers. Input forms. Data manipulation. Flexibility & Queries

8 Introduction to MIS8 1) What output do you want to see? 2) What tables are involved? 3) What do you already know? (constraints) 4) How are the tables joined? Four questions to create a query Database Queries Single Table Computations Joining Tables

9 Introduction to MIS9 Single Table Query Introduction CIDNamePhoneCityAccountBalance 28764Adamz Phoenix James Miami Kolke Denver Smitz Seattle Sample Data Access Query Screen (QBE) Query: Which customers have balances greater than $200? File: C05E15a.mdb

10 Introduction to MIS10 AND Conditions and Sorting Sample Data Access Query Screen (QBE) Query: Which Denver customers have balances greater than $200? CIDNamePhoneCityAccountBalance 28764Adamz Phoenix James Miami Kolke Denver Smitz Seattle353.76

11 Introduction to MIS11 SQL Introduction Query: Which customers have balances greater than $200? SQL:SELECTCID, Name, Phone, City, AccountBalance FROMCustomers WHEREAccountBalance > 200 ; Query: Which Denver customers have balances greater than $200? SQL:SELECTCID, City, AccountBalancel FROMCustomers WHEREAccountBalance > 200 and City = Denver ORDER BY Name ASC ; CIDNamePhoneCityAccountBalance 28764Adamz Phoenix James Miami Kolke Denver Smitz Seattle353.76

12 Introduction to MIS12 Useful WHERE Conditions Comparisons, <>, BETWEEN Numbers AccountBalance > 200 Text Common Name > Jones LIKE Match all Name LIKE J* Match one Name LIKE ?m* DatesOdate between #8/15/95# and #8/31/95# Missing dataCity is NULL NOTName is NOT NULL Use with QBE or SQL

13 Introduction to MIS13 SQL General Form SELECTcolumns FROMtables JOINlink columns WHEREconditions GROUP BYcolumn ORDER BYcolumn (ASC | DESC)

14 Introduction to MIS14 Computations Sum Avg Min Max Count StDev Var QBE SELECTCount(C#), AVG(AccountBalance) FROMCustomers ; SQL

15 Introduction to MIS15 Groups or Subtotals QBE SELECTCity, AVG(AccountBalance) FROMCustomers GROUP BYCity ; SQL CityAVG(AccountBalance) Chicago Denver Miami Phoenix Seattle Sample Output

16 Introduction to MIS16 Groups with Conditions Query: What is the average account balance for customers from Denver?

17 Introduction to MIS17 Multiple Tables CIDNamePhoneCityAccountBalance 12345Jones Chicago$ Adams Phoenix$ Smitz Seattle$ Kolke Denver$ James Miami$ Customers SIDNameDateHiredPhoneCommission 225West5/23/ Zeke8/15/ Jabbar7/15/ Bird9/12/ Johnson2/2/ ItemIDDescriptionPrice 1154Corn Broom$ Blue Jeans$ Paper Towels--3 rolls$ Laundry Detergent$ Men's Boots$ Candy Popcorn$0.50 OrderIDCIDSIDOdateAmount /3/2004$ /4/2004$ /9/2004$ /5/2004$ /1/2004$ /8/2004$ /28/2004$ /9/2004$ /9/2004$ /9/2004$ /27/2004$ OIDItemIDQuantity Salespeople Items Orders ItemsSold

18 Introduction to MIS18 Linking Tables The Orders to ItemsSold relationship enforces referential integrity. One Order can list many ItemsSold.

19 Introduction to MIS19 Query Example Which customers (CID) have placed orders since June 1, 2004? QBE SELECTCID, ODate FROMOrders WHEREOdate >= #6/1/2004# ; SQL Results CIDODate /9/ /9/ /27/2004

20 Introduction to MIS20 Query Example What are the names of the customers who placed orders since June 1, 2004? QBE SELECTDISTINCT Name, Odate FROMOrders INNER JOIN Customers ON Orders.CID = Customers.CID WHEREOdate >= #6/1/2004# ; SQL Results NameOdate Adamz6/27/2004 James6/9/2004 Kolke6/9/2004

21 Introduction to MIS21 QBE SELECTDISTINCT Salespeople.Name, Customers.Name FROMSalespeople INNER JOIN (Customers INNER JOIN Orders ON Customers.CID=Orders.CID) ON Salespeople.SID = Orders.SID ORDER BY Salespeople.Name ; SQL Results SalesName Cust.Name BirdAdamz BirdJames BirdKolke JabbarJones JabbarSmitz JohnsonJames JohnsonJones WestKolke WestSmitz Query Example List the salespeople (sorted alphabetically) along with the names of customers who placed orders with that salesperson.

22 Introduction to MIS22 Aggregation Query What is the total amount of orders placed from customers who live in Miami? QBE SELECTSUM(Amount) FROMOrders INNER JOIN Customers ON Orders.CID = Customers.CID WHERECity = Miami ; SQL Results $2,418.84

23 Introduction to MIS23 Database Design Primary keys One value per cell Column depends on whole key and nothing but the key. Customers CIDnamecityhomebusinessfaxservice 11JonesChicago SmithChicago JamesChicago RicciChicago CIDnamecity 11JonesChicago 22SmithChicago 33JamesChicago 44RicciChicago Customers(CID, name, city) CIDphone_typenumber 11home business fax service home service home fax Phones(CID, phone_type, number)

24 Introduction to MIS24 Database Design: Normalization File: C05Vid.mdb

25 Introduction to MIS25 Notation Table name Primary key is underlined Table columns Customer (CustomerID, Phone, Name, Address, City, State, ZipCode) CustomerIDPhoneLastNameFirstNameAddressCityStateZipCode JohnsonMartha125 Main StreetAlvatonKY SmithJack873 Elm StreetBowling GreenKY WashingtonElroy95 Easy StreetSmith's GroveKY AdamsSamuel746 Brown DriveAlvatonKY RabitzVictor645 White AvenueBowling GreenKY SteinmetzSusan15 Speedway DrivePortlandTN LasaterLes67 S. Ray DrivePortlandTN JonesCharlie867 Lakeside DriveCastalian SpringsTN ChavezJuan673 Industry Blvd.CaneyvilleKY RojoMaria88 Main StreetCave CityKY42127

26 Introduction to MIS26 1st: Repeating RentalForm(TransID, RentDate, CustomerID, Phone, Name, Address, City, State, ZipCode, (VideoID, Copy#, Title, Rent ) ) Repeating Section Causes duplication TransIDRentDateCustomerIDLastNamePhoneAddressVideoIDCopy#TitleRent 14/18/043Washington Easy Street122001: A Space Odyssey$ /18/04 3Washington Easy Street63Clockwork Orange$ /30/047Lasater S. Ray Drive81Hopscotch$ /30/047Lasater S. Ray Drive21Apocalypse Now$ /30/047Lasater S. Ray Drive61Clockwork Orange$ /18/048Jones Lakeside Drive91Luggage Of The Gods$ /18/04 8Jones Lakeside Drive151Fabulous Baker Boys$ /18/04 8Jones Lakeside Drive41Boy And His Dog$ /18/043Washington Easy Street31Blues Brothers$ /18/04 3Washington Easy Street81Hopscotch$ /18/04 3Washington Easy Street131Surf Nazis Must Die$ /18/043Washington Easy Street171Witches of Eastwick$2.00

27 Introduction to MIS27 First Normal Customer Rentals Name Phone Address City State ZipCode VideoIDCopy#TitleRent 1. 61Clockwork Orange Hopscotch {Unused Space} Not in First Normal Form

28 Introduction to MIS28 1st: Split RentalForm(TransID, RentDate, CustomerID, Phone, Name, Address, City, State, ZipCode, (VideoID, Copy#, Title, Rent ) ) RentalForm2(TransID, RentDate, CustomerID, Phone, Name, Address, City, State, ZipCode) RentalLine(TransID, VideoID, Copy#, Title, Rent ) TransIDRentDateCustomerIDPhoneLastNameFirstNameAddressCityStateZipCode 14/18/ WashingtonElroy95 Easy StreetSmith's GroveKY /30/ LasaterLes67 S. Ray DrivePortlandTN /18/ JonesCharlie867 Lakeside DriveCastalian SpringsTN /18/ WashingtonElroy95 Easy StreetSmith's GroveKY42171 RentalForm2 TransIDVideoIDCopy#TitleRent : A Space Odyssey$ Clockwork Orange$ Hopscotch$ Apocalypse Now$ Clockwork Orange$ Luggage Of The Gods$ Fabulous Baker Boys$ Boy And His Dog$ Blues Brothers$ Hopscotch$ Surf Nazis Must Die$ Witches of Eastwick$2.00 RentalLine Note: replication

29 Introduction to MIS29 2nd Split RentalLine(TransID, VideoID, Copy#, Title, Rent ) VideosRented(TransID, VideoID, Copy# )Videos(VideoID, Title, Rent ) TransIDVideoIDCopy# VideoIDTitleRent 12001: A Space Odyssey$1.50 2Apocalypse Now$2.00 3Blues Brothers$2.00 4Boy And His Dog$2.50 5Brother From Another Planet$2.00 6Clockwork Orange$1.50 7Gods Must Be Crazy$2.00 8Hopscotch$1.50 Column depends on entire (whole) key.

30 Introduction to MIS30 3rd Split RentalForm2(TransID, RentDate, CustomerID, Phone, Name, Address, City, State, ZipCode ) Rentals(TransID, RentDate, CustomerID ) Customers(CustomerID, Phone, Name, Address, City, State, ZipCode ) TransIDRentDateCustomerID 14/18/ /30/ /18/048 44/18/043 CustomerIDPhoneLastNameFirstNameAddressCityStateZipCode JohnsonMartha125 Main StreetAlvatonKY SmithJack873 Elm StreetBowling GreenKY WashingtonElroy95 Easy StreetSmith's GroveKY AdamsSamuel746 Brown DriveAlvatonKY RabitzVictor645 White AvenueBowling GreenKY SteinmetzSusan15 Speedway DrivePortlandTN LasaterLes67 S. Ray DrivePortlandTN JonesCharlie867 Lakeside DriveCastalian SpringsTN ChavezJuan673 Industry Blvd.CaneyvilleKY RojoMaria88 Main StreetCave CityKY42127 Rentals Customers

31 Introduction to MIS31 3NF Tables

32 Introduction to MIS32 DBMS Input Screen Text/LabelsData Variables Scrolling Region/Subform Command Buttons Record Selectors - Subform - Main

33 Introduction to MIS33 DBMS Report Writer Report header Page header Break/Group header Detail Footers

34 Introduction to MIS34 Sample Report with Groups

35 Introduction to MIS35 Designing Menus for Users 1. Setup Choices 2. Data Input 3. Print Reports 4. DOS Utilities 5. Backups Main Menu Daily Sales Reports Friday Sales Meeting Monthly Customer Letters Quit Customer Information As a secretary, which menu is easier to understand?

36 Introduction to MIS36 Database Administration Database Administrator Testing Backup Recovery Standards Access Controls

37 Introduction to MIS37 Tables Customers(C#, Name,Address) Products(P#, Description, Price) Sales(O#, P#, Sdate, Quantity, C#) Part 1 Sales C# P# Q Price Price*Q SubTotal Part 2 Products P# DescriptionPrices 18shorts shirt laces4.75 Part 3 Customers C# Name 11Smith 31Torrez Retrieve the three tables (if they fit). 1) Select by date 2) Sort By O#, P# 3) Look up prices 4) Put into Part 1 5) Calculate total 6) Sort for highest total 7) Look up names Database versus Spreadsheet

38 Introduction to MIS38 u Storage v calculation u Multiple tables DBMS SELECT Sum(Price*Quantity), C#,Name FROM Customers INNER JOIN (Sales INNER JOIN Products ON Sales.P# = Products.P#) ON Customers.C# = Sales.C# WHERE Sdate > Now() - 30 GROUP BY C# ORDER BY Sum(Price*Quantity) DESC; DBMS versus Spreadsheet

39 Introduction to MIS39 Objects Hypertext & Massive text Pictures & Graphs Objects Video Sound User defined

40 Introduction to MIS40 Sample OO Database Patient X-Rays/ImagesID Date Technician Comments Patient DataID NameAddressDoB Medical History photo Patient Visits IDDate Physician ProblemsComments Patient Treatments ID Date Procedure Doctor

41 Introduction to MIS41 E-Business Databases E-business is transaction-based Databases support multiple users and protect transactions Modern websites are driven by databases

42 Introduction to MIS42 E-Business Databases Internet Customer Web Server Web program script Text <% Database connection %> Order Form Descriptions Prices Page request Queries and data Web page

43 Introduction to MIS43 Cases: Airlines

44 Introduction to MIS44 Cases: American Airlines Southwest Airlines What is the companys current status? What is the Internet strategy? How does the company use information technology? What are the prospects for the industry?

45 Introduction to MIS45 Appendix: Building Forms in Access Begin with the form wizard. Select everything from the Sale table.

46 Introduction to MIS46 Selecting Columns Select additional data from the other tables. But be careful with key columns. For example, do not include the CustomerID from the Customer table or the ItemID from the Item table. Instead, use CustomerID from the Sale table and ItemID from the SaleItem table.

47 Introduction to MIS47 Form Wizard: First Pass The wizard builds the Sale form with a sub form to enter multiple Items being sold. But it needs some work with layout.

48 Introduction to MIS48 Form Design View In design view, you can move the labels and boxes to make the form easier to read. Then, delete the original CustomerID box and use the wizard to add a Combo box to let users select a customer from a list. 1.Lookup values 2.Customer table 3.CustomerID, LastName, FirstName, Phone 4.Store value in: CustomerID

49 Introduction to MIS49 Form Design: Sub Form and SubTotal Edit the subform and add a Combo box for ItemID. Delete the Description box. Add an ItemValue text box to multiply Quantity * List Price. Add a text box to compute the subtotal [=Sum([Quantity]*[ListPrice])]. Be sure to set the correct names and formats in the property window.

50 Introduction to MIS50 Sale Form The final sale form adds a text box that copies the subtotal from the sub form to the main form. Just add a text box and set its value to =[SaleItem Subform].[Form].[SubTotal] and set its name and format properties.


Download ppt "Introduction to MIS1 Copyright © 1998-2002 by Jerry Post Introduction to MIS Chapter 6 Database Management Systems."

Similar presentations


Ads by Google