Introduction to Access ISYS 363. Access Objects Tables –Open a table: Double click the table name –Home/View: Datasheet view Design view Queries Forms.

Slides:



Advertisements
Similar presentations
The Ribbon Standard to all Office 2007 applications Organized by feature and functionality Navigation Pane Access to all objects in the current database.
Advertisements

Database Design Week 10.
Complex Conditions. Logical Operators: AND, OR, NOT AND Cond1Cond2Cond1 AND Cond2T TF FTF OR Cond1Cond2Cond1 OR Cond2T TF FTF NOT CondNOT Cond T F.
Exploring Microsoft Access
Normalization ISYS 464. Database Design Based on ERD Strong entity: Create a table that includes all simple attributes –Composite Weak entity: add owner.
SQL Sub (or Nested ) Query. Examples Q: Find students whose GPA is below the average. –The criteria itself requires a SQL statement. –SELECT * FROM student.
Concepts of Database Management Seventh Edition
Concepts of Database Management Sixth Edition
Concepts of Database Management Seventh Edition
Database Features. Lists n An Excel worksheet can be used like a table in a relational database. n In Excel, such a table is called a list. n Each row.
The University of Akron Dept of Business Technology Computer Information Systems The Relational Model: Query-By-Example (QBE) 2440: 180 Database Concepts.
Querying Database ISYS 363. Basic Query Language Operations Selection Projection Join Aggregates: Max, Min, Sum, Avg, Count –Totals and SubTotals –GroupBy.
SQLPlus Commands. Oracle Account Server: libra.sfsu.edu Telnet: libra.sfsu.edu How to use Oracle: –
Introduction to MS Access. Creating a New Database File/New –Blank database –New database name and location.
Structured Query Language Review ISYS 650. Language Overview Three major components: –Data definition language, DDL Create, Drop and Alter Tables or Views.
Nested IF and Complex Condition. Nested IF Example: –Rules to determine bonus: JobCode = 1, Bonus=500 JobCode = 2, Bonus = 700 JobCode = 3, Bonus = 1000.
Data Modeling with ERD ISYS 363. Entity-Relationship Diagram An entity is a “thing” in the real world, such as a person, place, event for which we intend.
Complex Conditions. Logical Operators: AND, OR, NOT AND Cond1Cond2Cond1 AND Cond2T TF FTF OR Cond1Cond2Cond1 OR Cond2T TF FTF NOT CondNOT Cond T F.
Querying a Database Using the Select Query Window
Introduction to Database ISYS 363. File Concepts File consists of a group of records. Each record contains a group of fields. Example: Student file –SIDSnameMajorSexGPA.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Introduction to Database. File Formats Comma delimited file –"s1","peter",3 –"s2","paul",2.5 –"s3","mary",3.5 –Demo: Excel – Data/Import Extended Markup.
Introduction to Database ISYS 263. File Concepts File consists of a group of records. Each record contains a group of fields. –Key field, grouping field,
Basic SQL Select Commands. Basic Relational Query Operations Selection Projection Natural Join Sorting Aggregation: Max, Min, Sum, Count, Avg –Total –Sub.
Querying Database ISYS 363. Basic Query Language Operations Selection Projection Join Aggregates: Max, Min, Sum, Avg, Count –Totals and SubTotals –GroupBy.
Introduction to Access BUS 782. Access Objects Tables –Open –Design –New –Wizard Queries Forms Reports Pages.
Relational Algebra. Set operations: Union, intersection, difference, Cartesian product Relational operations: Selection, projection, join, division.
Chapter 2 Querying a Database
Querying Database. Basic Query Language Operations Selection Projection Join Aggregates: Max, Min, Sum, Avg, Count –Totals and SubTotals –GroupBy Calculated.
Relational Operators, SQL, and Access Query ISYS 562.
Exploring Office Grauer and Barber 1 Information From the Database: Reports and Queries(Wk4)
Concepts of Database Management, Fifth Edition
Microsoft Access 2010 Chapter 7 Using SQL. Change the font or font size for SQL queries Create SQL queries Include fields in SQL queries Include simple.
With Microsoft Office 2007 Introductory© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Introductory.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 4 BACKNEXTEND 4-1 LINKS TO OBJECTIVES Query Design Query Criteria Modify a Query Using OR.
1 Chapter 7 Query-By-Example by Monica Chan CS157B Professor Lee.
Database Queries. Queries Queries are questions used to retrieve information from a database. Contain criteria to specify the records and fields to be.
Microsoft Access 2010 Building and Using Queries.
Analyzing Data For Effective Decision Making Chapter 3.
Concepts of Database Management Seventh Edition
Advanced SQL for Decision Support ISYS 650. Set Operators Union Intersect Difference Cartesian product.
Using Special Operators (LIKE and IN)
Concepts of Database Management Seventh Edition
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 - Information From the Database: Reports.
Introduction to MS Access. Creating a New Database File/New –Blank database –New database name and location.
Database Systems Microsoft Access Practical #3 Queries Nos 215.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
Chapter 3 Query and Report. Agenda Report types Report contents Report creation Report design view Query and dynaset Function and grouping Action query.
Pasewark & Pasewark 1 Access Lesson 3 Creating Queries Microsoft Office 2007: Introductory.
Concepts of Database Management Eighth Edition Chapter 3 The Relational Model 2: SQL.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T7: Problem Solving Using Access 2007 Business Driven Technology.
Introduction to Access ISYS 363. Creating a New Database MS Office button/New –Blank database –New database name and location.
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
Reports and Queries Chapter 3 – Access text Reports – Page Queries – Page
Relational Query Operators (Algebra). Relational Query Operators Set operations: Union, intersection, difference, Cartesian product Relational operations:
Querying Database ISYS 363.
Introduction to Query Language and SQL. Basic Query Language Operators Selection Projection Join Aggregates –Sum, Count, Max, Min, Avg SubTotal Calculated.
Access Chapter 1: Intro to Access Objectives Navigate among objects in Access database Difference between working in storage and memory Good database file.
Decisions Action based on condition. Examples Simple condition: –If total sales exceeds $300 then applies 5% discount; otherwise, no discount. More than.
Introduction to Access BUS 782. Creating a New Database MS Office button/New –Blank database –New database name and location.
Introduction to Access ISYS 363. Access Objects Tables –Open –Design –New –Wizard Queries Forms Reports Pages.
Import/Export Data ISYS 363. Access Tools for Import/Export External Data – Import – Export Exchange data between: – Other Access databases – Excel –
Lesson 4: Querying a Database. 2 Learning Objectives After studying this lesson, you will be able to:  Create, save, and run select queries  Set query.
Set Operators. Union Intersect Difference Cartesian product.
Data Modeling with ERD ISYS 363.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Access Lessons 1, 2 and 3 ©2009 M and K Solutions, LLC – All Rights Reserved.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
Querying Database ISYS 363.
Chapter 3 Query and Report.
Presentation transcript:

