1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.

Slides:



Advertisements
Similar presentations
Designing Tables in Microsoft Access By Ed Lance.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
1 Chapter 1 & 2 Relational Databases and Queries CS101 WVU.
MS-Access XP Lesson 2. Input Mask Property 1.Field : Phone No Data Type : Number Input Mask : Character 0 represent a single digit and phone.
Concepts of Database Management Seventh Edition
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 3 1 Microsoft Office Access 2003 Tutorial 3 – Querying a Database.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
SUNY Morrisville-Norwich Campus-Week 10 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
BA271 Week 7 Lecture Building the database Dave Sullivan.
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.
FIS 318/618: Financial Systems & Databases Queries Oakland University School of Business Administration Accounting and Finance Joe Callaghan.
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Database Design Concepts INFO1408 Term 2 week 1 Data validation and Referential integrity.
Querying a Database Microsoft Office Access 2003.
Management Information Systems MS Access 2003 By: Mr. Imdadullah Lecturer, Department of M.I.S. College of Business Administration, KSU.
Chapter Extension 6 Using Microsoft Access © 2008 Pearson Prentice Hall, Experiencing MIS, David Kroenke.
1 Access Lesson 3 Creating Queries Microsoft Office 2010 Introductory Pasewark & Pasewark.
Chapter 3 Maintaining a Database
Microsoft Access 2000 Creating Tables and Relationships.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1. Chapter 2: Relational Databases and Multi-Table Queries Exploring Microsoft Office.
Building The Database Chapter 2
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Primary & Foreign Keys. PK & FK 1.Primary key is required 2.The PK must be unique 3.If the primary key from one table is related to a field in another.
Chapter 2 Querying a Database MICROSOFT ACCESS 2010.
Copyright © 2008 Pearson Prentice Hall. All rights reserved.1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational Databases.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall 1 1 Committed to Shaping the Next Generation of IT Experts. Chapter 2: Relational.
Exploring Microsoft Office Access 2010
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
1 Chapter 7 Query-By-Example by Monica Chan CS157B Professor Lee.
CSS/417 Introduction to Database Management Systems Workshop 2.
Analyzing Data For Effective Decision Making Chapter 3.
Lesson 2.  To help ensure accurate data, rules that check entries against specified values can be applied to a field. A validation rule is applied to.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
IE 423 – Design of Decision Support Systems Database development – Relationships and Queries.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 9 1 Microsoft Office Access 2003 Tutorial 9 – Using Action Queries, and Defining Table Relationships.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
Access Chapter 2: Relational Database Objectives Design data Create tables Understand table relationships Understand data types, key, & field properties.
CIS 250 Advanced Computer Applications Introduction to Access.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Microsoft Office 2007 Access Chapter 3 Maintaining a Database.
Access Project 3 Notes. Introduction Maintaining the Database  Modifying the data to keep it up-to-date Restructure the Database  To change the database.
Using Microsoft Access 56:150 Information System Design.
Part II. Query Types On the design query table pane, right click and the cascading window will appear.
Database collection of related information stored in an organized form Database program software tool for storage & retrieval of that information.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 3 BACKNEXTEND 3-1 LINKS TO OBJECTIVES Modify a Table – Add, Delete, Move Fields Modify a Table.
Maintaining a Database Access Project 3. 2 What is Database Maintenance ?  Maintaining a database means modifying the data to keep it up-to-date. This.
Microsoft Access 2010 Chapter 3 Maintaining a Database.
Introduction to a Database Defining a database Database window in Access The six items in window: Tables, Queries Forms, Reports, Macros, Modules.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
Relational Database Techniques
XP New Perspectives on Microsoft Access 2002 Tutorial 31 Microsoft Access 2002 Tutorial 3 – Querying a Database.
© 2001 ComputerPREP, Inc. All rights reserved. Access 2000: Module II.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
Intermediate MS Access Instructor: Vicki Weidler Assistant: Adam Cavotta.
Creating Advanced Queries and Enhancing Table Design.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall. 1 Skills for Success with Microsoft ® Office 2007 PowerPoint Lecture to Accompany.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Microsoft Office Access 2010 Lab 3
Objectives Query for top values Create a parameter query
CIS 155 Table Relationship
Access Tutorial 5 Creating Advanced Queries and Enhancing Table Design
Databases and Information Management
Tutorial 5 Advanced Queries and Enhanced Table Design
Presentation transcript:

