MS ACCESS.

Slides:



Advertisements
Similar presentations
Microsoft® Access® 2010 Training
Advertisements

Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Tables. Any database must contain one or more tables, because that’s where the data is stored. For any table there are two views provided: Datasheet view.
Microsoft Access Tables Birgül Kutlu Bayraktar. TERMS A database is a collection of related information. An object is a competition in the database such.
Microsoft Access 2000 Creating Tables and Relationships.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Access 2000 Part 1 Introduction to Access Agenda Starting Access. Creating Tables. Working with Tables. Setting Field Properties.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 1Advanced Tables, Relationships, Queries, and Forms Chapter 1Designing the Structure of Tables.
 A database is a collection of data that is organized so that its contents can easily be accessed, managed, and updated. What is Database?
Designing a Database (Part I) -Identify all fields needed to produce the required information -Group related fields into tables -Determine Each Table’s.
Microsoft Access – Tutorial 2 Designing Databases In this tutorial, we will create a new database create a new table import tables from an existing database.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
CHƯƠNG 3 Finding, Filtering, and Formatting Data.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
Database Systems Microsoft Access Practical #1 Creating Tables Nos 215.
WHAT IS A DATABASE? A DATABASE IS A COLLECTION OF DATA RELATED TO A PARTICULAR TOPIC OR PURPOSE OR TO PUT IT SIMPLY A GENERAL PURPOSE CONTAINER FOR STORING.
Microsoft Access 2010 Chapter 10 Administering a Database System.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
McGraw-Hill/Irwin © The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T6 Basic Skills Using Access.
A Skills Approach Access 2010 Working with Tables © 2012 The McGraw-Hill Companies, Inc. All rights reserved Chapter 2.
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.
Introduction to Database using Microsoft Access 2013 Part 6.1 November 18, 2014.
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/Programs/Microsoft Office/Microsoft Office.
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
CSC 240 (Blum)1 Introduction to Access CSC 240 (Blum)2 Click on the Access desktop icon or go to Start/All Programs/Microsoft Office/Microsoft Office.
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.
Pasewark & Pasewark 1 Access Lesson 2 Creating a Database Microsoft Office 2007: Introductory.
Modify Tables and FieldsModify Tables and Fields Lesson 4 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft.
Microsoft Access Prepared by the Academic Faculty Members of IT.
Getting Started in Access 1 Using an existing Database Database Window Table Design View Parts of a Table Views in Access Navigating in Access Entering.
COMPUTER SKILLS MS-ACCESS. Introduction Access is a piece of software known as a database management system. At its most basic level, it can be used to.
INTRODUCTION TO DATABASE USING MICROSOFT ACCESS 2013 Part 5.1 November 16, 2014.
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
N5 Databases Notes Information Systems Design & Development: Structures and links.
Creating a database table
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Homework 1 Hints.
Guidelines for Designing Databases
Building Tables & Defining Relationships
GO! with Microsoft Office 2016
Practical Office 2007 Chapter 10
and Defining Table Relationships
Building a User Interface with Forms
Introduction to Microsoft Access
GO! with Microsoft Access 2016
Databases part 2 – field properties
Microsoft Office Access 2003
Introduction to Access 2003
MODULE 7 Microsoft Access 2010
Modifying Tables and Fields
Access Lesson 2 Creating a Database
Microsoft Office Access 2003
Microsoft Official Academic Course, Access 2016
Data Types and Field Properties
Microsoft Office Access 2003
Foreign key (FK) is defined as follows:
Using Templates and Library Items
Microsoft Office Illustrated Introductory, Windows XP Edition
Guidelines for Microsoft® Office 2013
Grauer and Barber Series Microsoft Access Chapter Two
Introduction to MS ACCESS
Unit J: Creating a Database
Presentation transcript:

MS ACCESS

Create a new table using a table template, Access includes template for common subjects suchas contacts, issues , and tasks To create a Contacts, Tasks, Issues, Events or Assets table, you might want to start with the table templates for these subjects that come with Office Access 2007. The table templates were designed to be compatible with the Microsoft Windows SharePoint Services 3.0 lists of the same name

Create a table based on a SharePoint list You can create a table in your database that imports from or links to a SharePoint list. The list can pre-existing, in which case you can import or link to it, or you can create a new custom list or a new list that is based on a predefined template. The predefined templates in Office Access 2007 include Contacts, Tasks, Issues and Events.

Add fields to a table in Datasheet view

Add New Field Insert a new filed (column) into the table, so that you can store a specific type of information Add Existing Fields insert a filed into this view, based on an existing field

Add a templated datasheet to an existing database

Dr. Anup Kumar

