0% found this document useful (0 votes)
51 views51 pages

Final DBMS

best

Uploaded by

nileshstd321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views51 pages

Final DBMS

best

Uploaded by

nileshstd321
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

M.S.

P Madal’s

Shri Shivaji College,Parbhani


(Arts, Commerce and Science)
NAAC Reaccreditation with “A+” Grade

Bachelor of Computer Application


Lab Manual-Database Management System (BCA-307)

Department of Computer Science


Certificate

This is to certified that Mr. /Miss


__________________________________________
of Class _________ has successfully completed its Lab
Manual in subject _____________________________
Under the Guidance of Subject Teacher ______________
During the Academic year________

Seat No: - __________

Subject In charge External Examiner Head of Department


Index
Sr.No Contents Date Remarks
01. Write procedure for creating
database in MS-Access.
02. Create tables in MS ACCESS
using different ways.
03. Perform Import data operation in
MS ACCESS.
04. Perform export data operation in
MS ACCESS.
05. Create queries in MS ACCESS for
selection, projection, Cartesian
product.
06. Create queries in MS ACCESS for
union, intersection and difference.
07. Create queries in MS ACCESS for
different types of joins.
08. Generate forms and add new
records in MS-Access.
09. Generate the report in MS Access.

10. Generate the report in MS Access


using Report Wizard.

Subject in charge Head of Department


Assignment No:-01
Aim:-Write procedure for creating database in MS-Access.

Theory: -
In this Assignment, we will be covering the basic process of starting Access and creating a
database. This practical Assignment will also explain how to create a desktop database by
using a template and how to build a database from scratch. To create a database from a
template, we first need to open MS Access and you will see the following screen in which
different Access database templates are displayed.

To view the all the possible databases, you can scroll down or you can also use the
search box. Let us enter project in the search box and press Enter. You will see the
database templates related to project management.

Select the first template. You will see more information related to this template.

[Lab Manual-(BCA-307) Database Management System] Page 1


Create Blank Database

Sometimes database requirements can be so specific that using and modifying the existing
templates requires more work than just creating a database from scratch. In such case, we
make use of blank database.
Step 1 − Let us now start by opening MS Access.

Step 2 − Select Blank desktop database. Enter the name and click the Create button.

[Lab Manual-(BCA-307) Database Management System] Page 2


Step 3 − Access will create a new blank database and will open up the table which is also
completely blank.

[Lab Manual-(BCA-307) Database Management System] Page 3


Assignment Question:-
Q. Create a Blank Database in MS-Access with table name as yours name & attach printout.

[Lab Manual-(BCA-307) Database Management System] Page 4


Assignment No:-02
Aim: - Create tables in MS ACCESS using different ways.

Theory: -
In this Assignment, we will be covering the how to create tables using MS ACCESS different
ways. For that When you create a database; you store your data in tables. Because other
database objects depend so heavily on tables, you should always start your design of a
database by creating all of its tables and then creating any other object. Before you create
tables, carefully consider your requirements and determine all the tables that you need.

First of all you need to go in create database in create database you will see a blank table name
as table1

After that right click on table1 you will see table design view from that you will fill necessary
filed which you want to add in table with its name and data type

Field Name Data Type


EmployeelD AutoNumber
First Name Short Text
Last Name Short Text
Address1 Short Text
City Short Text
State Short Text
Phone Short Text

Sometimes the Field tab and you will see that it is also automatically created. The ID which is
an AutoNumber field acts as our unique identifier and is the primary key for this table. The ID
field has already been created and we now want to rename it to suit our conditions. This is an
Employee table and this will be the unique identifier for our employees.

[Lab Manual-(BCA-307) Database Management System] Page 5


Table Design View

After the right click on table1 you will see table design view from that you will fill necessary
filed which you want to add in table with its name and data type but before that you will see
the window in that you need to put up the table name

In the tables group, click on Table and you can see this looks completely different from the
Datasheet View. In this view, you can see the field name and data type side by side.

[Lab Manual-(BCA-307) Database Management System] Page 6


After that save the information and you will see the table with yours required field

