Database Imp Notes
Database Imp Notes
========================================================
If you set up relations between tables, then adding or updating a record in one table reflect the changes in all the related
tables.
Editing a table involves the task such as adding a new field or removing any field in a table or to alter any of the field
properties.
To edit a table, Selecting the Table object in the Table Area of Database Pane,. Right click on the table name and select Edit
option from the pop menu.
The changes, made in the table will not affect the previous records entered in the table
The most important prerequisite for setting a relationship is that there must be a common field(s) between the two tables
to create a relationship.
If you need to set the relationship, It is important to note that the data types of the common field in both the tables must be
same.
Once the relationship between the two tables has been set, the integrity of data will be managed by the DBMS.
The type of relationship between any two tables in a database is based on the number of records that are present in the
transaction table corresponding to the master table.
Three types of relationships can be set up between two tables in a relational database.
In One-to-One relationship one specific record of a master table has one and only one corresponding record in the
transaction table.
In One-to-Many relationship, one specific record of the master table has more than one corresponding records in the
related transaction table.
In Many-to-Many relationship, there will be multiple records in the master table that correspond to multiple records in the
transaction table as well.
Creating relationships between tables restricts the user from entering invalid data in the referenced fields.
Any updation in the master table is automatically reflected in the transaction tables.
The Relationship Design screen will appear in the middle of the screen.
In Relationship, The line is labelled as ‘l’ on the primary key side and as ‘n’ on the foreign key side.
According to the principle of referential integrity, no unmatched foreign key values should exist in the database.
Update cascade –option allows the user to delete or update the referenced field but along with it all the related records in
any of the transaction tables will also be deleted or updated.
Set NULL –option assigns NULL value to all the related fields if the master record is deleted or updated.
Set default –option assigns any fixed default value to all the related fields if the master record is deleted or updated.
===============================================
By using queries, we are able to retrieve data without going individually through each record in the table(s) and also display
them in desired format.
Using a query, we can retrieve and display data from one or more tables in a database.
Using a query, we can specify the fields that we want to display and also the criterion based on which the records to be
filtered.
The information may be retrieved from a single table or from multiple tables.
The result of the query is displayed in tabular form with field names in columns and the records in rows.
A query can be created in three ways. (i) Using a Wizard (ii) In Design View (iii) In SQL view
Once the fields are added they can be moved up and down in order by clicking ∧ and ∨ buttons present on the extreme right
of the Query Wizard.
Clicking on » button moves all fields to “Fields in the Query area” and « button moves all the fields back to “Available fields”
area.
The result of the query can be displayed in ascending or descending order of any particular field of the table.
In Select search condition step of Query Wizard, By default the radio button with option Match all of the following is
selected.
Three search conditions can be given at the most in the Query wizard.
‘Match any of the following’ if any one of the given condition are to be matched for filtering the records.
By default, the field names will be displayed as column headers when we run the query.
The last step of the Query wizard displays the entire overview of the query.
When we create a Query using Wizard, the name of the query is Query_Events by default.
A tool-tip is a small piece of text that is displayed when the mouse pointer is placed on a particular control.
Design view is a more flexible method to create a query from either single or a multiple tables of a database.
By default, the data that is displayed as a result of the query is not sorted.
Once the query is designed, click Run Query button on the toolbar or press F5 key.
In the reference of queries, we can also put conditions on groups using the Criterion row.
==============================================
A form is an object of the database that has a user friendly interface where data can be entered and seen in an attractive
and easy-to-read format.
Each field control consists of a label and the field value text box.
A label is a piece of text that specifies the data that should be entered in the field value text box.
A field value text box is linked to the respective field in the table.
There are two ways to create a form: • Using a wizard • Using the Design View
The Records toolbar contains the navigation control buttons in the extreme left.
The forms control toolbar contains various tools to add or edit controls on the form.
Using a report we can present the retrieved data in an attractive and customized manner.
The Report wizard along with two other windows will be displayed. One of the window is Report Builder window and the
other is Add Field dialog box.
X=X=X=X=X=X=X=X=X=X=X=X=X=X=X=X