Set the Attachment or OLE Object data types When you use Datasheet view to create a new table, you can set most data types by entering some data in the first row of a field. However, you cannot use that method to set the Attachment and OLE Object data types; you must set those data types manually by using the Set Data Type list on the Datasheet tab, or by using the table designer. The steps in this section explain how to use both methods to set the data types. Datasheet tab, in the Data Type & Formatting group, click the down arrow next to Data Type Dr. Anup Kumar

Manage the fields in a datasheet Right-click a column header and select a command from the shortcut menu.

Table using Design View Dr. Anup Kumar

Difference between Datasheet View & Design View Datasheet view shows the data in the database. It also allows you to enter and edit the data. Design view shows the field and their data types along with other properties, but not the data and we can also make changes to the design of the table. WHEREAS  The datasheet view shows the actual data and we can also change the data in it, but not the design of the table.

Difference between Datasheet View & Design View It does not let you change the format of the database only minor changes can be made to the actual database format. One such change that can be made to the format is adjusting the column width of a table 2. Fields can also be configured to set appropriate keys and restrictions on type of data entered in them

b)     Design view provides more control over the table structure WHEREAS Datasheet view doesn’t provide any control over the table structure.

Field Property Every table in Access is made up of fields. The properties of a field describe the characteristics and behavior of data added to that field. A field's data type is the most important property because it determines what kind of data the field can store.

Data types can seem confusing for example, if a field's data type is Text, it can store data that consists of either text or numerical characters. But a field whose data type is Number can store only numerical data. So, you have to know what properties are used with each data type. A field's data type determines many other important field qualities, such as the following: Which formats can be used with the field. The maximum size of a field value. How the field can be used in expressions. Whether the field can be indexed. A field's data type can be predefined or you will select a data type depending on how you create the new field. For example, if you create a field from the Datasheet view and:

Field properties A field's data type does not only determine the type of data you can put in. It also determines theproperties you can set on the field as you will see in the next sections.  The Text data type The Text data type is used very often for names, descriptions, titles, et cetera. Text fields can contain a maximum of 255 characters of tex

The maximum number of characters you can enter The maximum number of characters you can enter. The largest maximum you can set is 255.

Property Explanation Field Size The most important properties of the Text are below. Property Explanation Field Size The maximum number of characters you can enter. The largest maximum you can set is 255. Format Rules for the display of this field in the datasheet Input mask In input mask is a pattern that all data entered in this field must adhere to Caption When a caption text is entered, it is displayed as a field label in forms. If nothing is filled out, the filed name is used for this purpose. Default value The default value is inserted by Access automatically when no other value is supplied for the field. Validation rule A rule that validates the input. Read more on validation rules in the validation rules tutorial. Required Indicated whether a value is required for this field. Access will show an error message and won't insert the new record if you try to insert a new record that has no value for a required field. Allow Zero Length Indicates whether you are allowed to insert a text that contains zero characters.  Indexed Apply an index when you want to allow for fast searching on the field's contents or when you want to impose a unique constraint (Select "Yes, no duplicates") on the field.

The Number data type The Number data type in Access is a data type for different types of numbers, like Integer, Long Integer, Byte, Decimal, et cetera. The exact number type is configured using the Field Size property. When creating a new Number field the Field Size property defaults to Long Integer. So by default, the Number field can contain whole numbers.

InputMask You can use the InputMask property to make data entry easier and to control the values users can enter in a text box control. An input mask is a set of simple rules that specifies the format in which data can be entered into a field Add two zeros, so that the input mask becomes: 99->L<LL-0000 This will ensure the user enters the date as DD-MMM-YYYY. For example, 20-Mar-2016.

Our Input Mask Explained The 99 part defines two optional numbers (i.e. for the day). So the user has a choice of entering that part of the date. But if they do, it must be a number. The >L specifies that the user must enter an uppercase letter for that part of the date. The <LL specifies two lowercase letters for that part of the date. The 0000 specifies four numbers for that part of the date.

Characters that define input masks User must enter a digit 9 User can enter a digit # User can enter a digit, space, plus or minus sign. If skipped, Access enters a blank space. L User must enter a letter ? User can enter a letter A User must enter a letter or digit a User can enter a letter or digit

The Date/Time data type

The Currency data type The Currency data type also adapts to the region and language settings of the operating system. But you can override this behaviour.

The Yes/No datatype The Yes/No datatype is called a boolean data type in most databases. The Yes/No data type is pretty simple. It just lets you chose between Yes and No :). This data type is used for yes/no questions. Does this user want to receive our weekly newsletter? Yes or no? Have we received payment for this order? Yes or No?

