Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi October 15, 2015 1.

Similar presentations


Presentation on theme: "DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi October 15, 2015 1."— Presentation transcript:

1 DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi Rahul.Kavi@mail.wvu.edu October 15, 2015 1

2 THINGS TO REMEMBER MyITLab Lesson C is due on October 19 (Monday). Covered topics in class: 1.Creating databases. 2.Creating tables. 3.Creating a simple query. 4.Creating a primary key, choosing a primary key. 5.Creating a referential integrity. 2

3 THINGS TO REMEMBER 6 In-Class projects conducted. 5 on Excel. 1 on Access (last class on doing simple tasks in Access). Total of 12 In-class projects to be conducted. 10 will be counted towards the grade. 10 points each for project (adding up to 100 points). 3

4 TODAY Import XML files into Access. Import CSV files into Access. Creating relationships (referential integrity with cascade updates). Writing a single table query (with criteria). Writing a multi-table query (with criteria). 4

5 TODAY Download Data file for today (zip file). Follow the lecture. 5

6 IMPORTING XML Navigation: External Data tab-> XML File button Using XML files you can import data, table structure into a new table. Importing data, you can append/add data to existing data, overwrite existing data on existing tables. Importing XML Access is similar to importing XML files in Excel. 6

7 IMPORTING CSV Navigation: External Data tab-> Text File button Using CSV files you can import data, table structure into a new table. Importing data, you can append/add data to existing data, overwrite existing data on existing tables. CSV files similar to an XML file (but different structure). 7

8 WRITING QUERIES IMPORTANT: Figure out what tables you need (depending on question)? IMPORTANT: Make sure you have your table relationships setup. Don’t skip instructions. To see what tables have what fields, look at the table design or look at the given question paper (data description). 8

9 WRITING QUERIES Queries: Retrieve data from Tables. (Asking questions to the database and database answers your queries). Your query can span across Tables. Usually (not necessarily) there exists a relationship between tables you retrieve data from multiple tables. 9

10 QUERY TOOLS Open/Create a query by “Create-> Query Design”. Access Queries tools using on the top menu. 10

11 QUERY: SELECTING ALL FIELDS FROM A TABLE 11

12 QUERY: SELECTING ALL FIELDS FROM A TABLE 12 Select all data from employee tables and display it. You should have 8 fields and 14 records (count yours to verify). Save the query as “Simple Employee Info”.

13 QUERY: SELECTING FROM MULTIPLE TABLES 13 Query -> Query Design -> Add the required tables. Add required fields from multiple tables. Look at the example.

14 QUERY: SELECTING FROM MULTIPLE TABLES 14 Write a query to find employee id, first name, last name of the employee, where the employee lives, his/her salary, gender, what is his/her phone number, his or her job title ID. You should get 8 fields and 14 records (count yours to verify). Save your query as “Detailed Employee Info”

15 ADDING CRITERIA 15 Filtering a query Question: Find employees who live in Chicago? Question: Find employees who live in Boston? Question: Find employees who have a salary of less than 30,000$ and more than 50,000$? Question: Find employees who live in Chicago or Boston.

16


Download ppt "DAY 17: ACCESS CHAPTER 1-2 Rahul Kavi October 15, 2015 1."

Similar presentations


Ads by Google