Professional Documents
Culture Documents
Chapter 18 - Data Manipulation
Chapter 18 - Data Manipulation
Learning objective
Students will be able to
• Define Flat file Database and Relational Database
• Create a data base in MS access
• Create report, data entry forms , queries and Labels in MS Access
Database
• Database – Organised collection of data
• Field - column
• Record – Row . Collection of fields
• File - Collection of records
• 2 types of Database
• Flat file Database
• Relational Database
Flat file Database
• Store data in one file
Relational Database
• Store data in more than one linked table
• Same data is not stored many times
• Each table must have keys
• Primary key
• A primary key is used to ensure data in the specific column is unique.
• It cannot have NULL values.
• Only one primary key is allowed in a table.
• Foreign key
• It points to primary key of another table
• More than one foreign key is allowed
STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in STUDENT table.
Benefits of relational database
• Flexible to make changes
• Reduce redundancy
• Ease of backup and disaster recovery
• Save storage space
Data types
• Alphanumeric ( text / number)
• Numeric
• Integer
• Decimal
• Currency
• Date and time
• Boolean
etc…
Create a flat file database from an existing
file
From the dialogue box we can set column names, data types, etc.
To add a new column to table
Creating relationship between tables
• Database tools Relationships
Create a data entry form
• Create Form wizard
• In the dialogue box we can select columns, give name to forms, etc..
Different Form views
Queries
Queries
• To search or manipulate data
• It select a subset of data from table
• Create Query wizard
• From this dialogue box we can select columns, give name to query, etc.
Click on “Run” to execute Query
In bottom section we can set criteria and can add new columns
Different Query views
Query Criteria
• Query criteria helps you to retrieve specific items from database.
• If an item matches with all the criteria you enter, it appears in the
query results.
Formulae and Arithmetic operations
Mark: [Score]/60
• To set the “Mark” column value to “Score / 60”
• To set “Current_Salary” column to
Value in “Basic_Pay” column + [ Value in “Year_Service” column * 400 ]
• Generally accepted email format: Is Null OR ((Like "*?@?*.?*") AND (Not Like
"*[ ,;]*"))