1 Chapter 2 Reviewing Tables and Queries

2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics of a well- designed table Create a new Access table with its corresponding fields, keys, indexes, validation rules, input masks, and formats

2 Chapter Objective Create relationships between tables Create select queries, totals queries, and action queries Create queries in SQL view

2 The Access Application Development Process Structured systems development approach  Includes a formal requirements specification phase, followed by the creation of an application blueprint, and then by programming Prototyping approach  Requires the developer to build an initial system quickly, with a shorter requirements and design phase

2 The Access Application Development Process Figure 2-1 Access application development process

2 Table Development Data constraints  Valid values for the data  Many can be enforced through the design of the Access tables and relationships

2 Terminology and Rules of Table Design Figure 2-2 Design view of tblCurrentSt udents

2 Terminology and Rules of Table Design Primary key  A field or a combination of fields that always contains a value that uniquely identifies a row in a table Composite key (or multiple-field primary key)  A primary key that consists of two or more fields Foreign key  A field or a combination of fields that contains values that are also contained by a primary key (usually, but not always, located in another table)  May also be null

2 Terminology and Rules of Table Design Figure 2-3 Query that retrieves students who need MKTG 641 (good table design)

2 Terminology and Rules of Table Design Figure 2-4 Query that retrieves students who need MKTG 641 (poor table design)

2 Terminology and Rules of Table Design Points to follow when constructing tables:  When two or more tables contain the same fields, consider collapsing the multiple tables into a single table  When a table contains several similar fields, consider creating another table that contains the primary key of the original table plus a single field that combines the similar fields of the original table

2 Terminology and Rules of Table Design Points to follow when constructing tables (continued):  If the values of two or more fields always appear together in different rows, whether in the same or different tables, consider creating a new table that contains the related fields  Creation process is called normalization

2 Normalization  Process that involves splitting tables into more than one table in an effort to control data redundancy Dependency  Exists between fields when a filed or fields determine the value of another field

2 Normalization Table 2-1 Normal form summary

2 Normalization Table 2-1 Normal form summary (continued)

2 Constraints in the Design View of a Table Field Name column  Contains the name of the field Data Type column  Identifies the kind of data that can be stored in the field  Enforces a constraint Field Size property  Specifies how many characters or the type of number that can be contained in the field  Provides an additional constraint that validates the entry of data into a field

2 Constraints in the Design View of a Table Additional data types supported by Access:  AutoNumber  Tells Access to generate a value for the field automatically  ReplicationID  Used when copies of a table are kept on more than one computer  Ensures that the value generated for the field is unique across different computers

2 Constraints in the Design View of a Table Table 2-2 Data types supported by Access

2 Constraints in the Design View of a Table Table 2-2 Data types supported by Access (continued)

2 Field Properties for Constraint Enforcement and Formatting You can specify the non-null constraint for non- key fields by choosing Yes in the Required field property Non-null constraint  Requires that all records contain a value for that field Zero-length string  A valid value that is defined as “” Choosing No in the Allow Zero Length field property prevents the use of zero-length strings

2 Field Properties for Constraint Enforcement and Formatting Index  Maintains a sorted list of the current values of a field or fields  Items in the list point to the records that have the identified value  Created automatically for primary keys

2 Field Properties for Constraint Enforcement and Formatting Figure 2-6 Indexes window of tblLevelingNeeded

2 Validation Rules and Validation Text Field Properties Validation rule  Condition that the corresponding field must satisfy Validation text  Displayed if the condition of validation rule is not satisfied Conditional expression  Any statement that can be evaluated as True or False

2 Table Properties Validation Rule Table Properties validation rule  Required when a constraint requires a comparison of the contents of two or more fields in the same table  Typed in the Table Properties sheet

2 Table Properties Validation Rule Access allows the creation of fairly complex validation rules Between, In and Like  Operators that return True or False values Dlookup function  Used in a table-level validation rule to compare a value to values found in another table

2 Table Properties Validation Rule Input mask  Constraint mechanism  Guides users as they type input  Prevents users from typing incorrect values Input Mask Wizard  Helps set up input masks Default Value field property  Specifies the initial value of the corresponding field

