Exam 2 Study Guide Denny Hood denny.hood@mail.wvu.edu Computer Science 101
A Brief Word About Your Exam Your exam will be MONDAY, APRIL 10. You will have 50 minutes to complete Exam 2. 1. If you arrive late or leave early, you forfeit any time missed. 2. You must present your WVU ID or government issued ID to take the exam. If you do not have an ID, you cannot take the exam. 3. You should arrive 10 minutes before class. This will ensure you are ready to enter the classroom and be seated about 5 minutes before the exam start time. 4. If you have any questions, please raise your hand, my proctor and I will do our best to help you.
Table of Contents Create a Database Import XML Create a Table Enter Data in a Table Create Relationships Create Queries Create Calculated Field Single Criteria Query Two Criteria Query Totals Query SQL Queries Create Forms Create Reports
DO NOT DOUBLE CLICK TO OPEN FILES Do not open files you download directly You need to Extract all files to My Documents Folder You must open Access and import extracted data
Create a Database Open Microsoft Access Click Blank Database Name your database in the format (lastname_firstname_xxxx.accdb) Click Create
Import XML (step 1) Click the External Data ribbon Choose XML File In the dialogue box, click Browse Find your file (NOTE: you have to extract it FIRST) Click OK
Import XML (step 2) Select Structure and Data Click OK On the save import step box, click Close
Create a Table in Table Design (step 1) Click the Create Ribbon Choose Table Design In table design, Enter field names Choose field type(s)
Create a Table in Table Design (step 2) Select field to be primary key Click Primary Key button You should see a key ( the field name ) in front of
Enter Data in a Table Change table view to Datasheet view Enter data When you are finished entering data, make sure you select new record row and have the cursor in the new record row Save the table Close the table
Create Relationships Click the Database Tools Ribbon Select the Relationships button In the Show Table box, add the tables you need to create the relationship Drag and drop matching fields to create a relationship In the edit relationships box, make sure the fields have the same name After you click Create, you should see a black line connecting the tables
Make Queries NOTE: you must have all tables and relationships created first Click the Create Ribbon Query Design In Show Table Box, add ONLY the tables with the fields you need If you add more than one table you must see a black line connecting the tables To add fields in result query, double click fields in tables
Types of Queries Sort Single Criteria Two Criteria Totals Number Type Calculated Field In design grid: In design grid: In field properties: Click totals button
Create Calculated Field Query Create ribbon, Query Design Builder Expand the database in Expression Elements Expand the Tables Click table you want information from Double click field in Expression Categories
Single Criteria Query In the design grid: Find the field with a specific result Click in the Criteria cell = (returns results only of that specific instance) > (returns results bigger than instance) < (returns results smaller than instance)
Totals Query Query Tools Design ribbon In Show/Hide group Totals Sum - Adds the items in the column Avg Calculates average value of column Count Counts the number of items in column
Two Criteria Query In the design grid: Find the fields with specific results Click in the Criteria: cell List first criteria Click in the Or: cell List second criteria AND, OR, and NOT Queries Logical Operation Example Result AND >1 AND <10 Returns values between 2 and 9 OR Republican OR Democrat Returns a list of candidates who are Democrats or Republicans NOT NOT Freshman Returns a list of every student who is sophomore or above
SQL Queries Click Create ribbon Query Design Change view to SQL Paste code from instructions
Format Fields Query Tools Design Ribbon In Show/Hide group Property Sheet In the Property Sheet: Format change number type (fixed, standard, percent) Decimal Places specify number of decimal places
Form Wizard (step 1) Select Query to make report Click Create ribbon Choose Form Wizard In the Form Wizard dialogue box Choose table Add field you are grouping by Choose other table Add all fields Next >
Form Wizard (step 2) Set field for viewing Set grouping (optional) Set up sorted fields Set up form layout Name form Finish
Report Wizard Click the Create ribbon Choose Report Wizard Choose the query you need Add all fields Choose which table to see data Group Choose ascending order Choose justified and portrait Name your report Finish
Analysis Questions You will need to create a new table named analysis questions. Designate the question number field as the primary key. You must answer four out of the five questions given. You must use proper grammar and spelling. You must write at least two sentences. You need to answer the question. Then provide justification for your answer.