The Hyperlink datatype The Hyperlink datatype is a text field, but a bit fancier. It won't surprise you that this field is used to store links. In the data sheet, the stuff you type into a Hyperlink field is automatically prepended with http:// by Access and it is displayed as a clickable link.   The Attachment datatype The Attachment datatype is used to store one or more files in a database field. If you set a field to the Attachment data type a small paperclip will display in the Access data sheet. 

The calculated data type The calculated data type lets you store the result of a calculation that includes data from other fields, like the amount of product x the product price. In database design it is considered bad practice to store information that can be derived from other fields, because you would be storing the same information in two locations and you would be forced to manage that information in two places. 

Validation Rule

Database View Pivot Table View Pivot chart View Design View

About restricting or validating data provides a variety of ways to control how users enter data into your database. 1. Using data types and field properties to restrict or validate data in tables Text Date Number Data and Time etc. 2. Validation rules For example, you can limit the data that a user can enter into a field by defining a validation rule for that field. If the data that a user enters into the field breaks the rule, Access will display a message telling the user what kind of entries are allowed. Another method of controlling data entry is to create an input mask to restrict the kind of values that can be entered in positions across the field. You can perform these simple forms of validation and restriction by setting properties for fields in tables, or by setting properties for controls on forms.

Validation Rules Validation rule  display a message telling the user what kind of entries are allowed. valid input values for a field or record in a table, check the value entered into a field as the user leaves the field. rule to limit what will be accepted prevent bad data being saved in your table ValidationText displays the message specified in the ValidationText property when t he rule is violated.)

You can use the ValidationRule property to specify requirements for data entered into a record, field, or control. When data is entered that violates the ValidationRule setting, you can use the ValidationText property to specify the message to be displayed to the user. Read/write String Microsoft Access automatically validates values based on a field's data type; for example, Microsoft Access doesn't allow text in a numeric field. You can set rules that are more specific by using the ValidationRule property. If you set the ValidationRule property but not the ValidationText property, Microsoft Access displays a standard error message when the validation rule is violated. If you set the ValidationText property, the text you enter is displayed as the error message.

Accept letters (a - z) only Is Null OR Not Like "[!a-z]" To do this ... Validation Rule for Fields Explanation Accept letters (a - z) only Is Null OR Not Like "[!a-z]" Any character outside the range A to Z is rejected. Accept digits (0 - 9) only Is Null OR Not Like "[!0-9]" Any character outside the range 0 to 9 is rejected. (Decimal point and negative sign rejected.) Digits and letters only Is Null OR Not Like "[!((a-z) or (0-9))]" Accepts A to Z and 0 to 9, but no punctuation or other characters. Exactly 8 characters Is Null OR Like "????????" The question mark stands for one character. Exactly 4 digits Is Null OR Between 1000 And 9999 For Number fields. Is Null OR Like "####" For Text fields. Positive numbers only Is Null OR >= 0 Remove the "=" if zero is not allowed either. No more than 100% Is Null OR Between -1 And 1 100% is 1. Use 0 instead of -1 if negative percentages are not allowed.

Not a future date Is Null OR <= Date()   Email address Is Null OR ((Like "*?@?*.?*") AND   (Not Like "*[ ,;]*")) Requires at least one character, @, at least one character, dot, at least one character. Space, comma, and semicolon are not permitted. You must fill in Field1 Not Null Same as setting the field's Required property, but lets you create a custom message (in the Validation Text property.) Limit to specific choices Is Null OR "M" Or "F" It is better to use a lookup table for the list, but this may be useful for simple choices such as Male/Female. Is Null OR IN (1, 2, 4, 8) The IN operator may be simpler than several ORs.

Yes/No/Null field Is Null OR 0 or -1 The Yes/No field in Access does not support Null as other databases do. To simulate a real Yes/No/Null data type, use a Number field (size Integer) with this rule. (Access uses 0 for False, and -1 for True.) To do this ... Validation Rule for Table Explanation A booking cannot end before it starts ([StartDate] Is Null) OR ([EndDate] Is Null) OR ([StartDate] <= [EndDate]) The rule is satisfied if either field is left blank; otherwise StartDate must be before (or the same as) EndDate. If you fill in Field1, Field2 is required also ([Field1] Is Null) OR ([Field2] Is Not Null) The rule is satisfied if Field1 is blank; otherwise it is satisfied only if Field2 is filled in. You must enter Field1 or Field2, but not both ([Field1] Is Null) XOR ([Field2] Is Null) XOR is the exclusive OR.

A Validation rule of >= #01/01/2000# and <Date() (meaning after Jan 1 2000 and before Today <>0 Enter a zero value (Zero is not accepted) msg shown I u enter 0 0 Or >100 Value must be either 0 or over 100 Like "P???" Value must be four characters beginning with the letter P. <#1/1/99# Enter a date before 1999 >=#1/1/98# And <#1/1/99# The date must be in 1998 >=Date() Date can't be before today's date >=Date()+365 Date must be at least one year from today