Introduction to Access ISYS 363

Access Objects Tables –Open a table: Double click the table name –Home/View: Datasheet view Design view Queries Forms Reports Pages

Creating a New Database MS Office button/New –Blank database –New database name and location

Creating a Table Create/Table Design: –Field name –Field data type Create table by using table templates –Create/Table Templates/select template Create a primary key –Never let Access to create a primary key for you. Enter data

Create a new Query Create/Query design/Show table –Select fields –Add criteria Sorting Total and subtotal –Query design tools/Total –A Total row is added to the design view –Select function from the total row’s dropdown list

Creating a New Form Using Form Wizard –Create/More Forms/Form Wizard

Querying Database ISYS 363

Basic Query Language Operations Selection Projection Join Aggregates: Max, Min, Sum, Avg, Count –Totals and SubTotals –GroupBy Calculated fields

Selection Selection operation retrieves records that satisfy user’s criteria.

Projection Projection operation defines a vertical subset of a table and retrieves only the specified fields.

Join The two tables must have common attributes: –Key and foreign key. Combines two tables to form a new table where records of the two tables are combined if the common attributes have the same value.

Join Example Faculty File: FIDFname F1Chao F2Smith F5Boxer Student File: SIDSname FID S1PeterF1 S2PaulF2 S3SmithF1 Faculty Join Student =