After fill up all the required information your table will be successfully created.

Assignment Question:

Q. Create table in MS ACCESS about Students Fess information (Attach Printout output).

Q. Draw E-R Diagram Of College Management System.

[Lab Manual-(BCA-307) Database Management System] Page 7


Assignment No:-03
Aim: - Perform Import data operation in MS ACCESS.

Theory: -
In this Assignment, we will be talking about importing data in Access and what kinds of data
you can import using Access. Normally data is stored in various formats, files, and locations,
which makes it hard to get and use it. If you have data in a spreadsheet, a SharePoint list, or
some other format, you can import it into an Access database with just a few steps, making it
much more, easily available in Access. The Save As command is generally used to save a
document in another format, so that you can open it in another program. In Access you can’t
use the Save As command in the same way, you can save Access objects as other Access
objects, but you cannot save an Access database as a spreadsheet file. To save Access as a
spreadsheet file, you will need to use the import feature on the External Data tab.
Different Types of Data Access Can Import
To understand what kind of data you can import in the Access data, let us open your database
and go to the External Data tab.

In the import & Link group, you can see the different kind of options available for data import
in Access. Following are the most commonly used data import formats.
Microsoft Office Excel
Microsoft Office Access
ODBC Databases (For example, SQL Server)
Text files (delimited or fixed-width)
XML Files

[Lab Manual-(BCA-307) Database Management System] Page 8


Example
Let us look at a simple example of data importing from an Excel file. Here is the data in Access
file.

To import the data in Access, we first need to open the Access database and then go to the
External Data tab as in the following screenshot.

In Import & Link group, you will see an option Excel. Let us click on that option.

[Lab Manual-(BCA-307) Database Management System] Page 9


Browse the Excel file from which you want to import data and the then we have different
options to store data. Let us select the first option and click Ok.

[Lab Manual-(BCA-307) Database Management System] Page 10


Here you will see the preview of your data. Now, click next.

In the Preview, you can now see that the first row contains the column headings. Let us now
check the check box and click next.

[Lab Manual-(BCA-307) Database Management System] Page 11


You will now see a dialog box where you can set the data type for each column/field. If you
don’t want to import any field, just check the check box which says do not import field. Once
you are done with the First Name field, just click on the Middle Initial field.

Let us now go through all the fields and then, click next.

Here are the different options for primary key. Let us select the first option and click next.

[Lab Manual-(BCA-307) Database Management System] Page 12


In the last dialog box, you can enter the table name of your choice and click Finish.

If you want to save all these steps, then check the checkbox and close the dialog box.
Let us now go to the Navigation pane. You will see a new table is added here and when you
open the newly added table you will see all of your data in Access.

[Lab Manual-(BCA-307) Database Management System] Page 13


Assignment Question:

Q. Import the Students Result Analysis Data from Excel to MS ACCESS (Attach Printout
output).

[Lab Manual-(BCA-307) Database Management System] Page 14


Assignment No:-04
Aim: - Perform Export data operation in MS ACCESS.

Theory: -
In this Assignment, we will understand how to export data from Access. Data export is actually
the opposite of importing data. In importing data, we bring data from other formats in Access,
while in exporting we save the data in other formats.
To understand what kind of data you can export from Access data, let us open your database
and go to the External Data tab.

In the Export group, you can see the different kind of options available for data export from
Access. Following are the most commonly used data export formats −
Microsoft Office Excel
Microsoft Office Access
ODBC Databases (For example, SQL Server)
Text files (delimited or fixed-width)
XML Files
Example
Let us look at a simple example of data export from Access. Open your database where you
want to export the data from. In the Navigation Pane, select the object that you want to export
the data from.

[Lab Manual-(BCA-307) Database Management System] Page 15


You can export the data from table, query, form, and report objects etc. Let us select the
qryAllProjects and then, go to the External Data tab.
On the External Data tab, click on the type of data that you want to export to. For example, to
export data in a format that can be opened by Microsoft Excel, click Excel.

Access starts the Export wizard. In the wizard, you can set the information such as the
destination file name and format, whether to include formatting and the layout, which records
to export. Once you are done with the required information, click Ok.

