Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using SQL with Access I create a database named

Similar presentations


Presentation on theme: "Using SQL with Access I create a database named"— Presentation transcript:

1 Using SQL with Access I create a database named
studentdbver16 and now I am creating a table within that database name stuver16. I hava made the first field idno, it is short text and has a size of 4

2

3

4 Click here to start entering data into your table

5 First I save and close the table.
Now I want to create a query so I click on Create and then I click on Query Design

6 I do not want to use the user interface so I close the show table and click on SQL (top left under File).

7 I enter the select I want
I enter the select I want. I want to see the content of the three fields idno, namz and major and they are on the stuver16, I use the FROM clause to name the table. Then I click on view and I see the results. I then click on the X next to Query1 and get the opportunity to save.

8 The first query was saved as threefields.
Now I have another query where I am using the * to show all fields and the WHERE clause to specify I only want to see the records where the major is CI.

9 Here I want to show all fields on all records that have a major of CI and a gpa > 3.5,
Note that the major was short text so the CI is string data enclosed in quotes. The gpa was a number so it is not enclosed in quotes.

10 Now I am asking the OR question. I gpa > 3
Now I am asking the OR question. I gpa > 3.5 or is noCredits > 30. The one record where the gpa is not greater than 3.5 does have a noCredits > 30.

11 The logic rule is that ANDs are resolved before ORs
The logic rule is that ANDs are resolved before ORs. So this one resolves CI and gpa > 3.5 and then resolves BU and noCredits < 30 and then resolves the OR by saying either of these two groups.

12 In this problem I want only CI majors AND in addition I want them to have a gpa > 3.85 OR noCredits < 30. I need to change the order of operations and I do this with a parenthesis. If I left it without the parenthesis the AND would be resolve first so it would be major and gpa and just noCredits < 30. Not what I wanted. So I need the parenthesis so that it will resolve what is inside the parenthesis, the OR, first and then combine it with the major.


Download ppt "Using SQL with Access I create a database named"

Similar presentations


Ads by Google