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
Click here to start entering data into your table
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
I do not want to use the user interface so I close the show table and click on SQL (top left under File).
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.
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.
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.
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.
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.
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.