Chap 8 1st Year Database Development
Chap 8 1st Year Database Development
Database Development
Microsoft Access
SQL Server
Open Office Base
a) Microsoft Access
Microsoft Access is a relational database management system, in which
collection of objects i.e. tables, forms, reports, queries, macros and modules are used
to design and manipulate database. In Microsoft Access all these objects are
contained in a single file with .mdb extension.
b) SQL Server
Microsoft SQL server is a relational database management system developed
by Microsoft. Its function is to store and retrieve data as requested by other
software applications (word processors, spreadsheet, accounting applications and
web browsers etc). In SQL different tools are used for development, maintenance
and administration of database. It can be used to develop web based databases.
Opening MS Access
The following steps are used to open MS Access
Click on Start button.
Click on All Programs on the Start menu.
Click Microsoft Office on the All Programs submenu.
Click Microsoft Office Access 2007 to Open Access 2007.
Getting Started with Microsoft Office Access Screen appears, this is the starting
point from where user can create a new database or open existing database.
3
Chap8: Database Development
ii. Memo
Memo data type is also used to store alpha numeric data. Memo data type
allows user to enter long blocks of data up to 63999 characters.
This data type is used for fields like Description and Other Information etc,
which may exceed fro 255 characters.
iii. Number
Number data type allows user to enter any numeric values. By default user can
enter 255 characters in it. And its range for integer values is form -32768 to
+32768.
Size of Number data type can be increase from field size property like Single
and Double etc.
This data type can be used for fields like R_No, ID, Phone# and Emp_Id etc.
iv. AutoNumber
This data type is used to generate numeric values automatically. When new record
is entered, value for this field automatically increment by 1. This data type is
suitable for primary key attribute because it does not duplicate.
This data type is suitable for fields like ID, S_No and Product_Id etc.
v. Yes/NO
This data type is used for fields that have only two possible values Yes (True)
or No (False). In datasheet view as check box appears when it is
checked it means Yes and when unchecked means No.
This data type is used for fields like Graduate, Married, Tax_Pair and Permanent etc.
vi. Currency
This data type is used to enter currency values and default symbol for
currency data type is USA ($).
This data type allows user to enter 15 digits on left of decimal point and 4
digits on right of decimal point.
Currency data type is used for fields like Fee, Salary and Amount etc.
4
Chap8: Database Development
vii. Date/Time
This data type enables the user to enter Date and Time. Format for entering
date in MS Access is
MM-DD-YY
Different time formats can be selected form property box.Date/Time data
type cab be used for fields like D_O_B, Arrival_Time and Exit_Time etc.
ix. Hyperlink
It is used for hyperlinks. A hyperlink can be a path of web address.
a) Tables
Table is the basic unit of storing and organizing information in a database of
Ms Access 2007. A table is a set of columns and rows, where column is referred as
field name and row of a table is referred as a record.
There are following table essentials are used for designing table.
Field Name
Field Data Type
Field Description
Field Properties
b) Forms
Form is databases object which by which user can arrange fields according to
input and output of data. User can use a form to enter, edit, display and modify data
in a database. A well designed form makes data entry easier and more accurate.
c) Queries
Queries are used to retrieve specific data from database and answer the
questions about the data. For example user can use a query to find the names of
students in a database which have marks more than 800.
5
Chap8: Database Development
d) Reports
Reports organize data so that user can print it or view it on screen. Reports
are often used to analyze data or present it in different styles. Report is the end
product of database and this printed data plays a vital role in decision making for
an organization.
Ans. Table
Table is the basic unit of storing and organizing information in a database of
Ms Access 2007. A table is a set of columns and rows, where column is referred as
field name and row of a table is referred as a record.
A table can be created in following ways:
i. Field Name
Field name is column name and it can be up to 64 characters including letters,
numbers, spaces and special characters except a period (.), exclamation (!),
single quote (‘) and brackets.
Switching Views
To switch views:
Select the View command group from Home tab.
Select the view option from the menu, and then click on required view.
Ans. Forms
Form is a database object by which user can arrange fields according to input and
output of data. User can use a form to enter, edit, display and modify data in a
database. A well designed form makes data entry easier and more accurate.
A Form generally serves three purposes:
It allows users to perform data entry. Data can be inserted, updated, or deleted
from a table using a Form.
It allows users to enter information, on which task is performed. For example a
system may want to ask for information before running a report.
It allows users a method of navigating with database system. For example a form
can be created on which a report may run.
User can also add certain control components to a Form like buttons, combo
box, list box, drop down menus and sub-forms.
The following steps are used to create a form using this command.
Click on the table to use as a source table.
When source table is highlighted, select the Form command from the Forms
group in Create tab.
The new form is created and opens in the object pane.
Ans. Query
Query is the database object that enables the user to extract data from
database to use that data in another way. Query is used to retrieve records
according to user needs and answer the questions about the data.
Planning a Query
When planning a query, these questions users need to answer
What do you want the results look like?
Where is the information stored in the database?
What conditions do you want the data to meet?
Ans. Query
Query is the database object that enables the user to extract data form
database to use that data in another way. Query is used to retrieve records
according to user needs and answer the questions about the data.
Different types of queries can be created in Access 2007.
a. Select Query
b. Update Query
c. Delete Query
a. Select Query
Select query is used to extract records from one or more tables and shows
information in Datasheet view. Select query can use table or query or
combination of both as a record source.
Select query can be created using the Query Wizard or by working in Design
View. Different operations like sum, average, sorting and calculated fields can be
applied in select query.
b. Update Query
An Update Query is an action query that changes a set of records according to
some criteria (condition).
It is very powerful feature of RDBMS, since user can modify a huge number of
records at one time.
This query replaces the data in existing table. User writes update expression
in update row of design view of query.
10
Chap8: Database Development
c. Delete Query
Delete query is used to delete records form a single table or multiple tables.
Delete query removes records from tables permanently. As delete query will
permanently delete records from the specified tables, so it is important that user
has backed up the tables before running this query.
Click the primary key Roll No in first table (Student) and drag it to the Exam
Table as foreign key.
Edit Relationship dialog box will appear when mouse button is released.
Click the Create button to create the relationship (one-to-many) between tables.
Joining line from one table to the other shows the type of relationship from one
table to the other.
Editing Relationship
The following steps are used to edit relationship between tables.