[Lab Manual-(BCA-307) Database Management System] Page 16


On this screen of the Wizard, Access usually asks you if you want to save the details of the
export operation. If you think you will need to perform the same operation on a recurring basis,
select the Save export steps check box and close the dialog box.
The following Excel file opens up.

Assignment Question:

Q. Export Students Fess Details table form MS ACESS to MS Word(Attach Printout output).

[Lab Manual-(BCA-307) Database Management System] Page 17


Assignment No:-05
Aim: - Create queries in MS ACCESS for selection, projection, Cartesian product.

Theory: -
In this Assignment, we will learn how to implement selection, projection, Cartesian product
query apply on data/table from Access.

 Selection & Projection Query: In relational terminology, selection is defined as


taking the horizontal subset of rows of a single table that satisfies a particular
condition. This kind of SELECT statement returns some of the rows and all the columns
in a table. And In relational terminology, projection is defined as taking a vertical
subset from the columns of a single table that retains the unique rows. This kind of
SELECT statement returns some of the columns and all the rows in a table.
Or
A select query helps you retrieve only the data that you want, and also helps you
combine data from several data sources. You can use tables and other select queries as
data sources for a select query.

Create Select Query:

If you want to review data from only certain fields in a table, or review data from multiple tables
simultaneously or maybe just see the data based on certain criteria, you can use the Select
query. Let us now look into a simple example in which we will create a simple query which will
retrieve information from tblEmployees table. Open the database and click on the Create tab.

Click Query Design.

[Lab Manual-(BCA-307) Database Management System] Page 18


In the Tables tab, on the Show Table dialog, double-click the tblEmployees table and then close
the dialog box.

In the tblEmployees table, double-click all those fields which you want to see as result of the
query. Add these fields to the query design grid as shown in the following screenshot.

[Lab Manual-(BCA-307) Database Management System] Page 19


Now click Run on the Design tab, then click Run.

The query runs, and displays only data in those fields which is specified in the query.

[Lab Manual-(BCA-307) Database Management System] Page 20


 Cartesian product Query:
“A Cartesian product is defined as "all possible combinations of all rows in all
tables."

For example, if you were to join two tables without any kind of qualification or join
type, you would get a Cartesian product.

MS Access Queries: The Cartesian product Effect – How to Create It