2 Table Properties Validation Rule Table 2-4 Input Mask symbols

2 Properties Used for Formatting Caption property  Refers to the heading or prompt that will initially appear on a form or report when the corresponding field is included The default type of control that appears on a form or report is specified through the Display Control combo box, which is located in the Lookup tab in the Field Properties section of the table’s Design view

2 Properties Used for Formatting Description column  Affects a form by placing the value of the Description column as the default status bar text Format field property  Used to indicate how stored data should be displayed

2 Properties Used for Formatting Table 2-5 Symbols used in the Format property

2 Multiple Table Relationships Foreign keys  Used to maintain relationships between tables Joining the tables  Process of matching common attribute values

2 Multiple Table Relationships Referential integrity  A constraint on data values that forces the value of a foreign key to either:  Match a primary key value that is contained in a row of the related table or  Equal null Explicit relationships also facilitate the use of subdatasheets  Allow you to display related records that are nested within the datasheet of a table

2 Multiple Table Relationships Figure 2-7 Some of the relationships in the Relationships window for MU-DSci

2 Multiple Table Relationships Referential integrity between the primary key and foreign key is enforced by placing a check mark in the Enforce Referential Integrity check box In the Relationships dialog box, when Cascade Update Related Fields is checked, changes in the primary key value are automatically propagated to the corresponding foreign key value

2 Multiple Table Relationships Figure 2-8 Relationships dialog box between the tblCurrentStudents and tblLevelingNeeded

2 Multiple Table Relationships When Cascade Delete Related Records is checked, row deletions in the primary key table will cause deletions of related rows in the foreign key table One-to-one relationship  Indicates that a value of the primary key can exist in only one row as a foreign key One-to-many relationship  Indicates that a value of the primary key can exist in more than one row as a foreign key

2 Linked Tables To use linked tables, you must:  Develop table definitions and table data in one database called the source database  Develop the queries, forms, reports, pages, macros, and modules in a different database called the container database

2 Query Development Queries  Provide an efficient and easy method of retrieving, manipulating, and summarizing data  Access queries are specified in the Structured Query Language (SQL) Action queries  Make-table, update, append, and delete queries

2 Query Development Join lines  Relationships predrawn between selected tables in the query’s Design view if relationships have been declared between tables or if Access can guess relationships between tables  Created by dragging a field from one table to a field in another table

2 Query Development Figure 2-11 Access Query menu and design grid

2 Query Development Figure 2-12 Query showing the leveling courses needed by each current student

2 Select and Crosstab Queries Select queries  Retrieve data from other tables or queries Field names appear in the Field row of the grid Criteria row of grid  Limits the displayed rows to those that meet a specified condition  Contains any statement that evaluates to True or False

2 Joins Inner join  Default join type  Includes rows only when the fields being compared contain matching values

2 Joins Figure 2-13 Join Properties dialog box

2 Totals Queries Totals queries  Select queries that aggregate values The Group By item in the Total list box  Tells Access to aggregate the other fields per each unique value within the Group By field

2 Totals Queries A Where specification in the Total row  States that the field will be tested for a criterion before it is included in the aggregations specified by the other columns Crosstab query  Similar to a totals query, except that the former requires at least two Group By fields

2 Action Queries Delete queries  Remove rows from a table Figure 2-16 Design view of qryDeleteDen iedProspects

2 Action Queries Make-table queries  Similar to select queries, except that the query results are physically stored in a new table Append queries  Similar to make-table queries, except that the results of the select query are appended to an existing Access table Update queries  Change field values in existing rows in a table

2 Parameter Queries Parameter queries use parameters to substitute for the constant values placed in the query grid Figure 2-17 Design view of the qryUpdat ePrice update query

2 Chapter Summary Queries, forms, reports, macros, pages, and modules display or manipulate the data contained in the tables Applications should attempt to ensure data integrity through table and relationship design Primary keys, input masks, validation rule, and referential integrity can all be used to enforce data constraints

2 Chapter Summary Queries are closely related to tables Totals and crosstab queries aggregate data stored in the tables Action queries update data in the tables Like tables, queries are commonly used by forms, reports, pages, macros, and modules