Input mask where data is to be entered as well as what kind of data and how many characters are allowed.) Use an input mask to simplify data entry in Access It's much easier to enter phone numbers if you don't have to type the hyphens and parentheses

Character Description Digit (0 through 9, entry required; plus [+] and minus [-] signs not allowed). 9 Digit or space (entry not required; plus and minus signs not allowed). # Digit or space (entry not required; blank positions converted to spaces, plus and minus signs allowed). L Letter (A through Z, entry required). ? Letter (A through Z, entry optional). A Letter or digit (entry required). a Letter or digit (entry optional). & Any character or a space (entry required). C Any character or a space (entry optional). . , : ; - / Decimal placeholder and thousands, date, and time separators. (The actual character used depends on the regional settings specified in Microsoft Windows Control Panel.) < Causes all characters that follow to be converted to lowercase. > Causes all characters that follow to be converted to uppercase.

! Causes the input mask to display from right to left, rather than from left to right. Characters typed into the mask always fill it from left to right. You can include the exclamation point anywhere in the input mask. \ Causes the character that follows to be displayed as a literal character. Used to display any of the characters listed in this table as literal characters (for example, \A is displayed as just A). Password Setting the InputMask property to the word Password creates a password entry text box. Any character typed in the text box is stored as the character but is displayed as an asterisk (*).

Create a Lookup Column If a field can contain a finite list of values, you can create a Lookup Column and users can select the value they want from a list. For example, if the employees at a school can only work in one of the following departments: Administration, Computer Science, English, History, or Math. You can create a table Departments table that lists the departments and then use the list in the Employee table to assign each employee to a departme

Guide to table relationships One of the goals of good database design is to remove data redundancy (duplicate data). To achieve that goal, you divide your data into many subject-based tables so that each fact is represented only once

Types of table relationships A one-to-many relationship Consider an order tracking database that includes a Customers table and an Orders table. A customer can place any number of orders. It follows that for any customer represented in the Customers table, there can be many orders represented in the Orders table. The relationship between the Customers table and the Orders table is, therefore, a one-to-many relationship. To represent a one-to-many relationship in your database design, take the primary key on the "one" side of the relationship and add it as an additional field or fields to the table on the "many" side of the relationship. In this case, for example, you add a new field — the ID field from the Customers table — to the Orders table and name it Customer ID. Access can then use the Customer ID number in the Orders table to locate the correct customer for each order.

A many-to-many relationship Consider the relationship between a Products table and an Orders table. A single order can include more than one product. On the other hand, a single product can appear on many orders. Therefore, for each record in the Orders table, there can be many records in the Products table. In addition, for each record in the Products table, there can be many records in the Orders table. This type of relationship is called a many-to-many relationship because, for any product, there can be many orders and, for any order, there can be many products. Note that to detect existing many-to-many relationships between your tables, it is important that you consider both sides of the relationship. To represent a many-to-many relationship, you must create a third table, often called a junction table, that breaks down the many-to-many relationship into two one-to-many relationships. You insert the primary key from each of the two tables into the third table. As a result, the third table records each occurrence, or instance, of the relationship. For example, the Orders table and the Products table have a many-to-many relationship that is defined by creating two one-to-many relationships to the Order Details table. One order can have many products, and each product can appear on many orders.

Understanding referential integrity

Open the table to which you want to add a lookup column. Click the field label for the field before which you want to add a lookup column. Activate the Datasheet tab. (You must be in Datasheet view.) Click the Lookup Column button in the Fields & Columns group. The Lookup Wizard appears. Make sure the radio button next to “I want the lookup column to look up the values in a table or query.” is selected. Click Next. The Lookup Wizard moves to the next page. Select your table or query A lookup column can be based on a table, a query, or a list of values you type. If you base your lookup column on a table or query, you must create the table or query before creating the lookup column. A query is a list of rows and columns based on one or more tables. A query only displays the rows and columns you specify.

Click a radio button to select what you want to base your lookup column on. Choose from Tables, Queries, or Both. Click to select the table or query you want. Click Next. The Lookup Wizard moves to the next page.

Select fields You choose the fields you want to appear in your lookup column. Be sure to include the primary key

Click the field you want. Click the single right-arrow button . Access places the field in the Selected Fields column. Repeat this process to select additional fields. If you want all the fields in the table, click the double right-arrow button . Note: Use the single left-arrow  and the double left-arrows  to deselect fields. Click Next. The Lookup Wizard moves to the next page.