Presentation is loading. Please wait.

Presentation is loading. Please wait.

A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on.

Similar presentations


Presentation on theme: "A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on."— Presentation transcript:

1 A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on software and programming. The layout of the file is: ISBN # of Book Title of Book Primary Author of Book Topic Year Published Here are a couple of records that I have on the file. First I have to determine the data types for each field and the length of the fields. Se rest of example in week #1

2 I have added 4 fields - the isbn which is highlighted is text and the field size is 13. The other fields are author, topic and year. I am creating the practice that I posted in the first week.

3 These are the field sizes, title is 35 as is author. Topic is 10 and year is 4. Note that I made year a text field since I will not be using it in a calculation.

4 Now I have gone in queries and I am going to create a new query. I can click directly on Create query in design view or I can click on New as I did here and then select Design View. I do not want you using the wizard.

5 The first step in creating the query is to add the table to the query. The table is highlighted and I clicked on Add.

6 Notice when I double-click on a field name in the table, I bring it down to the line. I have both the field name and the table name. I only brought down three fields: title, author and isbn. Problem #1: I need to do a query to list of all books with their title, primary author and ISBN#. Does this file have the data/information available that would allow me to do this query? If so, you should do the query. If not, modify the query to something you can do.

7 This shows the results, the title, author and isbn for each record in the table.

8 Problem #2: I need to do a query to list all books that were published in 2003. Does this file have the data/information available that would allow me to do this query? If so, you should do the query. If not, modify the query to something you can do.

9 The results.

10 Because the field was defined in text, Microsoft will enclose in in quotes if I forget to do so.

11 The last two problems asked about publisher and edition. They did not appear in the database. My design clearly had some flaws. Here I went back to the structure and added the fields. Problem #3: I need to do a query to list all books published by Course Technology. Does this file have the data/information available that would allow me to do this query? If so, you should do the query. If not, modify the query to something you can do. Problem #4: I need to do a query to list all books with their title, edition, and topic where the topic is CGI/Perl. Does this file have the data/information available that would allow me to do this query? If so, you should do the query. If not, modify the query to something you can do.

12 Now I am asking about two criteria in an AND relationship. The flowchart shows the logical flow for the AND relationship. Note that the AND relationship has entries on two fields in the criteria line. In the AND relationship, both conditions must be true for the record to display.

13 Note again that Microsoft enclosed in quotes since it is a text field. Note also that the equal sign does not have to be written when you are testing for equality - it is the default.

14 When I want two criteria to be in an OR relationsh ip, I put the criteria for one field on the criteria line and the criteria for the other field on the or line. This shows the logic for two conditions in an OR relationship. If either of the two criteria are true, the record will display.

15 This shows the results.

16 I am not sure what change I made here - my best guess. I went back and changed one of the records in the table to have a different year so it did not display.

17 In this example, I want the year to be 2003 always. In addition, either the title has to be > M or the topic has to be Oracle. This can also be read as title > M and yr = 2003 OR topic = Oracle and year = 2003

18 This is the logic flowchart. If the year is not 2003, I drop out. If it is I then ask if the title > M, if it is I display. If it is not I have a second chance, if the topic is Oracle, I display.

19

20 In this case, the year only appears on the criteria line. So the logic is: title > M and year 2001 OR topic = Oracle

21 This shows the logic flowchart for the previous example.

22 This time I change the >M to >C to get different results.


Download ppt "A am going to create a table in design view. I am going to create a table in an Access database that contains information about the books that I have on."

Similar presentations


Ads by Google