Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu Access chapters 1&2 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu.

Similar presentations


Presentation on theme: "Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu Access chapters 1&2 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu."— Presentation transcript:

1 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu
Access chapters 1&2 Nagendra Vemulapalli

2 Announcement Lesson C in MyITLab is due on 03/18/2013 7/27/2019
Nagendra Vemulapalli

3 Get the Database Download and open Example1 file from todays lecture notes * Premise: We are running a company and this database tracks information on our employees 7/27/2019 Nagendra Vemulapalli

4 Filters Give a temporary view of desired data to help isolate portions
Filter by Selection – lets us specify an example Filter by Form – more powerful, can search for records meeting multiple conditions and by operators such as: <, >, <=, >= 7/27/2019 Nagendra Vemulapalli

5 Filter by Selection Example
Say we wish to isolate our employees with poor performance… Open the Employees table Click in one of the field values containing Poor Click Selection in the Sort & Filter group Select Equals Poor Click Toggle Filter to turn off 7/27/2019 Nagendra Vemulapalli

6 Filter by Form Example Say we want to see all Females making over $40k… Select Advanced in Sort & Filter group Choose Filter By Form Remove Poor from performance 7/27/2019 Nagendra Vemulapalli

7 Filter by Form Example Select F for Gender Enter >40000 for Salary
Click the Toggle Filter button Review the results Toggle the filter off 7/27/2019 Nagendra Vemulapalli

8 Sorting on a Single Field
Sorting allows us to arrange the way the table data looks… Click in a record under the Last Name field Click the Sort Ascending button Next, sort ascending on Salary 7/27/2019 Nagendra Vemulapalli

9 Sorting on Multiple Fields
Fields must be side by side to do this Click and Drag to highlight both the LastName and FirstName fields Sort Descending (Note the Smith’s first names) Do it again Ascending 7/27/2019 Nagendra Vemulapalli

10 Databases & Relationships(Lookahead.accdb)
A Database is a collection of “Related” tables This can also be called a “Relational Database” A Common Field between tables is what allows a relationship to exist. This works by way of “Primary” and “Foreign” keys… 7/27/2019 Nagendra Vemulapalli

11 Primary Keys Primary Key – Field in a every table whose field values are unique for every record Examples might be things like: Student ID numbers SSN number Cell Number Anything that will not have duplicates as additional records are entered 7/27/2019 Nagendra Vemulapalli

12 Relationships Foreign Key – Similar/Same field in the second related table in the relationship Primary key field in relationship will have similar data type and content to foreign key field The two tables are joined together on the primary and foreign keys and form a Common Field. 7/27/2019 Nagendra Vemulapalli

13 Relationships The link formed through this Common Field which is dubbed in one case as a “primary key”, and in another as a “foreign key”, allows tables to share data Note that the “Look Ahead” database has 3 tables, but we will only look at 2 of them.. 7/27/2019 Nagendra Vemulapalli

14 1: Employees Table… EmployeeID is the Primary Key as all numbers are unique for employee records 7/27/2019 Nagendra Vemulapalli

15 2: Locations Table… LocationID is the primary key and each record has a unique LocationID designator. This will tie back to the Employees table. 7/27/2019 Nagendra Vemulapalli

16 Relationships Databases are all about efficiency and not having to store the same information more than once if multiple records need it In this example, we know that multiple people work at the same office address. One address can have many related Employees (One to Many)… 7/27/2019 Nagendra Vemulapalli

17 Relationships Instead of typing the same address in each record for every Atlanta office employee: “450 Peachtree Road…” We can assign a simple relationship to a “Locations” table and reference this information to a given location with a short common code of “L01” between the tables… 7/27/2019 Nagendra Vemulapalli

18 One to Many Relationship
(One instance here) (Many here) Typing “L01” when entering an employee and having it equate to the entire address saves MANY characters in databases as it is reused over and over. “L01” is 3 characters and the entire address is over 30 ! 7/27/2019 Nagendra Vemulapalli

19 Making the Relationship
These tables need to be tied together (related) to work this way… Open the Relationships Window Database Tools ribbon > Relationships Click Show Table Double click Employees & Locations, then Close 7/27/2019 Nagendra Vemulapalli

20 The Relationships Window
The Relationship window depicts included table structures and their associations Within the structures, we see each table’s fields Primary keys are shown with a key icon 7/27/2019 Nagendra Vemulapalli

21 Making the Relationships
Drag “LocationID” from the “Locations” table to “LocationID” in the “Employees” table. Notice the “One-To-Many” reference Click to Enforce Referential Integrity Click Create… 7/27/2019 Nagendra Vemulapalli

22 Relationship Formed (Relationship Primary Key)
Note the One to Many (1 to infinity symbol) that formed on the join line… Close and save the relationship Run the “Employee Information” query to see data pulled together from both tables… (Relationship Foreign Key) Note, the relationship we made was already created in the query we ran and we did this only for increased understanding of how to create relationships. 7/27/2019 Nagendra Vemulapalli

23 Query Results Information is pulled from the “Employee” and “Locations” tables through their relationship and shown united within the query results to give us a complete picture of the information ! The LocationID field was used behind the scenes to pull it all together with the L01 value The full address is actually only stored (taking up space) once in the database, and we are able it multiple times as needed. 7/27/2019 Nagendra Vemulapalli


Download ppt "Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu Access chapters 1&2 Nagendra Vemulapalli Nagendra.vemulapalli@mail.wvu.edu."

Similar presentations


Ads by Google