Presentation is loading. Please wait.

Presentation is loading. Please wait.

CST-133 DataBase Labs Access DataBase Labs -- Muggwump Fish Farm Click your left mouse button to proceed... © Delta College CST Faculty.

Similar presentations


Presentation on theme: "CST-133 DataBase Labs Access DataBase Labs -- Muggwump Fish Farm Click your left mouse button to proceed... © Delta College CST Faculty."— Presentation transcript:

1

2 CST-133 DataBase Labs Access DataBase Labs -- Muggwump Fish Farm Click your left mouse button to proceed... © Delta College CST Faculty

3 CST-133 DataBase Labs The Muggwump Fish Farm DataBase needs to keep track of... Fish they sell –Fish Master Muggwump DataBase Customers they sell to –Customer Master Orders for Fish from Customers –Orders Data File Click your left mouse button to proceed...

4 CST-133 DataBase Labs Data Structures Each DataBase File has a name –E.G. Fish Master Each DataBase File is controlled by a Key –E.G. M Fish No Each Record is made up of Fields –E.G. Fish Description All names must be spelled exactly as shown –Capital letters where shown –Spaces where shown Click your left mouse button to proceed... OrdersFish Customer Vendors Employee Boats

5 CST-133 DataBase Labs I need customer number 40 The Key Uniquely identifies each record of a database –Cannot be duplicated –Keeps records in sequence Can be used to “find” a given record It’s the “Key” to accessing a record Muggwump DataBase Click your left mouse button to proceed...

6 CST-133 DataBase Labs Fish Master Key: M Fish No –4 Characters –E.G. CR1 –E.G. XY1 Other Fields: –Fish DescriptionQuan On HandMemo –Cost PriceWt at Maturity –Salt or FreshPicture Click your left mouse button to proceed... You can find me here!

7 CST-133 DataBase Labs Customer Master Other Fields: –C First NameCityBalance –C Last NameStateCredit Limit –StreetZipMemo Click your left mouse button to proceed... Key: C Cust No –4 Characters –E.G. 20 –E.G. 30

8 CST-133 DataBase Labs –Ship Date –Quan Pur –O Cust No Orders Data File: Key: Order No –4 Characters –E.G. F14 –E.G. F15 Click your left mouse button to proceed... What Fish was ordered? by this Customer? How many? When? Other Fields: –O Fish No 3 Carp 7/04 Muggwump J. Doe

9 CST-133 DataBase Labs Orders Data File Then we can get more info about: –The Fish From the Fish Master (e.g. Fish Description) –The Customer From the Customer Master (e.g. Customer Name) Click your left mouse button to proceed... The Order can lead us to information about: –The Fish Using O Fish No –The Customer Using O Cust No 3 Carp 7/04 Muggwump J. Doe

10 CST-133 DataBase Labs Click your left mouse button to proceed... Relational DataBase -- Tables We start with three tables already defined 1Fish Master 2Customer Master 3Orders We will add records to these tables We will change records in these tables We will ask questions -- queries We will create reports

11 CST-133 DataBase Labs Click your left mouse button to proceed... Query a DataBase Management System Ask a question of the DBMS The DBMS returns information Carp?

12 CST-133 DataBase Labs Click your left mouse button to proceed... QBE -- Query By Example Suppose we want the First and Last Name of a Customer and their City. Select the table that stores that information. a)The Table is Customer Master b)The First Name Field is C First Name c)The Last Name Field is C Last Name d)The City Field is City

13 CST-133 DataBase Labs Click your left mouse button to proceed... Query: First & Last Names and City 1.Construct the Query --- Choose the Table: Customer Master

14 CST-133 DataBase Labs Click your left mouse button to proceed... Query: First & Last Names and City 2.The Fields of the Customer Master are listed a)Select C First Name b)Select C Last Name c)Select City Get a Check Mark in the Show Box

15 CST-133 DataBase Labs Click your left mouse button to proceed... Query: First & Last Names and City 3.Run the Query  Click the Exclamation Point Button  Results are in Answer Window !

16 CST-133 DataBase Labs Click your left mouse button to proceed... Query: First & Last Names and City: City is Hollywood 4.Can Supply Criteria  Click in Criteria Cell – Key your Criteria  Click the Exclamation Point Button  New Results are in Answer Window We asked for anyone living in Hollywood so we got Whoopi’s data !

