Upload
tammy-carter
View
398
Download
5
Embed Size (px)
Citation preview
Data Types Data Types and and
Field PropertiesField Properties
5.01 Understand database tables used in 5.01 Understand database tables used in business.business.
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 22
It’s All in the DetailsIt’s All in the Details
Let’s dig a little deeper into the details of how data is formatted and represented in database tables
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 33
Data Types and Field PropertiesData Types and Field Properties Data types and field properties are used to
format data so that it can be used and managed The data type defines the value of a cell and the
field property defines the format of the data within the cell
For example: the data type for a zip code field is number and the field property is used to limit the size of the entry to 5 characters
Why are data types important?Why are data types important? To control data. To control data. In the example on In the example on
the the leftleft, the Age data , the Age data was sorted in was sorted in descending order, descending order, but because the but because the data type was not data type was not set as Number, the set as Number, the field cannot be field cannot be sorted correctly.sorted correctly.
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 44
In the example on In the example on the the rightright, the , the Adoption data was Adoption data was correctly sorted in correctly sorted in ascending order ascending order because the data because the data type for Date was type for Date was used. used.
Example of a Data TypeExample of a Data Type The data The data
type for the type for the adoption adoption date field is date field is date/timedate/time
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 55
What data types are available?What data types are available?
TextText MemoMemo NumberNumber Date/timeDate/time
CurrencyCurrency AutoNumberAutoNumber Yes/NoYes/No Lookup WizardLookup Wizard
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 66
Note: OLE Object and Hyperlink data types are not addressed in this objective.
When to use data types:When to use data types:
Think of data types Think of data types and field properties and field properties as tools that as tools that increase the power increase the power of the database.of the database.
The default format The default format for all data types is for all data types is text.text.
Use a different Use a different data type if you data type if you need to control need to control how the data in a how the data in a particular field will particular field will be searched, be searched, sorted, or used in sorted, or used in calculations.calculations.
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 77
Why are field properties Why are field properties important?important?
To control how data is To control how data is entered in a fieldentered in a field
Requiring the same Requiring the same format for all of the format for all of the phone numbers is a way phone numbers is a way to ensure accuracyto ensure accuracy
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 88
In this example, an Input Mask field property was used to force the user to enter the telephone number in a specific format.
Example of a Field PropertyExample of a Field Property
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 99
An input mask An input mask field property is field property is used for the used for the Adoption Date Adoption Date field to make sure field to make sure the date is the date is entered correctlyentered correctly
Actual Data
Field Properties:Field Properties:
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 1010
Field SizeField Size FormatFormat Input maskInput mask CaptionCaption
Note: Only 4 field properties are mentioned and addressed in this objective.
When to set field properties:When to set field properties:
Use a field property if you want to Use a field property if you want to specify how the data is entered, what specify how the data is entered, what data can be entered, and how the data data can be entered, and how the data will appear.will appear.
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 1111
Steps in Creating a DatabaseSteps in Creating a Database1.1. Plan the structure of the database Plan the structure of the database (sketch on paper)(sketch on paper)
a)a) How will the data be grouped?How will the data be grouped?b)b) What will the field names be?What will the field names be?c)c) What will you name the database?What will you name the database?
2.2. Open and save a new databaseOpen and save a new database3.3. Create a tableCreate a table4.4. Enter the field namesEnter the field names
a)a) Set the data typesSet the data typesb)b) Set the field propertiesSet the field properties
5.5. Enter the dataEnter the data
5.01 Understand database tables used in business.5.01 Understand database tables used in business. Side Side 1212