Join Example Student File: SIDSname FID S1PeterF1 S2PaulF2 S3SmithF1 StudentCourse File: SIDCID S1ISYS263 S1Acct101 S3ISYS363 S2ISYS263 S2Fin350 S2Acct101 Course File: CIDCname Units ISYS263 IS Intro3 ISYS363 MIS Intro3 Acct101accounting3 Fin350Finance Intro3 (Student Join StudentCourse) Join Course

Aggregate Functions Max, Min, Sum, Count, Avg View/Totals Ex. Student: SID,Sname, GPA, Sex, Major –How many students in this University? –What is the overall average GPA?

Aggregates by Group –How many students in each major? –Compare male students and female students average GPA.

Examples Customer: CID, Cname, City, Rating Orders: OID, Odate, SalesPerson, CID Queries: –Find customers live in San Francisco. –Produce a customer report that shows CID, Cname, and Rating. –Number of customers in each city City, NumbeOfCustomers –Produce a report that shows the number of orders for each customer: CID, Cname, TotalNumberOfOrders

University Database

ERD Notations Student Account Faculty Course Has 11 Enroll MM Advise M 1 Teach M M SID Sname Major SID Balance FID Fname CID Cname Units Phone Grade

Examples Q1: Display students’ ID, name and account balance who owe university more than $2000. Q2: Display student’s ID, name and total units. Q3: Find students taking at least 9 units and display their ID, Name and total units. Q4: Display CID, Cname, SID, Sname Q5: Display CID, Cname, number of students in each course. Q6: Display faculty’s name and phone if the faculty advises at least three students.

Order Processing Database Examples Order Processing Database: –Customer, Orders, OrderDetail, Product –MIS report –Total amount for each order –Criteria applied to subtotal

Calculated Fields Rename a field: –NewName:OldName Define a calculated field: –Tax:salary*.15 –Age:Year(Now()) – Year(DOB) –IIF function

Criteria >, >=, Range: BETWEEN 1/1/03 AND 12/31/03 Wildcard: –? – match any one character “K?NG” –* - Match any number of characters “C*”

Complex Condition University admission rules: Applicants will be admitted if meet one of the following rules: –1. Income >= 100,000 –2. GPA > 2.5 AND SAT > 900 An applicant’s Income is 150,000, GPA is 2.9 and SAT is 800. Admitted? –Income >= 100,000 OR GPA > 2.5 AND SAT >900 How to evaluate this complex condition?

Scholarship: Business students with GPA at least 3.2 and major in Accounting or CIS qualified to apply: –1. GPA >= 3.2 –2. Major in Accounting OR CIS Is a CIS student with GPA = 2.0 qualified? –GPA >= 3.2 AND Major = “Acct” OR Major = “CIS” Is this complex condition correct?

NOT Set 1: Young: Age < 30 Set 2: Rich: Income >= 100,000 YoungRich

Order of Evaluation 1. () 2. Not 3. AND 4. OR

Examples SAT = 800, Income 60,000, GPA 3.0, admitted? –(SAT > 900 OR Income >= 50,000) AND Not GPA < 2.5 A=2, B=3 (A=3 OR NOT (B < A)) AND B=A+1

Access Complex condition Rating = “A” OR Rating = “B” Cname = “Chao” OR Cname = “Smith” Rating = “A” OR Rating = “B” AND City=“SF” (Rating = “A” OR Rating = “B”) AND City=“SF”

Excel’s IF with Complex Condition Rules to calculate employee bonus are: –If JobCode = 1 AND Salary < 5000 Bonus = 10% * Salary –Otherwise: Bonus = 8% * Salary Rules to calculate employee bonus are: –If JobCode = 1 AND Salary < 5000 OR Sex = “F” Bonus = 10% * Salary –Otherwise: Bonus = 8% * Salary

Sorting One field sorting Two fields sorting

Other Queries Update query: –Query tools/Design/Query type/Update Delete query Parameter query CrossTab query –Crosstab row

Forms Form wizard Main/Sub Form –Based on two tables with 1:M –Based on a query created from two tables with 1:M Pivot Table form –AutoCal

Access Tools for Import/Export Import from Excel: –The first row of Excel’s list should contain field names –External Data/Import/Excel Export to Excel: –External Data/Export/Excel

Open Database Connectivity (ODBC) Provide a standard to retrieve data from a database. It manages one or more "database drivers“ that enables the communication between database and applications. To access a database, we use ODBC facilities to define a ODBC data source name for the database.