Operate DB App
Operate DB App
A relationship in Access helps you combine data from two different tables. Each relationship
consists of fields in two tables with corresponding data.
Primary key
A primary key is a single field or combination of fields in a table that uniquely identifies each
record in that table. No two records can have the same value in the primary key field or
combination of fields.
A foreign key
A foreign key is a field (or fields) in one table that references the primary key in another table.
The data in the fields from both tables is exactly the same, and the table with the primary key
record (the primary table) must have existing records before the table with the foreign key record
(the foreign table) has the matching or related records. Like primary keys, you can define foreign
keys in the table declaration by using the CONSTRAINT clause.
There are essentially three types of relationships:
One-to-one: - For every record in the primary table, there is one and only one record in the
foreign table.
One-to-many: - For every record in the primary table, there are one or more related
records in the foreign table.
Many-to-many: For every record in the primary table, there are many related records in
the foreign table, and for every record in the foreign table, there are many related records
in the primary table.
Referential integrity
Referential integrity is a system of rules that Access uses to make sure that relationships between
records in related tables are valid, and that you do not accidentally delete or change related data.
You can set referential integrity when all the following conditions are true:
The matching field from the primary table is a primary key or has a unique index.
The related fields have the same data type.
Introduction to customizing Access
The ribbon is the strip of tabs across the top of the program window that contains groups
of commands.
The Backstage view is the collection of commands that you see on the File tab on the
ribbon.
The Navigation Pane is the pane on the left side of the Access program window that lets
you work with database objects.
Navigation pane
The Navigation pane is a list containing every object in your database. For easier viewing, the
objects are organized into groups by type. You can open, rename, and delete objects using the
Navigation pane.
Introduction to report
A report is an object in MS Access that is designed for formatting, calculating and printing
selected data in an organized way. It contains information from tables and also information that
are there in the report design. Reports are helpful as they allow you to present all information of
your database in an easy-to-read format.
Introduction to forms
Forms can be used both for adding and editing data, as well as for browsing and presenting data.
a form is an object that generally serves three purposes:
1. To allow users to perform data entry. Data can be inserted, updated, or deleted from a
table using a Form object.
2. To allow users to enter custom information, and based on that information perform a
task. For example, you may want to ask a user for parameters before running a report.
3. To allow users a method of navigating through the system. For example, you may
create a form where a user can select a form to load, a report to run, etc.
A form is: -
A form is a database object that you can use to create a user interface for a database
application.
It mainly used to ease the process of data entry or editing.
Data in a form can be selected from one or more tables.
Forms can also be used to control access to data, like which fields or rows of data are
visible to which users.
Forms have a Form View.
Help you to display live data with easy creation of new data.
There are four primary ways to create the form
1. Form Wizard
2. Default Form
3. Multiple Item
4. Split Form
Different Views of form:
Form View: - this view allows you to view, create and edit records.
Layout View: - this view is similar to Design View but is more visually-oriented in that each
control displays real data. As a result, this is a very useful view for setting the size of controls, or
performing many other tasks that affect the visual appearance and usability of the form.
Design View: - this view gives you a more detailed view of the structure of the form. You can
see the header, detail, and footer sections for the form. You cannot see the underlying data while
you are making design changes.
Access offers many different types of command buttons, but they can be divided into a few main
categories:
Record Navigation command buttons, which allow users to move among the
records in your database.
Record Operation command buttons, which let users do things like save and print
a record.
Form Operation command buttons, which allow users to quickly open or close a
form, print the current form, and perform other actions
Report Operation command buttons, which offer users a quick way to do things
There are various types of queries for different uses but for this session we will just focus on the
Select queries:
Select queries :- A select query is the most common type of query. It retrieves data from one or
more tables and displays the results in a datasheet where you can update the records (with some
restrictions). You can also use a select query to group records and calculate sums, counts,
averages, and other types of totals.
Parameter queries - A parameter query is a query that when run displays its own dialog box
prompting you for information, such as criteria for retrieving records or a value you want to
insert in a field. You can design the query to prompt you for more than one piece of information.
Crosstab queries :- You use crosstab queries to calculate and restructure data for easier analysis
of your data. Crosstab queries calculate a sum, average, count, or other type of total for data that
is grouped by two types of information one down the left side of the datasheet and another across
the top.
Action queries
An action query is a query that makes changes to or moves many records in just one operation.
There are four types of action queries:
Delete Queries: - A delete query deletes a group of records from one or more tables. For
example, you could use a delete query to remove products that are discontinued or for which
there are no orders. With delete queries, you always delete entire records, not just selected fields
within records
Update Queries: - An update query makes global changes to a group of records in one or more
tables. For example, you can raise prices by 10 percent for all dairy products, or you can raise
salaries by 5 percent for the people within a certain job category. With an update query, you can
change data in existing tables
Append Queries: - An append query adds a group of records from one or more tables to the end
of one or more tables. For example, suppose that you acquire some new customers and a
database containing a table of information on those customers. To avoid typing all this
information into your own database, you'd like to append it to your Customers table
Make-Table Queries: - A make-table query creates a new table from all or part of the data in
one or more tables. Make-table queries are helpful for creating a table to export to other
Microsoft Access databases or a history table that contains old records