Imagine you wanted to show a permutation of all record instances for date, month and year
which have been stored in separate tables where the ‘Days‘ table contained 31 records (for each
day of a maximum month), the ‘Months‘ table for each month of the year (12 records) and the
‘Years‘ tables containing as many years as needed for the database process (which in this
example I’m using 6 records (2010 to 2015).

Now the total product of all records between the three tables should yield 2,232 assuming
there are 31 days for each month (which of course that’s not true!) but keeping it simple, this
total is the product of using the formula of 31 x 12 x 6 = 2,232.

The SQL statement for the above looks like:

SELECT tbl_Days.Day, tbl_Months.Month, tbl_Years.Year

FROM tbl_Days, tbl_Months, tbl_Years;

Notice there are no joins of any description and the more non-related tables there are the
bigger the product effect.

In reality, this example is useless unless of course you add filters to exclude months that end
with either 28, 29 or 30 days which will mean a way to suppress non valid dates

Assignment Question:

Q. Perform Selection query in MS Access (Attach Printout output).

[Lab Manual-(BCA-307) Database Management System] Page 21


Assignment No:-06
Aim: - Create queries in MS ACCESS for union, insertion and difference.

Theory: -
In this Assignment, we will learn how to implement union, insertion, difference query apply on
data/table from Access.

Union:

This assignment gives the importance and the use of Union Queries and also gives steps to
effectively use it to get combined results.

Suppose a user has an MS Access database with two unrelated tables, one with client data and
another with customer data. We assume that both these tables will have a field for contact
information. Now if the user wants to see contact information in one view of both these tables,
he will have to use the Union Query.

Union Query is used for selecting and retrieving information from more than one table in a
single go. To do this, the user needs to select the query from each table, which will retrieve the
data and then combine the result, by creating the union query.

Steps to Create Select Queries:

Step 1: Go to Create Tab in Queries group and open Query Design.

Step 2: Select the Table with the fields that you want to add from the Show Table. The table
will be automatically added on your Query Design Window.

Step 3: Close Show Table dialog box.

Step 4: Now select the fields, from the Query Design Window.

Ensure to select the same order and number of fields that you are adding to the other select
query. Also, check whether the data types in each field are compatible with each other or not.

Step 5: Now add the criteria in the field with the appropriate expressions.

Step 6: Run the select query, and recheck its output. Open Design tab, from Results group,
and click Run.

Step 7: Switch to Design View.

Step 8: Now save your select query, without closing

Step 9: Repeat the procedure for each select query that the user wants to combine.

Steps to Combine Select Queries

Access displays the SQL view object tab while hiding Query Design Window. And at this time
the SQL view Tab is empty.

[Lab Manual-(BCA-307) Database Management System] Page 22


Combine Select Queries:

Step 1: Select the tab of first select query that the user wants to combine as a union query.

Step 2: Go to Home tab, Click on View > SQL View.

Step 3: Copy and insert the SQL statement for select query. Now open the tab, which you
created in the above steps for ‘Creating a union Query’.

Step 4: Paste the SQL statement in SQL View Object in the union query.

Step 5: Delete the semicolon (;) placed at the end of a select query in its SQL statement.

Step 6: Press Enter so that the cursor moves down one line, then type UNION in the new line.

Step 7: Select the tab for next query that the user wants to combine in Union Query.

Step 8: Repeat all the steps till 5, until the user has copied and pasted all the SQL statements
for select query in Union Query’s SQL View Window. Don’t delete the semicolon from the last
SQL statement or query.

Step 9: Go to Design tab, in Results group, then click Run.

The results of the user’s query will automatically appear on your screen in a Datasheet view.

Insertion:

An Access database is not a file in the same sense as a Microsoft Office Word document or a
Microsoft Office PowerPoint are. Instead, an Access database is a collection of objects like
tables, forms, reports, queries etc. that must work together for a database to function properly.
We have now created two tables with all of the fields and field properties necessary in our
database. To view, change, insert, or delete data in a table within Access, you can use the
table’s Datasheet View.

 A datasheet is a simple way to look at your data in rows and columns without any
special formatting.
 Whenever you create a new web table, Access automatically creates two views that you
can start using immediately for data entry.
 A table open in Datasheet View resembles an Excel worksheet, and you can type or
paste data into one or more fields.
 You do not need to explicitly save your data. Access commits your changes to the table
when you move the cursor to a new field in the same row, or when you move the cursor
to another row.
 By default, the fields in an Access database are set to accept a specific type of data,
such as text or numbers. You must enter the type of data that the field is set to accept.
If you don't, Access displays an error message −

Let us add some data into your tables by opening the Access database we have created.

[Lab Manual-(BCA-307) Database Management System] Page 23


Select the Views → Datasheet View option in the ribbon and add some data as shown in the
following screenshot.

Similarly, add some data in the second table as well as shown in the following screenshot.

[Lab Manual-(BCA-307) Database Management System] Page 24


You can now see that inserting a new data and updating the existing data is very simple in
Datasheet View as working in spreadsheet. But if you want to delete any data you need to
select the entire row first as shown in the following screenshot.

[Lab Manual-(BCA-307) Database Management System] Page 25


Assignment No:-07
Aim: - Create queries in MS ACCESS for different types of joins.

Theory: -
A database is a collection of tables of data that allow logical relationships to each other. You
use relationships to connect tables by fields that they have in common. A table can be part of
any number of relationships, but each relationship always has exactly two tables. In a query, a
relationship is represented by a Join.

What is Join

A join specifies how to combine records from two or more tables in a database. Conceptually, a
join is very similar to a table relationship. In fact, joins are to queries what relationships are to
tables.

The following are the two basic types of joins that we will be discussing in this chapter −

 The inner join


 The outer join

Both of which can easily be created from a queries design view.

Inner Join

Let us now understand Inner Join −

 The most common type of join is an inner join which is also the default join type in
Microsoft Access.
 Inner Join will display only the rows or records where the joined fields from both tables
are equal.
 This join type looks at those common fields and the data contained within. It only
displays the matches.

Outer Join

Let us now understand what an Outer Join is −

 An outer join displays all rows from one table and only those rows or records from the
other table where the joined fields are equal.

[Lab Manual-(BCA-307) Database Management System] Page 26


 In other words, an outer join shows all rows from one table and only the corresponding
rows from the other table.

There are other Join types too −

Left Outer Join & Right Outer Join

Let us now understand Left Outer Join and Right Outer Join −

 You can choose the table that will display all rows.
 You can create a Left Outer Join which will include all the rows from the first table.

 You can create a Right Outer Join that will include all the rows from the second table.

Let us now go to the Create tab and create a query from the Design View. Select tblProjects and
tblTasks and close the Show Table dialog box as in the following screenshot.

[Lab Manual-(BCA-307) Database Management System] Page 27


Add the ProjectName field from tblProjects, and TaskTitle, StartDate and DueDate from
tblTasks table.

Let us now run the query.

[Lab Manual-(BCA-307) Database Management System] Page 28


We are only displaying records from a few projects. A couple of these projects have a lot of
tasks associated with that project and this information is related through ProjectID field.

 When we create this query in Microsoft Access, Access is taking this relationship from
the relationships we have created.
 By default, it is creating what's known as an Inner Join between these two fields,
between these two tables, and that is how it is relating this information together from
these two tables.
 It is showing us only the matches, so when we run this query, there are a lot of other
projects listed in tblProjects that do not appear as part of our records set in this query,
and that is because of how these two tables are joined together, through that Inner
Join, which is again, that default Join for any query.

However, if you want to alter the relationship, Let us say you want to create an outer join, or in
other words, show all of the projects from tblProjects, every single record that is in that table,
along with all of the tasks from tblTasks — Open join properties; we can do this simply by
double-clicking on the relationship line.

[Lab Manual-(BCA-307) Database Management System] Page 29


Access will display the left table name and the right table name in Join Properties dialog.

 The left column name and the right column name and the first radio button is to only
include rows where the join fields from both tables are equal and that is the inner join
and that is what is selected by default when creating relationships, when creating a join
in the query, but, you can change it.
 We have two other options as well; we can include all records from tblProjects, and only
those records from tblTasks where the joined fields are equal and this one is Left Outer
Join.
 We have a third option, include all records from tblTasks and only those records from
tblProjects where the joined fields are equal and this one is Right Outer Join.

Those are the different types of joins you can create easily from the Design View. Let us select
the second option, which is Left Outer Join, and click Ok.

Let us now look into the other steps −

When you look at the relationship line, you will see a little arrow pointing towards Project ID in
tblTasks. When you run this query, you will see the following results.

[Lab Manual-(BCA-307) Database Management System] Page 30


As you can see that it is showing us every single project name, whether or not it has a related
task. You will also see a bunch of null fields. All of this will be blank because there is no
related information in tblTasks, where these fields come from. Let us now go to the Design View
again and double-click on the relationship line.

In the Join Properties dialog box, select the third option which is for the Right Outer Join and
click Ok.

[Lab Manual-(BCA-307) Database Management System] Page 31


Now look at our relationship line. You will see that a little arrow is now pointing towards
ProjectID in tblProjects. When you run this query you will see the following results.

[Lab Manual-(BCA-307) Database Management System] Page 32


Self-Joins

Self-join is another type of Join. A Self-join relates matching fields from within the same table.
For example, look at the employee's table with a supervisor field, which references the same
kind of number stored in another field within the same table — the employee ID.

If we wanted to know who Kaitlin Rasmussen's supervisor is, we will have to take the number
stored in that supervisor field and look it up within the exact same table in that employee ID
field in order to know that Charity Hendricks is the supervisor.

This table is not the ideal structure for a relational database because it's not normalized.

If we have a situation where we want to create a query that just lists the employee names
alongside the names of their supervisors, there is no easy way we can query that unless we
create a Self-join.

To see a Self-join, create a table with the following fields and enter some data.

[Lab Manual-(BCA-307) Database Management System] Page 33


Here we want to create a list again with the first name of the employee and then the name of
the supervisor. Let us create a query from the query design view.

Now, add tblEmployees tables.

[Lab Manual-(BCA-307) Database Management System] Page 34


Close this dialog box.

Now, add the first name and last name for our employees.

[Lab Manual-(BCA-307) Database Management System] Page 35


We now need a way to create a relationship between this table and itself. To do that, we need to
open the show table dialog box and add tblEmployees one more time.

We have created another copy of the same table in this query view. Now, we need to create Self-
join. To do that, click on Supervisor in tblEmployees table and hold the mouse button and drop
it right on top of the EmployeeID in that copied table — tblEmployees_1. Then, add the first
name and last name from that copied table.

[Lab Manual-(BCA-307) Database Management System] Page 36


Let us now run your query and you will see the following results.

It displays the names of the employees alongside the names of their supervisors. And, this is
how you create a Self-join in Microsoft Access.

Assignment Question:-

Q. Crate 2 tables and show the relationship between 2 tables (Attach Printout output).

[Lab Manual-(BCA-307) Database Management System] Page 37


Assignment No:-08
Aim: - Generate forms and add new records in MS-Access.

Theory: -
In this tutorial we learn about how to design/Generates Forms and adding new record in MS-
Access. There are many ways to add data to a Microsoft Access Table. Using Forms is the
easiest way to build your database. If you use Microsoft Access, you already know the many
ways to add data to your databases. Most users use the table method as that’s the easiest way
to view and add new data. However, the problem with that is you need to go through your
existing data before you can add new. There are also chances of accidentally modifying your
existing data with the table method. Luckily, Access has something called Forms that lets you
work on one entry at a time to add new data to your tables. Forms are an easy way to both edit
as well as store new items in your tables, and you should start using them if you don’t already.

1. How to Create a Form in Microsoft Access

Before you can create a form in Microsoft Access, you should have created at least one table in
your database. This is the table that you’ll add data to from your newly created form.

Once your table is ready with some columns in it, follow these steps to add a form for it:
1. Select your database table by clicking on it in Access.
2. Click the Create tab at the top, find the Forms section, and select Form

3. Microsoft Access will create a new form with all the columns of your table as fields.

4. You can now edit and also add new data to your table with this form. Use the pagination at
the bottom to go through your table records.

5. Click the Save icon at the top-left corner to save your newly created form.

6. Enter a descriptive name for your form and click OK to save it.

[Lab Manual-(BCA-307) Database Management System] Page 38


2. How to Create a Blank Form in Microsoft Access

The above method creates a form with all your table’s columns added to it. If you don't want to
use all the columns, create a blank form first, and then select the fields you want to include.

You can add fields to your blank form from any of your tables within the same database. You
can also change the order of your fields in your form with this method.

Here’s how to create a blank form in Access:

1. In Access, click the Create tab at the top and select Blank Form

2. Start adding fields. On the right, select the table that you want to add fields from, then
double-click on individual fields to add them to your form.

[Lab Manual-(BCA-307) Database Management System] Page 39


3. Once your chosen fields are added to the form, click the save icon at the top-left corner
to save the form.

4. Type a name for your form and click OK.

3. How to Add New Fields to Your Forms in Microsoft Access

When you update your tables and you add new columns to them, those new columns won’t
automatically be added to your forms. So you can’t add data into those new columns until you
update your forms. In Access, you can add new fields to your existing forms anytime.

1. Right-click on your form in Access and select Layout View. This opens the form in the
layout view.
2. Click the Design tab at the top and select Add Existing Fields from the Tools section.
This will let you add new fields to your form.
3. On the right, you will see all the fields that your tables currently have. Double-click on
a missing field and it will be added to your form.

4. Save your form by clicking the save icon.

[Lab Manual-(BCA-307) Database Management System] Page 40


Assignment No:-09
Aim: - Generate the report in MS Access.

Theory: -
In this chapter, we will be covering the basics of reports and how to create reports. Reports
offer a way to view, format, and summarize the information in your Microsoft Access database.
For example, you can create a simple report of phone numbers for all your contacts. A report
consists of information that is pulled from tables or queries, as well as information that is
stored with the report design, such as labels, headings, and graphics. The tables or queries
that provide the underlying data are also known as the report's record source. If the fields that
you want to include all exist in a single table, use that table as the record source. If the fields
are contained in more than one table, you need to use one or more queries as the record
source.
Example
We will now take a simple example to understand the process of creating a very simple report.
For this, we need to go to the Create tab.

Before clicking on the Report button to create a basic report, make sure the proper query is
selected. In this case, qryCurrentProjects is selected in your navigation pane. Now click on the
Report button, which will generate a report based on that query.

[Lab Manual-(BCA-307) Database Management System] Page 41


You will see that the report is open in Layout view. This provides a quick way to adjust the size
or width of any of your fields that you see on the report. Let us now adjust the column widths
to make everything fit in a better way.

Scroll down and adjust the page control at the bottom.

[Lab Manual-(BCA-307) Database Management System] Page 42


This was a very quick way to create a very simple report. You could also make minor changes
and adjustments from the report design view.

Just like forms, a report is made up of a variety of different sections.


You have the detail section, which is where all of your data lives for the most part.
You also will see a page header and a page footer section; these appear at the top and at the
bottom of every single page in your report.

[Lab Manual-(BCA-307) Database Management System] Page 43


Assignment No:-10
Aim: - Generate the report in MS Access using Report Wizard.

Theory: -
In this Assignment, you'll learn how to use the Report Wizard to create complex reports. While
using the Report command is a quick way to create reports from the current object, it's not as
helpful if you want to create a report with data from multiple objects. The Report Wizard makes
it easy to create reports using fields from multiple tables or queries. It even lets you choose h
Similar to the Form Wizard; the Report Wizard walks you through a series of decisions in order
to build a report. To create a report using the Report Wizard, follow the steps below.

This feature works the same in all modern versions of Microsoft Access: 2010, 2013, and 2016.

1. On the Create tab in the Reports group, click Report Wizard. The wizard startsow your
data will be organized.

2. From the Tables/Queries drop-down list, select the table (or query) to base the report
on. The fields for the selected table load in the Available Fields list box.
3. Move the fields to include on the report from the Available Fields list box to the Selected
Fields list box. To do so, double-click a field name to move it or highlight the field name
and click >. To move all fields at once, click >>.

[Lab Manual-(BCA-307) Database Management System] Page 44


4. Click Next >

5. To group records on the report by a particular field, highlight the field in the list box
and click >.

6. Add more grouping levels if desired. You can use the arrows to change the order of the
grouping levels if needed.

[Lab Manual-(BCA-307) Database Management System] Page 45


7. When you finish defining how you want records grouped, click Next >.

8. In the first drop-down list, select the field to sort records by. By default, records will be
sorted in ascending order by the field you select. If you want to sort in descending
order, click the Ascending button to change its label to "Descending".

9. You can specify up to four levels of sorting. When you finish specifying sorting options,
click Next >.

[Lab Manual-(BCA-307) Database Management System] Page 46


10. In the Layout field, select the format of the report. Your options are "Stepped", "Block",
and "Outline". (Try the options to see a preview of the report layouts.)
11. In the Orientation field, select whether to lay out the report in portrait or landscape
mode.
12. If you want all fields to fit on a single page, ensure the Adjust the field width so all fields
fit on a page check box is marked.
13. Click Next >

14. Enter a title for the report.


15. Select an option for the view you want to open the report in. Your options are:
 Preview the report (opens in Print Preview mode).
 Modify the report's design (opens in Design view).
16. Click Finish. The report loads in the view you selected.

[Lab Manual-(BCA-307) Database Management System] Page 47


[Lab Manual-(BCA-307) Database Management System] Page 48

You might also like