Chapter 5 It
Chapter 5 It
Note:
Some other popular RDBMS are Oracle, SQL Server, MySql, DB2, MemSQL, Apache Derby,
Amazon Aurora etc.
Starting MS Access
Alternatively, you can click on Start button → type 'access' in the Search and click Access option
when it is listed in the menu.
In Windows 7
2. A pop-up window appears. Give a name for your file in File name box.
You can select the location to save your file by clicking on Browse button.
The New database is created with given database name.
Access database provides several database objects. One or more objects can be formed when
a database is created. These objects are stored in a single database file.
The following table identifies the database objects you can use while creating an Access
database.
Database objects
Queries-Query returns the result of the question asked by the database user.
Forms-Forms enable us to enter and view the data into tables in an easy way.
Reports- Reports are used to represent the data from tables or queries into printable format.
Macros-Macros help us to perform routine tasks by automating them into a single command.
Modules-Modules are used to group the tasks and use them later.
Tables
Table is the primary object of a database, which is used to store data in tabular format. There
are three ways of creating tables in MS Access. Let us learn about the basic method to create a
table.
Design View
Table Design view is used to create the structure of the table by specifying the field name, data
types and the properties of each column. The steps to create a table using design view are:
1. Click on Create tab.
2. In Tables group, click on Table Design.
5. Set a suitable data type for field name in Data Type section.
Note:
Data Type
The Data Type describes the type of data that can be stored in a column. Some of the common
data types are explained below:
Short/Long Text-It stores the text which might be an alphabet, a number or both.
Auto Number-It stores auto-generated numbers and automatically increases the value.
Date/Time-It stores the date and time values in different formats.
Yes/No-It stores only those values which have two answers: True/False.
OLE Object-It stores the data from other software like Word, Excel etc.
Amazing Fact
The default Data Type for a field is Short Text, with the field size '255'.
6. You can also give the description of the field in Description section. It helps a new user of the
table to understand the aim of a field.
7. After entering the field names and their data types save the table by following methods:
The Save As dialog box appears. Type the table name and click on OK button.
3. A 'key' icon appears before the selected field name and set as primary key of the table.
4. Click on Close button to close the table design view,
Shortcut
To close any view/window in the working area, right-click on the tab and select Close option.
Enter data in a Table
After creating the table data can be entered in it.
4. Now, move to the cells in a row (by clicking in the cells or using arrow keys of keyboard) and
enter the data.
5. After entering the data, close the table (in working area).
Remember that data will be saved automatically. Access will not ask you to save the data in the
table.
This action activates the cursor in first cell of new row (already shown below the last record,
having 'zero' values.
B. To delete a record:
C. To copy a record:
1. Right-click on row-header of the record (that you want to copy) and select Copy option.
2. Now, right-click on row-header of the new/blank record and select the Paste option.
°If you paste the data in existing row, it will replace the data with the existing one.
Do it yourself
Create a table of any ten students of your class (Roll_No, Student_Name, Address) in MS
Access.
Data in the table can be sorted. The steps to sort the data in a table are:
4. Click on Sort smallest to largest for ascending order/Sort largest to smallest for descending
order.
Queries
Basically, queries are used to access conditional data from tables. It is very difficult to extract
data from the table without a query.
Using query, we can request for data of our choice. It is also used to answer questions to
perform calculations, combine data from different tables, or to add, change or delete table data.
2. The New Query dialog box appears. The Simple Query Wizard option is selected.
Click on Ok button.
3. The Simple Query Wizard dialog box appears. Select the table/query, from Table/Query list
box, on which you want to create a query.
4. Now choose the fields in Available fields box, which you want to add in query e.g. Adm_no,
Student_Name and move them to Selected fields box using arrow buttons. Click on Next button.
Forms
A Form is a database object that can be used to create a user interface for a database
application. With the help of 'forms', you can enter and view data in an easy manner.
A Form is a collection of buttons, text boxes and labels. These are also known as controls. You
can create forms in Access Database by various methods.
2. The Form Wizard dialog box appears. Select the table/query, from Table/Query list box, on
which you want to create a form.
3. Now choose the fields in Available fields box, which you want to add in form e.g. Adm_no,
Student_Name and move them to Selected fields box using arrow buttons. Click on Next button.
Reports
Reports are the final object of our database. It is a combination of all the raw facts of the
database and presents the result with a visual meaning. Reports are also the best way to format
and print your data, and they're a good way to summarize data.
Different Sections of Report
o The Header Section is the top most section of the report. Report headers usually contain titles
and logos. Page headers usually contain column headings.
• The Details Section is the body of the report which contains the main data. All reports must
have a detail section.
• The Footer Section can appear in several places. You can create page footers that appear at
the bottom of each report page and display elements such as page numbers.
For example, if you don't want to group the data, you don't need to group headers or footers.
However, make sure that your reports contain enough information to make them meaningful and
easy to understand.
1. In the Navigation Pane, select the table or query on which you want to create a report.
2. On Create tab, click on Report icon.
2. In the Report Wizard dialog box, select the table/query, on which you want to create a report.
3. Choose the desired fields in Available fields box, e.g. Adm_no, Student_Name and move
them to Selected fields box using arrow buttons. Click on Next button.
4. Select the column on which any grouping needs to be dobe and click on Next button.
5. Select the column on which you want to sort the data (ascending/descending) and click on
Finish button.
6. Select the layout and orientation of the report and click on Next button.
7. Give a title to your report and click on Finish button. A report is created.
4. In the Theme group, click on drop-down arrow of Themes button. A thumbnail list of themes
appears.
Save the changes (you can directly click on Save icon on Quick Launch Toolbar).