introduction to access 2010 cis120first.accdb is the database i am creating

Post on 04-Jan-2016

212 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Introduction to Access 2010

CIS120first.accdb is thedatabase I am creating.

I want you to usea differentlayout to designthe table inthe database.

I clickedon Viewand gotpromptedto namethe table.

The first fieldis idno andI made thedatatype textand the fieldsize 5.

The second fieldis the empnameand I made ittext and changed the field size to 40.

The third field on therecord is named jobcode and it isa text field thathas a field size of2 because the code is only 2 characters.

I have set up a forth field callednumdep which I am going tomake numeric and an integer.

This shows the Data Type choices.

Once I pick Datatype of NumberI can chose a typedepending onthe numbers Iwant. I will useinteger.

For decimal numbers I usesingle for smalldecimals anddouble for largedecimals likesalary.

Now click onview and you canpopulating thetable with data.

I have populatedthe table withdata.

Now I click on

Create.

Next I click on

Query Design.

A query lets you specify fields andconditions that you want to useto access the table. It will returnrecords that meet thequery criteria.

Next Iselectthe tableby clicking on Add.

Now you seethe fields inthe tableso you canselect fields to use in your query.

I brought down four of the fields by double clicking on them (you can also drag).I want to see all IT employees so I put IT inthe criteria line under the jobcode.

Click on datasheetview to seeresults.

IT is in quotes becauseit is a string or non-numericliteral.

Jobcode= IT

YN

Logic for query checking For jobcode = IT

Display

Click on thedesign iconto go backto design.

I named the queryITemp.

The query has been saved

Creating anotherQuery.

You can also click on the arrow and choose the field.

I have now got two conditions inan AND relationship. The twoconditions are put on the criteria lineand both must be true for therecord to be displayed.

Jobcode = IT

Salary < 60000

Display

Y

YN

N

LOGIC for two thingsin an AND relationship

The results

In this example, the criteria isthat numdep is > 3 ORsalary is > 55000. Since theseare in an OR relationship, onecriteria goes on the criteria lineand the other criteria goes on the or line.

numdep > 3

salary > 55000

Display

Display

YN

YN

Logic for two criteriain an ORrelationship.

The criteria is numdep > 3 OR salary > 55000. The first result has both true.The second result has just numdep > 3.The third result has just numdep > 3.The fourth result has just salary > 55000.

In this query the jobcode has to be IT and then inaddition either the numdep has to be > 3 or the salaryhas to be > 55000.Since the IT has to be true it has to be on boththe criteria line and the or line.Essentially you now have jobcode IT and numdep > 3OR jobcode IT and salary > 55000.

Jobcode = IT

numdep > 3

salary > 55000

Display

Display

YN

YN

YN

Jobcode has to be IT and theneither numdep has to be > 3 ORsalary has to be > 55000.

All the records have a jobcode of IT.The first record is IT and both numdep> 3 and salary > 55000.The second one is IT and jobcode > 3.The third one is IT and salary > 55000.

top related