17 CST-133 DataBase Labs Click your left mouse button to proceed... Criteria Key data you want to match –e.g. a specific City (Hollywood) –e.g. a specific fish Description (Carp) –e.g. a specific C First Name (Whoopi) –e.g. >500 (Credit Limit Greater Than 500) –e.g. <21 (Quan Pur Less Than 21) –e.g. a specific Zip code (48710)

18 CST-133 DataBase Labs A Problem: Muggwump Fish Farm is out of Carp!... We need to inform our customers! Click your left mouse button to proceed...

19 CST-133 DataBase Labs Click your left mouse button to proceed... We Know Fish Description -- We Need Customer Name and Address We know the Fish Description: Carp Leads to Fish Number in Fish Master: M Fish No Leads to orders for this fish in Orders: O Fish No Orders has Customer Number: O Cust No Customer Master has Customer Name and Address Leads to Customer in Customer Master: C Cust No

20 CST-133 DataBase Labs ! Find the Fish Number for “Carp”... 1. We know the Fish Description -- we need the Fish Number 3. Supply the Fish Description: Carp Click your left mouse button to proceed... 2. For the query, select the fields for Fish Number and Description 5. Query results are in the new window - - - The Fish Number for “Carp” is “CR1” Query the Fish Master 4. Click the Run Query Icon -- the Exclamation Point! ! Carp

21 CST-133 DataBase Labs Find the order(s) for “CR1”(Carp)... 1. We know the Fish Number -- we need the orders for CR1 3. Supply the Fish Number: CR1 Click your left mouse button to proceed... 2. Query: Select Order #, Fish #, and Customer # 5. Query results are in the new window - - - There is one order with the Order Number “F14” and the Customer Number “20” Query the Orders File ! 4. Click the Run Query Icon -- the Exclamation Point! ! CR1

22 CST-133 DataBase Labs Query the Customer Master Find Customer “20”... 1. We know the Customer # -- we need the Name & Address for “20” 3. Supply the Customer Number: 20 Click your left mouse button to proceed... 2. Query: Select Customer #, First & Last Name, Address 5. Query results are in the new window - - - Customer #20 is Whoopi Goldberg who lives in Hollywood on Nun Such St. ! 4. Click the Run Query Icon -- the Exclamation Point! ! Find Customer “20”... Query the Customer Master 20

23 CST-133 DataBase Labs “Carp” led us to “Whoopi Goldberg"... We Did Three Queries Query #1. The Fish Master gave us the Fish Number for “Carp” Click your left mouse button to proceed... Query #2. The Order File gave us the Customer Number for that Fish Number Query #3. The Customer Master gave us the Name and Address for that Customer Number We Did Three Queries Why not do one Query -- and let the DBMS do more of the work for us !

24 CST-133 DataBase Labs Tables can be joined... Click your left mouse button to proceed... Customer Master Orders C u s t o m e r # Use fields containing same data in each table (Fish Number) -- get GUI joining line Use fields containing same data in each table (Customer Number) -- get GUI joining line Fish Master F i s h #

25 CST-133 DataBase Labs Who ordered “Carp” ? Click your left mouse button to proceed... Query all Three Tables 1. Start building the Query using the Fish Master Table 3. Select the desired fields & key Fish Description as “Carp” 2. In The Show Table Window, Add the Orders and Customer Master tables Carp

26 CST-133 DataBase Labs Who ordered “Carp” ? Click your left mouse button to proceed... Query all Three Tables Carp 6. Observe the GUI Connector Lines 5. Join Orders File and the Customer Master – drag C Cust No to O Cust No 4. Join the Fish Master and the Orders File – drag M Fish No to O Fish No

27 CST-133 DataBase Labs Who ordered “Carp” ? Click your left mouse button to proceed... Query all Three Tables Carp 9. “Carp” led us to Whoopi Goldberg with one query 8. Query results are in the new window --- from all three tables --- they were joined ! 7. Click the Run Query icon !

28 CST-133 DataBase Labs Exit from PowerPoint Viewer and start your DataBase Labs after this slide... Click your left mouse button to return to the PowerPoint Viewer... Customer Master Orders Customer # Fish Master Boat FL Fish # Boat # Then you will design and create a new table to keep track of the boats that Muggwump Fish Farm uses to fill orders You will modify existing tables and be led through some queries and reports and create some charts © Delta College CST Faculty


Download ppt "CST-133 DataBase Labs Access DataBase Labs -- Muggwump Fish Farm Click your left mouse button to proceed... © Delta College CST Faculty."

Similar presentations


Ads by Google