0% found this document useful (0 votes)
143 views

Sample File Ism

This document provides definitions and explanations of key database concepts: 1. It defines data, information, databases, DBMS, and RDBMS. Data is raw facts while information is organized data used to make decisions. A database is a collection of organized data and a DBMS manages databases. An RDBMS is for relational databases using rows and columns. 2. It lists the steps to open Microsoft Access and create a database, including selecting "Blank database". The main database elements are tables, forms, reports, and queries. Tables hold data, forms interface with users, reports output data, and queries filter and combine data. 3. It describes features of SQL like DDL to define database

Uploaded by

yash choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
143 views

Sample File Ism

This document provides definitions and explanations of key database concepts: 1. It defines data, information, databases, DBMS, and RDBMS. Data is raw facts while information is organized data used to make decisions. A database is a collection of organized data and a DBMS manages databases. An RDBMS is for relational databases using rows and columns. 2. It lists the steps to open Microsoft Access and create a database, including selecting "Blank database". The main database elements are tables, forms, reports, and queries. Tables hold data, forms interface with users, reports output data, and queries filter and combine data. 3. It describes features of SQL like DDL to define database

Uploaded by

yash choudhary
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 195

ISM LAB B.

Com-307

Q1. What do you mean by data, information, database, DBMS, RDBMS?

ANS:
► DATA
Data can be defined as a representation of facts, concepts, or instructions in a formalized
manner, which should be suitable for communication, interpretation, or processing, by human or
electronic machine.
In general, data is any set of characters that is gathered and translated for some purpose, usually
analysis. It can be any character, including text and numbers, pictures, sound, or video. If data is
not put into context, it doesn't do anything to a human or computer.

► INFORMATION
Abbreviated as info, information is a term used to describe text that is informative to the
individual reading it or the computer processing it.
Information is organized or classified data, which has some meaningful values for the receiver.
Information is the processed data on which decisions and actions are based.
For the decision to be meaningful, the processed data must qualify for the following
characteristics −
 Timely − Information should be available when required.
 Accuracy − Information should be accurate.
 Completeness − Information should be complete.

Fig 1.1

► DATABASE
Database, also called electronic database, any collection of data, or information that is
specially organized for rapid search and retrieval by a computer. Databases are structured
to facilitate the storage, retrieval, modification, and deletion of data in conjunction with various
data-processing operations. 
A database is an organized collection of data, generally stored and accessed electronically from
a computer system. Where databases are more complex they are often developed using
formal design and modeling techniques.

Page 1
ISM LAB B.Com-307

► DBMS
The database management system (DBMS) is the software that interacts with end users,
applications, and the database itself to capture and analyze the data. The DBMS software
additionally encompasses the core facilities provided to administer the database. The sum total
of the database, the DBMS and the associated applications can be referred to as a "database
system". Often the term "database" is also used to loosely refer to any of the DBMS, the
database system or an application associated with the database.
A database management system (DBMS) extracts information from the database in response to
queries.
Here, is the list of some popular DBMS system:
 MySQL
 Microsoft Access
 Oracle
 PostgreSQL
 dBASE
 FoxPro
 SQLite

Fig 1.2

► RDBMS
Stands for "Relational Database Management System." An RDBMS is a DBMS designed
specifically for relational databases. Therefore, RDBMSes are a subset of DBMSes.
A relational database refers to a database that stores data in a structured format,
using rows and columns. This makes it easy to locate and access specific values within the
database. It is "relational" because the values within each table are related to each other.
Most well known DBMS applications fall into the RDBMS category. Examples include Oracle
Database, MySQL, Microsoft SQL Server, and IBM DB2. Some of these programs support non-
relational databases, but they are primarily used for relational database management.

Page 2
ISM LAB B.Com-307

Q2. Write steps to open Microsoft Access. Write steps to create a database. What are the
various elements/objects of a database? What are the various ways to create a table in
database?

ANS:
# STEPS TO OPEN MICROSOFT ACCESS

STEP 1: Go to windows tab All Programs.

Fig 2.1

STEP 2: Search Microsoft Office  select Microsoft Access 2007.

Fig 2.2
STEP 3: Open Microsoft Access 2007.

Page 3
ISM LAB B.Com-307

Fig 2.3

#STEPS TO CREATE A DATABASE

STEP1: On the Microsoft Office Access Window, click on “Blank Database”.

Fig 2.4

STEP 2: On the third tab of Microsoft access screen, type a new file name and then click on
create button.

Page 4
ISM LAB B.Com-307

Fig 2.5

# VARIOUS ELEMENTS OF A DATABASE

1. TABLE
Data is stored in tables. An Excel worksheet is a table. A table is a collection of data about a
specific thing, such as people or companies or products. A database table is composed of records
and fields that hold data. Tables are also called datasheets. Each table in a database holds data
about a different, but related, subject.

2. FORM
A form in Access is a database object that you can use to create a user interface for a database
application. A "bound" form is one that is directly connected to a data source such as a table or
query, and can be used to enter, edit, or display data from that data source. Alternatively, you can
create an "unbound" form that does not link directly to a data source, but which still contains
command buttons, labels, or other controls that you need to operate your application.
An effective form speeds the use of your database, because people don't have to search for
what they need. A visually attractive form makes working with the database more pleasant and
more efficient, and it can also help prevent incorrect data from being entered.

3. REPORT

Page 5
ISM LAB B.Com-307

A report is an object in Microsoft Access that is used to display and print your data in an
organized manner. The Navigation Pane is where you can find all of the saved reports in the
database.
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, or
a summary report on the total sales across different regions and time periods.

4. QUERY
A query is a request for data results, and for action on data. You can use a query to answer a
simple question, to perform calculations, to combine data from different tables, or even to add,
change, or delete table data.
As tables grow in size they can have hundreds of thousands of records, which makes it
impossible for the user to pick out specific records from that table.
With a query you can apply a filter to the table's data, so that you only get the information that
you want. You can also use a query to supply data for a form or report.

Fig 2.6

# VARIOUS WAYS TO CREATE TABLES IN DATABASE

METHOD 1
 Click the add new field column label.Activate the datasheet tab.
 Click rename in the fields and columns group.
 Type the field name.
 Press Enter. Access creates the field.
 Type the next field name. Access creates the field. Continue until you have created all of
the field in your table.
 Press Enter without entering a field name to end your entries.

METHOD 2
 Right click the Add New Field column label. A menu appears.
 Click Rename Column.
 Type the field name.
 Press Enter. Access creates the field.
 Type the next field name. Access creates the field . Continue until you have created all of
the fields in your table.
Q3. Write features of SQL.

Page 6
ISM LAB B.Com-307

ANS:
Structured Query Language (SQL) as we all know is the database language by the use of which
we can perform certain operations on the existing database and also we can use this language to
create a database. SQL uses certain commands like Create, Drop, Insert etc. to carry out the
required tasks. There are mainly 3 basic features of SQL that are as follows:

1. DDL (Data Definition Language)


DDL or Data Definition Language actually consists of the SQL commands that can be used to
define the database schema. It simply deals with descriptions of the database schema and is used
to create and modify the structure of database objects in the database.
Examples of DDL commands:
 CREATE – is used to create the database or its objects (like table, index, function, views,
store procedure and triggers).
 DROP – is used to delete objects from the database.
 ALTER-is used to alter the structure of the database.
 TRUNCATE–is used to remove all records from a table, including all spaces allocated for
the records are removed.
 COMMENT –is used to add comments to the data dictionary.
 RENAME –is used to rename an object existing in the database.

2. DQL(Data Query Language)


DML statements are used for performing queries on the data within schema objects. The
purpose of DQL Command is to get some schema relation based on the query passed to it.
Example of DQL:
 SELECT – is used to retrieve data from the a database.

3. DML (Data Manipulation Language)


The SQL commands that deals with the manipulation of data present in the database belong to
DML or Data Manipulation Language and this includes most of the SQL statements.
Examples of DML:
 INSERT – is used to insert data into a table.
 UPDATE – is used to update existing data within a table.
 DELETE – is used to delete records from a database table.

Fig 3.1
Q4. Write steps to create table in datasheet view and design view?

Page 7
ISM LAB B.Com-307

ANS:
# STEPS to Create Table in Datasheet View:

STEP 1: Open Microsoft Office Access from Windows Tab.

Fig 4.1

STEP 2: Open any existing database or create a new database.

OR
Fig 4.2 Fig 4.3

STEP 3: On the blank database Go to Create Tab Click on Table

Page 8
ISM LAB B.Com-307

Fig 4.5

STEP 4: By default, The Table appears in Datasheet view.

Fig 4.6

STEP 5: Now enter the records in the fields of the tables.

Page 9
ISM LAB B.Com-307

Fig 4.7

# STEPS to Create Table in Design View:

STEP 1: After the above steps, Save the table by clicking on Save As from the Office View.

Fig 4.8

STEP 2: After saving the table with a new name, right click on the table name and click on the
design view.

Fig 4.9

STEP 3: Now the design view will appear.

Page
10
ISM LAB B.Com-307

Fig 4.10

# STEPS to Create Table directly in Design View:

STEP 1: Open Microsoft Office Access from Windows Tab. Open any existing database or
create a new database.

STEP 2: On the blank database Go to Create Tab Click on Table Design.

Fig 4.11

STEP 3: The table will appear in Design View.

Page
11
ISM LAB B.Com-307

Fig 4.12

STEP 4: Enter the Field Names and Data Type.

Fig 4.13

STEP 5: Right click on the table name and click on the datasheet view, it will automatically ask
for saving the table. Now change the Table Name accordingly and save the table.

Page
12
ISM LAB B.Com-307

Fig 4.14

STEP 6: Now the datasheet view will appear. Enter your records.

Fig 4.15

Q5. What do you mean by Field name, Data type, Field Size & Description?

Page
13
ISM LAB B.Com-307

ANS:
 Field Name:
A field in Microsoft Access is a piece of information related to a single person or thing. Related
fields are grouped together to form a record. In a database, where information regarding a
company's employee information is stored, a record would be the information related to a single
employee.

 Data Type:
Every field in a table has properties and these properties define the field's characteristics and
behavior. The most important property for a field is its data type. A field's data type determines
what kind of data it can store. MS Access supports different types of data, each with a specific
purpose.
The data type determines the kind of the values that users can store in any given field.

Each field can store data consisting of only a single data type.

 Field Size:
In the Field Properties pane, on the General tab, enter the new field size in the Field
Size property. You can enter a value from 1 to 255. This number specifies the maximum number
of characters that each value can have. For larger text fields, use the Memo data type.

 Description:
Descriptions make your database fields easier to fill out and use by providing users with
onscreen instructions and help. Whenever a user selects a field, anything typed in that field's
Description box will appear in the Status bar.

Q6. Write Steps to open an existing database?

ANS:

Page
14
ISM LAB B.Com-307

STEPS:
STEP 1: Open Microsoft Office Access from Windows Tab.

Fig 6.1

STEP 2: Open any existing database from the right pane of the window.

Fig 6.2
Q7. Create a student database with a table STUDENT_DETAILS containing the field
name as
 ID
 FIRST NAME

Page
15
ISM LAB B.Com-307

 LAST NAME
 AGE
 ADDRESS
Insert 5 records using the design view in MS ACCESS.
Using the above database, create another table using datasheet view as
STUDENT_COURSE with the field name as:-
 ID
 COURSE CODE
 COURSE NAME
Insert 5 records.

ANS:
# STEPS for creating student database and STUDENT_DETAILS table.
STEP 1: Create a new database named as student in Design View in MS ACCESS.

Fig 7.1

STEP 2: Save the table name as STUDENT_DETAILS.

Page
16
ISM LAB B.Com-307

Fig 7.2

STEP 3: Enter the Field Names and there corresponding data type.

Fig 7.3

STEP 4: Now go to the datasheet view and enter the records in the table.

Fig 7.4

# STEPS to create another table named STUDENT_COURSE in the same database.

Page
17
ISM LAB B.Com-307

STEP 1: In the same database; Click on create tab and then click on table tab and then a new
table will appear in the datasheet view.

Fig 7.5

STEP 2: Save the name of the table as STUDENT_COURSE.

Fig 7.6

STEP 3: Enter the field names as mentioned in the question and change the data type
corresponding to the field names.

Fig 7.7

Page
18
ISM LAB B.Com-307

STEP 4: Now click on view and a drop down menu will appear, then click datasheet view and
the datasheet vie will appear.

STEP 5: Add 5 records in the fields.

Fig 7.8

Page
19
ISM LAB B.Com-307

Q8. Create a student_data database with S1 as table containing the field names as
enrollment_no. , name, age, date_of_birth, phone_no, email_id, and address.

ANS:
STEP 1: Create a blank database named Student_Data in design view
STEP 2: Save the table with name S1.

Fig 8.1

STEP 3: Enter the Field Names and Data Type.

Fig 8.2

STEP 4: Fill in the records in DATASHEET VIEW.

Fig 8.3

Page
20
ISM LAB B.Com-307

Q9. Create a database named EMPLOYEE with the following fields as EMPLOYEE_ID,
EMPLOYEE_NAME, SSN_NO. , EMPLOYEE_DESIGNATION,
EMPLOYEE_DEPARTMENT, DATE_OF_JOINING, SALARY, and
YEAR_OF_EXPERIENCE. Insert 10 records and delete any two records and one
field(SSN_NO.) from the table to show the output.

ANS:
STEP 1: Open Microsoft Access ; Create a new database named EMPLOYEE and then create a
table by name EMPLOYEE_DATA.

Fig 9.1

STEP 2: In the design view; enter the field names and there corresponding data types.

Fig 9.2

STEP 3: Fill in the records in DATASHEET VIEW.

Fig 9.3

Page
21
ISM LAB B.Com-307

STEP 4: To DELETE a RECORD; select a record and right click on it and a drop down menu
will appear; press “Delete Record”.

Fig 9.4

STEP 5: On clicking the “Delete Record” option; a dialogue box will appear asking for yes or
no; to delete the record click on “Yes”. And the record will be deleted.

Fig 9.5

Page
22
ISM LAB B.Com-307

STEP 6: To DELETE a FIELD; select a field, then right click on it and a drop down menu will
appear; press “Delete Column”.

Fig 9.6

STEP 7: On clicking the “Delete Column” option, a dialogue box will appear; to delete the
column press “Yes”. And the field will be deleted.

Fig 9.7

Page
23
ISM LAB B.Com-307

The Table after deleting 2 RECORDS (Divya, Deepika) and 1 FIELD (SSN_NO.)

Fig 9.8

Page
24
ISM LAB B.Com-307

Q 10. Create an Employee database with the following fields as:


 Emp_code
 Emp_ssn
 Emp_name
 DOB
 Emp_design
 DOJ
 E_sal
 Years of experience.
For the above created database set the following field properties:
1. Employee name should be in upper case with field size equal to 10.
2. Set the default value of Emp_dept as HR.
3. Date of joining should be set to the current date by default.
4. E_sal should be in dollars.

ANS:
STEP 1: Create a new database in MICROSOFT ACCESS named “emp1” ; then create a table
and save it as “emp”.

Fig 10.1

STEP 2: Enter the “FIELD NAMES” and “DATA TYPE”.

Fig 10.2

Page
25
ISM LAB B.Com-307

STEP 3: Select the Emp_name cell and in the General properties below, change the “field size”
from 255 to 10. And in the “Format ” option , enter “>” symbol which will display the text in
upper case.

Fig 10.3

Page
26
ISM LAB B.Com-307

STEP 4: Click on Emp_dept cell and set the “Default value” option to “HR”.

Fig 10.4

Page
27
ISM LAB B.Com-307

STEP 5: Click on “DOJ” cell and in the properties , set the “default date” to present date that is
“=DATE()”.

Fig 10.5

Page
28
ISM LAB B.Com-307

STEP 6: Click on the “E_sal” cell and in the properties, click on the arrow in the “Format”
option and select “Currency ”.

Fig 10.6

Fig 10.7

Page
29
ISM LAB B.Com-307

STEP 7: Enter 10 records in the “DATASHEET VIEW” and save the file.

Fig 10.8

Page
30
ISM LAB B.Com-307

Q 11. Create an EMPLOYEE database with the following fields as:


 Emp_code
 Emp_ssn
 Emp_name
 Emp_dob
For the above created database set the input for the field property for Emp_ssn and
Emp_dob using input mask wizard.

ANS:
STEP 1: Create a new database and save the table name as “emp123”.

Fig 11.1

STEP 2: Enter the field names and data type in the design view of table.

Fig 11.2

Page
31
ISM LAB B.Com-307

STEP 3: Click on emp_ssn cell in the design view. And click on the drop down menu of input
mask given in properties below.

Fig 11.3

STEP 4: Now in the dialogue box, click on “social security number” and press “Next”.

Fig 11.4

Page
32
ISM LAB B.Com-307

STEP 5: In the “placeholder character”, select any character (“-” in this case) ; then press “next”.

Fig 11.5

STEP 6: Now select the way you want to store the data i.e. with symbols or without symbols.
And press “next”.

Fig 11.6

Page
33
ISM LAB B.Com-307

STEP 7: Click on “Finish”.

Fig 11.7

STEP 8: Now the “input mask” will display the format of emp_ssn.

Fig 11.8

Page
34
ISM LAB B.Com-307

STEP 9: Now for setting the input for the field property for Emp_dob using input mask wizard.
Click on “emp_dob” cell in the design view. Now click on the drop down menu of input mask
given in properties below.

Fig 11.9

STEP 10: Now click on “short date” format; now press “next”.

Fig 11.10

Page
35
ISM LAB B.Com-307

STEP 11: In the “placeholder character”, select any character (“-” in this case); then press
“next”.

Fig 11.11

STEP 12:Click on “Finish”.

Fig 11.12

Page
36
ISM LAB B.Com-307

STEP 13:Now the “input mask” will display the format of emp_dob.

Fig 11.13

STEP 14: Now enter the records in the datasheet view.

Fig 11.14

Page
37
ISM LAB B.Com-307

Q12. Create a local template of “FACULTY” , insert 5 records and perform the following
queries on faculty template table:

a.Insert five records using “new faculty” tab in faculty template.


b. Faculty name should be in ascending order.
c. Department should be in descending order
d. Generate report for: All faculty category and faculty by department category.

ANS:
STEP 1: Open MS Access and on the left corner of the home page , click on “local templates”.
Now in the center part of the screen, click on the “Faculty” template.

Fig 12.1

STEP 2: Save the faculty database by name “faculty”.

Page
38
ISM LAB B.Com-307

Fig 12.2

STEP 3: The following view will appear on creating a new faculty database.

Fig 12.3

STEP 4: For department; there is a drop down menu which has numerous departments which
can be selected.

Page
39
ISM LAB B.Com-307

Fig 12.4

STEP 5: Enter 5 records directly in the table.

Fig 12.5

STEP 6:Insert a records using “new faculty” tab in faculty template. Fill the details and click on
“save and new”

Page
40
ISM LAB B.Com-307

Fig 12.6

STEP 7: Similarly enter 5 records using the “new faculty” tab.

Fig 12.7
STEP 8: Now right click on the “first name” field and select “sort A to Z” , to arrange the
faculty names in ascending order.

Page
41
ISM LAB B.Com-307

Fig 12.8

STEP 9:Now right click on the “Department” field and select “sort Z to A” , to arrange the
faculty names in descending order.

Fig 12.9
STEP 10: Now to generate a report for All faculty category; click on the drop down menu of
“Reports” and select “All faculty”.

Page
42
ISM LAB B.Com-307

Fig 12.10

STEP 11: The following view will be displayed showing report for “all faculty”.

Fig 12.11
STEP 12: Now to generate a report for faculty by department category; click on the drop down
menu of “Reports” and select “Faculty by department”.

Page
43
ISM LAB B.Com-307

Fig 12.12

STEP 13: The following view will be displayed showing report for “Faculty by department”.

Fig 12.13

Q13. Create a database named as STUDENT DATABASE . With a table


STUDENT_DETAILS with the fields as:
 Stu_id

Page
44
ISM LAB B.Com-307

 St_name
 St_age
 St_dob
 St_roll
 St_course
 St_add
 St_contact
Add at least 10 records in the table. Answer the following:
A. What is primary key? Make a field stu_roll as the primary key in the table. Also
write down the steps for the same.
B. What is a composite key? In the table student_details make stu_rollno and stu_dob
as a composite key. Also write the steps for the same.

ANS A:

# PRIMARY KEY
A primary key is a field in a table which uniquely identifies each row/record in a database
table. Primary keys must contain unique values. A primary key column cannot have NULL
values.

In the relational model of databases, a primary key is a specific choice of a minimal set of


attributes (columns) that uniquely specify a tuple (row) in a relation (table).Informally, a
primary key is "which attributes identify a record", and in simple cases are simply a single
attribute: a unique id.

For example, for a database of student (of a given institute), Student identification
number is an example of an attribute that may be used as a PRIMARY KEY.

Fig 13.1
#STEPS
STEP 1: Create a new database in MS ACCESS named “STUDENT DATABASE”

Page
45
ISM LAB B.Com-307

Fig 13.2

STEP 2: Create a new table and save it as “STUDENT_DETAILS”

Fig 13.3

STEP 3: In the design view, enter the field names and there corresponding data types.

Page
46
ISM LAB B.Com-307

Fig 13.4

#STEPS TO MAKE A PRIMARY KEY

METHOD 1
STEP 1: Select a field name i.e. “stu_id” and right click on the same, then click on “Primary
key”

Fig 13.5
STEP 2: Now an icon of a key will appear across “stu_id”.

Page
47
ISM LAB B.Com-307

Fig 13.6

METHOD 2
STEP 1: Select a field name i.e. “stu_id”, and from the above tabs, click on the “Primary key”
tab as shown below.

Fig 13.7

Fig 13.8
STEP 2: Now an icon of a key will appear across “stu_id”.

Page
48
ISM LAB B.Com-307

Fig 13.9

STEP 3: Now enter the records in the table in the datasheet view.

Fig 13.10

STEP 4: Now, on entering a duplicate value in “stu_id (a primary key)” i.e. “S01” for 2 different
records, a dialogue box appears showing an error message. Click OK and enter a unique value in
the primary key field.

Page
49
ISM LAB B.Com-307

Therefore, a PRIMARY KEY always carries a UNIQUE VALUE.

Fig 13.11

ANS B:
#COMPOSITE KEY

Page
50
ISM LAB B.Com-307

A composite key is a combination of two or more columns in a table that can be used to
uniquely identify each row in the table when the columns are combined uniqueness is
guaranteed, but when it taken individually it does not guarantee uniqueness.

Sometimes more than one attributes are needed to uniquely identify an entity. A primary
key that is made by the combination of more than one attribute is known as a composite
key.

#STEPS TO CREATE A COMPOSITE KEY

METHOD 1
STEP 1:Enter the field names and there corresponding data types in the design view.

Fig 13.12

STEP 2: Select the pair of field names which you want to make the composite key and then
press on the “Primary Key” button as shown below.

Fig 13.13
METHOD 2

Page
51
ISM LAB B.Com-307

STEP 1: Select the 2 field names which you want to make the composite key and the in the
“Design” ribbon, click on “Property Sheet” button.

Fig 13.14

STEP 2: Now in the general field properties below, click on the drop down menu of the
“Indexed” row and click “Yes (No Duplicates)” option.

Fig 13.15

METHOD 3

Page
52
ISM LAB B.Com-307

STEP 1: Remove the composite key and then select the field names which you want to make
composite key. Now go to the “Design” ribbon and then click on “Indexes” button.

Fig 13.16

STEP 2: A dialogue box will appear, there, add the field names to make then a composite key.

Fig 13.17

STEP 3: Now click on the drop down menu of the primary key option below, and click on
“Yes”.

Page
53
ISM LAB B.Com-307

Fig 13.18

STEP 4: Now to check , enter a redundant value in the composite key column, then a dialogue
box will appear showing an error message as shown below, now click on OK and then enter a
unique value in the composite key column.

Fig 13.19

STEP 6: Below is the table having unique values in the composite key columns.

Page
54
ISM LAB B.Com-307

Fig 13.20

Q14. Create a table as STUDENT_DETAILS with the following fields


 S_id

Page
55
ISM LAB B.Com-307

 S_name
 S_course
 S_marks
 S_dob
Make S_id as the primary key and apply the following validations:
1. S_name should start with A and end with M.
2. S_course can have only BBA or MBA
3. S_marks can be NULL or should be >50.
4. S_dob should be less than the current date.
Enter atleast 10 entries in the table.

ANS:
#STEPS
STEP 1: Create a database in MS Access and name it “STUDENT 1”.

Fig 14.1

STEP 2: Create a table and save it as “STUDENT_DETAILS”.

Page
56
ISM LAB B.Com-307

Fig 14.2

STEP 3: Now enter the field names and there corresponding data types in the design view.

Fig 14.3

STEP 4: Select the field name “S_id” and make it the Primary key.

Fig 14.4
STEP 5: For applying validation to “S_name” i.e. “S_name should start with A and end with
M”, in the general properties below, write “Like “A*M”” in the validation rule.

Page
57
ISM LAB B.Com-307

Fig 14.5

STEP 6: For applying validation to “S_course” i.e. “S_course can have only BBA or MBA”, in
the general properties below, write “”BBA” Or “MBA”” in the validation rule.

Page
58
ISM LAB B.Com-307

Fig 14.6

STEP 7:For applying validation to “S_marks” i.e. “S_marks can be NULL or should be >50”, in
the general properties below, write “Is Null Or>50” in the validation rule.

Page
59
ISM LAB B.Com-307

Fig 14.7

STEP 8:For applying validation to “S_dob” i.e. “S_dob should be less than the current date”, in
the general properties below, write “<=05-Feb-20#” in the validation rule.

Page
60
ISM LAB B.Com-307

Fig 14.8

STEP 9: Now go to the datasheet view of the table and enter 10 records.

Page
61
ISM LAB B.Com-307

Fig 14.9

STEP 10: To check the validation of “S_name”, write a name which violates the validation that
the name should start with A and end with M. On violating the validation rule, a dialogue box
appears showing an error message. Then click OK and change the name according to the
validation.

Fig 14.10

STEP 11: To check the validation of “S_course” write a course name which violates the
validation rule that the course name should be BBA or MBA. On violating the validation rule, a

Page
62
ISM LAB B.Com-307

dialogue box will appear showing error, click OK and then change the course name according to
the validation rule.

Fig 14.11

STEP 12: To check the validation of “S_marks” write the marks which violates the validation
rule that the marks should be greater than 50 or NULL. On violating the validation rule, a
dialogue box will appear showing an error message, click OK and change the marks according to
the validation rule.

Fig 14.12

STEP 13: To check the validation of “S_dob”, enter the DOB that violates the validation rule
that the DOB should be less than the current date. On violating the validation rule, a dialogue

Page
63
ISM LAB B.Com-307

box appears showing an error message, now click OK and change the DOB according to the
validation rule.

Fig 14.13

STEP 14: Below is the table which follows all the validation rules.

Fig 14.14

Q15.Write steps to put password on the database and convert it into the required format.

ANS:

Page
64
ISM LAB B.Com-307

Some Access tasks require you to open the database in exclusive mode — so that nobody
else can use it while you have it open. For example, you can only password protect a
database that is open in Exclusive mode.

#STEPS
STEP 1: Open MS Access.

Fig 15.1

STEP 2: Click on office button and then select “open”.

Fig 15.2
STEP 3: Select a database to be encrypted.

Page
65
ISM LAB B.Com-307

Fig 15.3

STEP 4: Now click on the drop down menu of open at the bottom and select “Open exclusive”.

Fig 15.4
STEP 5: Now the database file will open , now click on “Database tools” tab.

Page
66
ISM LAB B.Com-307

Fig 15.5

STEP 6: Now click on “Encrypt with password”.

Fig 15.6

STEP 7: Now a dialogue box wilol appear : then enter a password.

Fig 15.7
STEP 8: Now close the file and again open MS Access and click on the database file which was
encrypted.

Page
67
ISM LAB B.Com-307

Fig 15.8

STEP 9: A dialogue box will appear for entering the password. Enter the password.

Fig 15.9

STEP 10:If the password is correct The database file will be displayed.

Fig 15.10
Q16. Create a company database with the following table EMP_DETAILS with the fields
as:
 EMP_ID

Page
68
ISM LAB B.Com-307

 EMP_NAME
 EMP_DESIGNATION
And make EMP_ID as the primary key. Create another table as DEPT_DETAILS with the
fields as:
 DEPT_ID
 DEPT_NAME
 DEPT_LOCATION
Also create a table as PROJECTS with fields as:
 P_ID
 P_NAME
Designate primary key in all the tables. Establish a relationship between the table EMP-
DETAILS AND DEPT_DETAILS as 1:1 and 1: M. Also, establish a relationship between
the tables EMP-DETAILS AND PROJECT as 1:1. Enforce referential integrity constraint
on it and write down the steps for the same.

ANS:
#STEPS
STEP 1: Create a database in MS Access named as “COMPANY”.

Fig 16.1
STEP 2: Now create a new table named as “EMP_DETAILS”.

Page
69
ISM LAB B.Com-307

Fig 16.2

STEP 3: Enter the field names and there corresponding data types in the design view.

Fig 16.3

STEP 4: Now enter the records in the table in the data sheet view.

Fig 16.4

STEP 5: Now create another table named as “DEPT_DETAILS”, in the same database.

Fig 16.5

STEP 6: Now enter the field names and there corresponding data types in the design view.

Page
70
ISM LAB B.Com-307

Fig 16.6

STEP 7: Now enter the records in the table in the data sheet view.

Fig 16.7

STEP 8: Create another table named as “PROJECTS”, in the same database.

Fig 16.8

STEP 9: Enter the field names and there corresponding data types in the design view.

Fig 16.9
STEP 10: Now enter the records in the table in the data sheet view.

Page
71
ISM LAB B.Com-307

Fig 16.10

STEP 11: Now right click on the table names and close all the tables.

Fig 16.11

STEP 12: Go to “Database Tools” ribbon and then select “Relationships” button.

Fig 16.12

STEP 13: A dialogue box will appear now, “Add” the tables “DEPT_DETAILS” and
“EMP_DETAILS” to create a relationship between them.

Page
72
ISM LAB B.Com-307

Fig 16.13

STEP 14: On adding the tables, the following will be displayed in the relationship window.

Fig 16.14

STEP 15: Now for creating a ONE TO ONE relationship between “DEPT_DETAILS” and
“EMP_DETAILS” table, drag and drop the primary key of “DEPT_DETAILS” table on the
primary key of “EMP_DETAILS” table, and then a dialogue box will appear as shown below.

STEP 16: Now tick the checkboxes below as shown and then click on “Create”.

Page
73
ISM LAB B.Com-307

Fig 16.15

STEP 17: Now a ONE TO ONE relationship will be created between the two tables as shown
below.

Fig 16.16

STEP 18: Now for creating a ONE TO MANY relationship between “DEPT_DETAILS” and
“EMP_DETAILS” table, drag and drop the primary key of “DEPT_DETAILS” table on any key
of “EMP_DETAILS” table, and then a dialogue box will appear as shown below.

STEP 19: Now tick the checkboxes below as shown and then click on “Create”.

Page
74
ISM LAB B.Com-307

Fig 16.17

STEP 20: Now a ONE TO MANY relationship will be created between the two tables as shown
below.

Fig 16.18

STEP 21: Below is displayed the ONE TO ONE and ONE TO MANY relationships between the
two tables.

Fig 16.19
STEP 22: Now close the previous relationship, and now go to “Design” ribbon and select
“Relationships” button again to create a new relationship; then a dialogue box will appear, add

Page
75
ISM LAB B.Com-307

the tables “EMP_DETAILS” and “PROJECTS” and then the following will be displayed on the
relationship window.

Fig 16.20

STEP 23: Now drag and drop the primary key of “EMP_DETAILS” table on the primary key of
“PROJECTS” table; then a dialogue box will appear as shown below.

STEP 24: In the dialogue box, tick all the checkboxes as shown below and then click on
“Create”.

Fig 16.21

STEP 25: A ONE TO ONE relationship will be established between the tables
“EMP_DETAILS” and “PROJECTS” as shown below.

Fig 16.22
Q17. Explain in brief about the query object in MS-ACCESS 2007. Write steps to execute
queries using the Query Wizard. Create an ACCOUNT table with the following fields:

Page
76
ISM LAB B.Com-307

 Acc_no
 Acc_type
 DO_opening
 Transaction_type
 Balance
 Account_H_name
 Transaction_ID
Enter 15 records in the table and perform the following queries on it:
 Display the Acc_no in ascending order.
 Display the details of where Acc_no is 1114 and name DEEPALI.
 Display the Acc_no, Acc_type, Account_H_name and blance is greater than 5000.

ANS:
#STEPS
STEP 1: Create a new database in MS ACCESS and save it as “NEW ACCOUNT”.

Fig 17.1
STEP 2: In the database “NEW ACCOUNT”, create a new table named “ACCOUNT”.

Page
77
ISM LAB B.Com-307

Fig 17.2

STEP 3: In the design view of the table, enter the field names and their respective data types.

Fig 17.3

STEP 4: Now enter the records in the table in the data sheet view.

Fig 17.4
STEP 5: Click on the create tab and then select “Query Wizard”.

Page
78
ISM LAB B.Com-307

Fig 17.5

STEP 6: A dialogue box will appear, now select “Simple query wizard” and click “ok”.

Fig 17.6

STEP 7: In the simple query wizard, move all the available fields to the selected fields.

Fig 17.7
STEP 8: Now click on “Next”.

Page
79
ISM LAB B.Com-307

Fig 17.8

STEP 9: Now another dialogue box will appear, press “Next”.

Fig 17.9

STEP 10: Now a new tab will appear named as “ACCOUNT Query” as shown below.

Fig 17.10

STEP 11: Now click on the “ACCOUNT Query” and a query command will be displayed as
shown below.

Page
80
ISM LAB B.Com-307

Fig 17.11

STEP 12: Now right click on the “ACCOUNT Query” and then click on “Design View”, the
following will be displayed.

Fig 17.12
STEP 13: For Query 1, “Display the Acc_no in ascending order” , tick the “Acc_no” checkbox
as shown below.

Page
81
ISM LAB B.Com-307

Fig 17.13

STEP 14: Now click on the Sort drop down menu of column “Acc_no” and press “Ascending”.

Fig 17.14

STEP 15: Now click on “RUN” button in the Design ribbon.

Fig 17.15
STEP 16: On running the query, the output will display the “Acc_no” in ascending order.

Page
82
ISM LAB B.Com-307

Fig 17.16

STEP 17: Now right click on the “ACCOUNT Query” and select the “SQL View” to look for
the query command of Query no. 1.

Fig 17.17

STEP 18: The query command will now appear as shown below.

Page
83
ISM LAB B.Com-307

Fig 17.18

STEP 19:Again go to the query design view, for Query 2, “Display the details of where Acc_no
is 1114 and name DEEPALI”, tick the checkboxes of all the columns. In “Acc_no” column,
write “=1114” in the “Criteria” row. Similarly, in the “Acc_H_name” write “=Deepali” in the
“Criteria” row.

Fig 17.19

STEP 20: On running the Query, the output will display all the details of the Account Holder ,
who has Acc_no. = 1114 and name = Deepali.

Page
84
ISM LAB B.Com-307

Fig 17.20

STEP 21: Now right click on the “ACCOUNT Query” and select the “SQL View” to look for
the query command of Query no. 2. The query command will now appear as shown below.

Fig 17.21

STEP 22: Again go to the query design view, for Query 3, “Display the Acc_no, Acc_type,
Account_H_name and blance is greater than 5000”. Tick the checkboxes of the columns
“Acc_no”, “Acc_type”, “Balance”, and “Acc_H_name”. In “Balance” column , write “>5000” in
the “Criteria” row as shown below.

Fig 17.22
STEP 23: On running the Query, the output will display the Acc_no, Acc_type,
Account_H_name and blance where balance is greater than 5000.

Page
85
ISM LAB B.Com-307

Fig 17.23

STEP 24: Now right click on the “ACCOUNT Query” and select the “SQL View” to look for
the query command of Query no. 3. The query command will now appear as shown below.

Fig 17.24

18. Create a table named as STUDENT with the following fields as:
 S_no
 Name

Page
86
ISM LAB B.Com-307

 City
 Age
 Marks
Execute the following queries after entering 10 records in the table.
 Display all the details of the given table
 Display the names in alphabetical order
 Display the name along with the marks where marks are greater than 60
 Display the name of students whose name starts with letter ‘A’.
 Display the details of students who live in ‘Delhi’.
 Display the details of students who are older than 10 years.

ANS:
#STEPS
STEP 1: Create a new database named as “QUERY”.

Fig 18.1

STEP 2: Save the table name as “STUDENT”.

Page
87
ISM LAB B.Com-307

Fig 18.2

STEP 3: Enter the field names and there corresponding data types.

Fig 18.3

STEP 4: Now go to datasheet view and enter the records.

Fig 18.4

STEP 5: Now go to “CREATE” ribbon and click on “Query Design”.

Page
88
ISM LAB B.Com-307

Fig 18.5

STEP 6: A dialogue box will appear, now click on “Add”.

Fig 18.6

STEP 7: For Query 1, “Display all the details of the given table”, write the query as shown
below.

Fig 18.7
STEP 8: Now go to “Design” ribbon and click on “RUN”.

Page
89
ISM LAB B.Com-307

Fig 18.8

STEP 9: On running the query, the following table appears which consists all the details of
student table.

Fig 18.9

STEP 10: Now repeat the same steps for Query 2 “Display the names in alphabetical order” ,
write the query as shown below and then click on “RUN”.

Fig 18.10
STEP 11: On running the query, the output will display the names of all students in ascending
order.

Page
90
ISM LAB B.Com-307

Fig 18.11

STEP 12: For Query 3 “Display the name along with the marks where marks are greater than
60” , write the query as shown below and then click on “RUN”.

Fig 18.12

STEP 13: On running the query, the output will display the names and marks of the students
where marks are greater than 60.

Page
91
ISM LAB B.Com-307

Fig 18.13

STEP 14: For Query 4, “Display the name of students whose name starts with letter ‘A’”, write
the query as shown below and then click on “RUN”.

Fig 18.14

STEP 15: On running the query, the output will be display the names of the students which are
starting with the letter ‘A’.

Page
92
ISM LAB B.Com-307

Fig 18.15

STEP 16: For Query 5, “Display the details of students who live in ‘Delhi’”, write the query as
shown below and then click on “RUN”.

Fig 18.16

STEP 17: On running the query, the output will display the names of the students who live in
‘Delhi’.

Fig 18.17
STEP 18: For Query 6, “Display the details of students who are older than 10 years” , write the
query as shown below and then click on “RUN”.

Page
93
ISM LAB B.Com-307

Fig 18.18

STEP 19: On running the query, the output will display all the details of the students who are
older than 10 years.

Fig 18.19

Q19. Create a table named as STUDENT_MARKS with the following fields as:
 S_no

Page
94
ISM LAB B.Com-307

 Name
 Marks
Execute the following queries after entering 10 records in the table.
 Display the S_no of those students whose names starts with L and ends with A or
marks less than 70
 Display the name and S_no of those students who have scored marks equal to 95
 Display the names and marks of all those students who have scored marks between
75 and 90.

ANS:
#STEPS
STEP 1: Create a database named “Student”.

Fig 19.1

STEP 2: Save the table name as “STUDENT_MARKS”.

Page
95
ISM LAB B.Com-307

Fig 19.2

STEP 3: Enter the field names and there corresponding data types in the design view.

Fig 19.3

STEP 4: Now go to the datasheet view and enter 10 records.

Fig 19.4

STEP 5:Now go to “CREATE” ribbon and click on “Query Design”.

Fig 19.5
STEP 6: A dialogue box will appear, add the table “STUDENT_MARKS”.

Page
96
ISM LAB B.Com-307

Fig 19.6

STEP 7: Now right click on the query and press “SQL View”.

Fig 19.7

STEP 8: For Query 1, “Display the S_no of those students whose names starts with L and ends
with A or marks less than 70” , write the query as shown below and then click on “RUN”.

Fig 19.8

STEP 9: On running the query, the output will display the S_No of students whose name starts
with L and ends with A or marks less than 70.

Page
97
ISM LAB B.Com-307

Fig 19.9

STEP 10: For Query 2, “Display the name and S_no of those students who have scored marks
equal to 95”, write the query as shown below and then click on “RUN”.

Fig 19.10

STEP 11: On running the query, the output will display the name and S_No of students who
have scored 95 marks.

Fig 19.11
STEP 12: For Query 3, “Display the names and marks of all those students who have scored
marks between 75 and 90”, write the query as shown below and then click on “RUN”.

Page
98
ISM LAB B.Com-307

Fig 19.12

STEP 13: On running the query, the output will display the names and marks of the students
who have scored between 75 and 90.

Fig 19.13
20. Create a table Student with following fields
 Enrolment_no
 Sname
 Course_id
 Batch
 Semester
Execute the following queries after entering 10 records in the table.
 Display the list of Students in batch ‘2017-2020’
 Display the Enrolment_no of fourth semester students.
 Display the list of students of batch ‘2017-2020’ and course_is 17.
b

Page
99
ISM LAB B.Com-307

ANS:
#STEPS
STEP 1: Create a database in MS Access named as “STUDENTS” and create a table in it named
as “STUDENT”.

Fig 20.1

STEP 2: Enter the field names and there corresponding data types in the design view.

Fig 20.2

STEP 3: Now enter the records in the table in the datasheet view.

Page
100
ISM LAB B.Com-307

Fig 20.3

STEP 4: In the “Create” ribbon, click on “Query Design” and then a dialogue box will appear,
“Add” the table “STUDENT”.

Fig 20.4

STEP 5: For Query 1, “Display the list of Students in batch ‘2017-2020’”, write the query as
shown below and then click on “RUN”.

Page
101
ISM LAB B.Com-307

Fig 20.5

STEP 6: On running the query, the output will display the list of students of batch ‘2017-2020’.

Fig 20.6

STEP 7: For Query 2, “Display the Enrolment no of fourth semester students”, write the query
as shown below and then click on “RUN”.

Fig 20.7
STEP 8: On running the query, the output will display the Enrollment no. of the students who
are in fourth semester.

Page
102
ISM LAB B.Com-307

Fig 20.8

STEP 9: For Query 3, “Display the list of students of batch ‘2017-2020’ and course ID is 17”,
write the query as shown below and then click on “RUN”.

Fig 20.9

STEP 10: On running the query, the output will display the details of the students of batch
‘2017-2020’ and course ID is 17.

Fig 20.10
STEP 11: For Query 4, “Display the number of students in course_id 44”, write the query as
shown below and then click on “RUN”.

Page
103
ISM LAB B.Com-307

Fig 20.11

STEP 12: On running the query, the output will display the number of students in course ID 44.

Fig 20.12

21. Create table course with following fields


 Course_id

Page
104
ISM LAB B.Com-307

 Coursename
 Duration
Execute the following queries after entering 10 records in the table.
 Create a relationship of Course table with Student table which is created in
previous exercise.
 Display all students enrolled in BBA course.
 Display name of students enrolled in 2 year course.
 Display details of students of BBA course of batch ‘2017-2020’.

ANS:
#STEPS
STEP 1: Create a database in MS Access and name it as “question”. Now create a new table in
the database and name the table as “COURSE”.

Fig 21.1

STEP 2: Enter the field names and there corresponding data types in the design view.

Fig 21.2

STEP 3: Now enter the records in the table in the datasheet view.

Page
105
ISM LAB B.Com-307

Fig 21.3

STEP 4: Now create a new table in the database and name the table as “STUDENT”.

Fig 21.4

STEP 5: Enter the field names and there corresponding data types in the design view.

Fig 21.5

STEP 6: Now enter the records in the table in the data sheet view.

Page
106
ISM LAB B.Com-307

Fig 21.6

STEP 7: Now click on the “Database tools” ribbon and then click on “Relationships”.

Fig 21.7

STEP 8: A dialogue box will appear, add both the tables “COURSE” and “STUDENT”.

Page
107
ISM LAB B.Com-307

Fig 21.8

STEP 9: The following will be displayed on adding both the tables in the relationship. Now
click on “edit relationships” button from the above ribbon.

Fig 21.9

Page
108
ISM LAB B.Com-307

STEP 10: A dialogue box will appear , now click on the drop down menu of the “COURSE”
table in the dialogue box and click on “Course_ID” (the primary key) and similarly do for the
table “”STUDENT”, as shown below and then click on “Create”.

Fig 21.10

STEP 11: A ONE TO ONE relationship will be created between the COURSE table and the
STUDENT table, as shown below.

Fig 21.11

STEP 12: Now go to the “Create” ribbon and then select “Query Design” button.

Fig 21.12

Page
109
ISM LAB B.Com-307

STEP 13: Now a dialogue box will appear, add both the tables i.e. “COURSE” table and
“STUDENT” table.

Fig 21.13

STEP 14: After adding both the tables, the following relationship between the tables will be
displayed. Now right click on the “Query1” and select SQL view.

Fig 21.14

STEP 15: For query 1, “Display all students enrolled in BBA course”, write the query as shown
below and then click on “RUN”.

Fig 21.15

Page
110
ISM LAB B.Com-307

STEP 16: On running the query, the output will display the details of the students who are
enrolled in BBA course.

Fig 21.16

STEP 17: Again go to “Query Design” and then go to SQL View, for Query 2, “Display name of
students enrolled in 2 year course”, write the query as shown below and then click on “RUN”.

Fig 21.17

STEP 18: On running the query, the output will display the names of the student who are
enrolled in a 2 year course.

Fig 21.18

Page
111
ISM LAB B.Com-307

STEP 19: For Query 3, “Display details of students of BBA course of batch ‘2017-2020’”, write
the query as shown below and then click on “RUN”.

Fig 21.19

STEP 20: On running the query, the output will display the details of the students enrolled in
BBA course of batch’2017-2020’.

Fig 21.20

Q22. Create the following table CUSTOMER having the columns, data types.

Page
112
ISM LAB B.Com-307

Field Name Data Type


Customer_ID Number
Customer_Name Text
Designation Text
City Text
Country Text
Phone Number
Insert the data into table Customer. And apply the queries:
 Display customer details having designation Sales Representative
 Retrieve customer who is living in Canada
 Show details of the customer whose name is Victoria
 Show detail of the customer who lives in Sweden.
 Show detail of the customer who is owner.

ANS:
STEPS
STEP 1: Create a database in MS Access and then create a table named as “CUSTOMER”.

Fig 22.1

STEP 2: Enter the field names and their respective data types in the design view as mentioned in
the question.

Fig 22.2

STEP 3: Now enter the records in the table in the datasheet view.

Page
113
ISM LAB B.Com-307

Fig 22.3

STEP 4: Go to the “Create” ribbon and then click on “Query Design”.

Fig 22.4

STEP 5: A dialogue box will appear, “Add” the “CUSTOMER” table .

Fig 22.5
STEP 6: Now right click on the “Query 1” tab and select “SQL View”.

Page
114
ISM LAB B.Com-307

Fig 22.6

STEP 7: Foe Query 1, “Display customer details having designation Sales Representative”,
write the query as shown below and then go to the “Design” ribbon and click on “RUN”.

Fig 22.7

STEP 8: On running the query, the output will display the details of the customers who have the
designation as sales representative.

Fig 22.8

Page
115
ISM LAB B.Com-307

STEP 9: For Query 2, “Retrieve customer who is living in Canada”, write the query as shown
below and then click on “RUN”.

Fig 22.9

STEP 10: On running the query, the output will display the names of the customers who live in
Canada.

Fig 22.10

STEP 11: Foe Query 3, “Show details of the customer whose name is Victoria”, write the query
as shown below and the click on “RUN”.

Fig 22.11

Page
116
ISM LAB B.Com-307

STEP 12: On running the query, the output displays the details of the customers whose name is
Victoria.

Fig 22.12

STEP 13: For Query 4, “Show detail of the customer who lives in Sweden”, write the query as
shown below and then click on “RUN”.

Fig 22.13

STEP 14: On running the query, the output displays the details of the customers who live in
Sweden.

Fig 22.14

Page
117
ISM LAB B.Com-307

STEP 15: For Query 5, “Show detail of the customer who is owner”, write the query as shown
below and then click on “RUN”.

Fig 22.15

STEP 16: On running the query, the output will display the details of the customer who is the
Owner.

Fig 22.16

Page
118
ISM LAB B.Com-307

Q23. Create a table EMPLOYEE either the following fields:


 Emp_id
 Emp_name
 Dept_name
 Salary
 Add
 Date of joining
Perform the following queries on it.
1. Delete the records of the employee whose Emp_id is 101
2. Delete the record of the employees whose Dept_name is HR and salary >10000
3. Delete the record of the employee whose name begins with S or salary >10000
4. Update the record of the employees, set Dept_name = IT where Dept_name is PRODUCTION.
5. Update the record of the employee, set salary to 15000 where Dept_name is IT.

ANS:
#STEPS
STEP 1: Create a database in MS Access and then create a table named as “EMPLOYEE”.

Fig 23.1

STEP 2: Enter the field names and the corresponding data types in the design view.

Fig 23.2

Page
119
ISM LAB B.Com-307

STEP 3: Enter the records in the table in the data sheet view.

Fig 23.3

STEP 4: Now go to the “Design” ribbon and click on “Query Design”. A dialogue box will
appear and now add the table “EMPLOYEE”.

Fig 23.4

STEP 5: Now right click on the “Query 1” tab and then select “SQL View”.

Fig 23.5

Page
120
ISM LAB B.Com-307

STEP 6: For Query 1. “Delete the records of the employee whose Emp_id is 101”, write the
query as shown below and then go to the “Design” ribbon and then click on “RUN”.

Fig 23.6

STEP 7: A dialogue box will appear regarding the deletion of the number of records, Click on
yes if you want to delete the record(s).

Fig 23.7

STEP 8: Now, save the table again and the record(s) will be deleted, here the record of the
employee whose Emp_id is 101 is deleted.

Fig 23.8

Page
121
ISM LAB B.Com-307

STEP 9: For Query 2, “Delete the record of the employees whose Dept_name is HR and salary
>10000”, write the query as shown below and then click on “RUN”.

Fig 23.9

STEP10: A dialogue box will appear regarding the deletion of the number of records, Click on
yes if you want to delete the record(s).

Fig 23.10

STEP 11: Now save the table and the record(s) will be deleted. Here, the records of the
employees are deleted whose department is HR and salary is > 10000.

Fig 23.11

Page
122
ISM LAB B.Com-307

STEP 12: For Query 3, “Delete the record of the employee whose name begins with S or salary
>10000”, write the query as shown below and then click on “RUN”.

Fig 23.12

STEP 13: A dialogue box will appear regarding the deletion of the number of records, Click on
yes if you want to delete the record(s).

Fig 23.13

STEP 14: Now save the table and the record(s) will be deleted. Here, the records of the
employees whose names began with ‘S’ and salary >10000 will be deleted.

Fig 23.14

Page
123
ISM LAB B.Com-307

STEP 15: For Query 4, “Update the record of the employees, set Dept_name = IT where
Dept_name is PRODUCTION”, write the query as shown below and then click on “RUN”.

Fig 23.15

STEP 16: A dialogue box will appear regarding the updation of the number of records, Click on
yes if you want to update the record(s).

Fig 23.16

STEP 17: Now save the table and the record(s) will be updated. Here, the records of those
employees whose department is production will be updated and the department will be changed
to IT.

Fig 23.17

Page
124
ISM LAB B.Com-307

STEP 18: For Query 5, “Update the record of the employee, set salary to 15000 where
Dept_name is IT”, write the query as shown below and then click on RUN“.

Fig 23.18

STEP 19: A dialogue box will appear regarding the updation of the number of records, Click on
yes if you want to update the record(s).

Fig 23.19

STEP 20: Now save the table and the record(s) will be updated. Here, the records of the
employees whose department is IT will be updated and their salary will be updated to 15000.

Fig 23.20

Page
125
ISM LAB B.Com-307

Q24. Create a table employee with the following fields:


 Emp_id
 Emp_name
 Contact no.
 Gender
 Salary
 Emp_grade
 Designation
 Address
Execute the following queries on the table created:
1. Display the details of the employees
2. Display the employee id of employee whose name is supriya.
3. Display the name of the employee whose contact no. is 98454863011.
4. Display the details of the employee whose address is D-29, IITM, JANAKPURI.
5. Display the name of the employees whose salary is greater than 10,000.
6. Update the employee details, set EMP_GRADE equal to C whose salary is less than 10000.
7. Delete the record of the employee whose gender is male and designation is manager
8. Display the name, designation, and salary of all the employees whose names begins with A.
9. Update the employee details; set designation to assistant manger where designation is
trainee.
10. Display the employee id, name, salary and designation for the employees where emp_grade is
A.

ANS:
#STEPS
STEP 1: Create a database in MSAccess and then create a table named as “EMPLOYEE”.

Fig 24.1

Page
126
ISM LAB B.Com-307

STEP 2: Enter the field names and their corresponding data types in the design view.

Fig 24.2

STEP 3: Now go to the datasheet view and enter the records in the table.

Fig 24.3

STEP 4: Now go to the “Design” ribbon and then click on “Query Design”.

Fig 24.4
STEP 5: Now a dialogue box will appear, “Add” the table EMPLOYEE.

Page
127
ISM LAB B.Com-307

Fig 24.5

STEP 6: Now right click on the “Query 1” tab and then select “SQL View”.

Fig 24.6

STEP 7: For Query 1, “Display the details of the employees”, write the query as shown below
and then go to the “Design” ribbon and then click on “RUN”.

Fig 24.7
STEP 8: On running the query, the output will display the details of all the employees.

Page
128
ISM LAB B.Com-307

Fig 24.8

STEP 9: For Query 2, “Display the employee id of employee whose name is supriya”, write the
query as shown below and then go to the “Design” ribbon and click on “RUN”.

Fig 24.9

STEP 10: On running the Query, the output will display the Emp_id of the customer whose
name is “Supriya”.

Fig 24.10

Page
129
ISM LAB B.Com-307

STEP 11: For Query 3, “Display the name of the employee whose contact no. is 98454863011”,
write the query as shown below and then click on “RUN”.

Fig 24.11

STEP 12: On running the Query, the output will display the name(s) of the employee(s) whose
contact no. is 98454863011.

Fig 24.12

STEP 13: For Query 4, “Display the details of the employee whose address is D-29, IITM,
JANAKPURI”, write the query as shown below and then click on “RUN”.

Fig 24.13

Page
130
ISM LAB B.Com-307

STEP 14: On running the query, the output will display the details of the employee(s) whose
address is “D-29, IITM, JANAKPURI”.

Fig 24.14

STEP 15: For Query 5, “Display the name of the employees whose salary is greater than
10,000”, write the query as shown below and then click on “RUN”.

Fig 24.15

STEP 16: On running the Query, the output will display the name(s) of the employee(s) whose
salary is greater than 10000.

Fig 24.16
STEP 17: For Query 6, “Update the employee details, set EMP_GRADE equal to C whose
salary is less than 10000.”, write the query as shown below and then click on “RUN”.

Page
131
ISM LAB B.Com-307

Fig 24.17

STEP 18: On running the query, a dialogue box will appear regarding the updation of the
number of records, Click on yes if you want to update the record(s).

Fig 24.18

STEP 19: Now save the table and the record(s) will be updated. Here, the Emp_grade of the
employee(s) whose salary is less than 10000 will be updated and the grade will be updated to
‘C’.

Fig 24.19

STEP 20: For Query 7, “Delete the record of the employee whose gender is male and
designation is manager”, write the query as shown below and then click on “RUN”.

Page
132
ISM LAB B.Com-307

Fig 24.20

STEP 21: On running the query, a dialogue box will appear regarding the deletion of the number
of records, Click on yes if you want to delete the record(s).

Fig 24.21

STEP 22: Now save the table and the record(s) will be deleted. Here, the record(s) of the
employee(s) will be deleted who is male and has manager as the designation. In the given table it
is the employee whose Emp_id is 105 and name is “Daksh” whose record is deleted as shown
below.

Fig 24.22

STEP 23: For Query 8, “Display the name, designation, and salary of all the employees whose
names begins with A”, write the query as shown below and then click on “RUN”.

Page
133
ISM LAB B.Com-307

Fig 24.23

STEP 24: On running the query, the output will display the Emp_name, Designation and Salary
of the employee(s) whose name starts with ‘A’.

Fig 24.24

STEP 25: For Query 9, “Update the employee details; set designation to assistant manager
where designation is trainee”, write the query as shown below and then click on “RUN”.

Fig 24.25

STEP 26: On running the Query, a dialogue box will appear regarding the updation of the
number of records, Click on yes if you want to update the record(s).

Page
134
ISM LAB B.Com-307

Fig 24.26

STEP 27: Now save the table and the record(s) will be updated. Here, the records of the
employees whose designation is “trainee’ will be changed/updated to ‘Assistant manager’.

Fig 24.27

STEP 28: For Query 10, “Display the employee id, name, salary and designation for the
employees where emp_grade is A.”, write the query as shown below and then click on “RUN”.

Fig 24.28

STEP 29: On running the query, the output will display the Emp_id, Emp_name, Salary and
Designation of the employee(s) whose Emp_grade is ‘A’.

Page
135
ISM LAB B.Com-307

Fig 24.29

Q25. Create a table named as BBA_M1 with the following fields:


 E_no
 Student name
 Address

Page
136
ISM LAB B.Com-307

 Phone no
 Grade
Now create another table named as BBA_M2 with the same fields. Add at least 10 records
to the table BBA_M1 (with first 10 enrollment no’s and BBA_M2 with next 10 e_no) and
then perform the following queries on it.
Create a make table query which contains the A grade students from BBA_M1
Append the A grade holders from BBA_M2 to the newly created table in the above query.

ANS:
#STEPS

STEP 1: Create a database in MS Access and then create a table named as “BBA_M1”.

Fig 25.1

STEP 2: Enter the field names and their corresponding data types in the design view.

Fig 25.2

STEP 3: Now go to the datasheet view and enter 10 records in the table.

Page
137
ISM LAB B.Com-307

Fig 25.3

STEP 4: Now create a new table names as “BBA_M2”.

Fig 25.4

STEP 5: Enter the field names and their corresponding data types in the design view.

Fig 25.5
STEP 6: Now go to the datasheet view and enter 10 records in the table.

Page
138
ISM LAB B.Com-307

Fig 25.6

STEP 7: Now in the “Create” ribbon, click on “Query Design”.

Fig 25.7

STEP 8: Now a dialogue box will appear, add the table “BBA_M1” to perform the query.

Fig 25.8
STEP 9: Now drag and drop all the field names to the properties below.

Page
139
ISM LAB B.Com-307

Fig 25.9

STEP 10: Now un tick the checkbox of “Grade” and in the Criteria row, under “Grade” column,
write “’A’” as shown below.

Fig 25.10

STEP 11: Now go to the “Design” ribbon and then click on “RUN”.

Fig 25.11
STEP 12: On running the Query, the output will display the details of the students having ‘A’
grade.

Page
140
ISM LAB B.Com-307

Fig 25.12

STEP 13: Right click on the “Query1” tab and select “SQL View” for the query command as
shown below.

Fig 25.13

STEP 14: In the “Design” ribbon, click on “Make table” button.

Fig 25.14
STEP 15: A dialogue box will appear, write the name of the new table to be created for the ‘A’
grade students of “BBA_M1”. Select the “Current Database” option and then click on “OK”.

Page
141
ISM LAB B.Com-307

Fig 25.15

STEP 16: A new table will be created as shown below.

Fig 25.16

STEP 17: Now again go to the “Create” tab and select “Query Design” and then a dialogue box
will appear, now add “BBA_M2” table to perform query.

Fig 25.17
STEP 18: Now drag and drop the field names of “BBA_M2” to the properties below.

Page
142
ISM LAB B.Com-307

Fig 25.18

STEP 19: Now un tick the checkbox of the column “Grade” and then in the “Criteria” row ,
under the “Grade” column, write “’A’” as shown below.

Fig 25.19

STEP 20: On running the Query, the output will display the ‘A’ grade students from
“BBA_M2”.

Fig 25.20
STEP 21: Now in the “Design” ribbon, click on the “Append” button.

Page
143
ISM LAB B.Com-307

Fig 25.21

STEP 22: A dialogue box will appear, click on the drop down button in the table name and then
select “A_GRADE_STUDENTS” table. Click on the “Current Database” option and then click
on “OK”.

Fig 25.22

STEP 23: Now go to the “A_GRADE_STUDENTS” table and save the table. A dialogue box
will then appear, click “Yes” to modify/append the records.

Fig 25.23
STEP 24: Another dialogue box will appear, which will tell the number of records to be
appended. Click on “Yes” to append the records.

Page
144
ISM LAB B.Com-307

Fig 25.24

STEP 25: Now the “A_GRADE_STUDENTS” table will be appended as shown below.

Fig 25.25

Q26. Create a table employee with the following fields:


 Emp_id
 Emp_name
 Dept_name

Page
145
ISM LAB B.Com-307

 Salary
 Address
 Dob

1. Find the employee ids of the employees having same salary.


2. Find the details of the employee working in the same dept.
3. Find employee id, emp-name of the employee having same dob.

ANS:
#STEPS

STEP 1: Create a database in MS Access and then create a table named as “EMPLOYEE”.

Fig 26.1

STEP 2: Enter the field names and their corresponding data types in the design view.

Fig 26.2

STEP 3: Now go to the datasheet view and enter the records in the table.

Page
146
ISM LAB B.Com-307

Fig 26.3

STEP 4: Go to “Design” ribbon and then click on “Query Design”.

Fig 26.4

STEP 5: A dialogue box will appear, “Add” the table “EMPLOYEE” to perform the queries.

Fig 26.5

Page
147
ISM LAB B.Com-307

STEP 6: Now right click on the “Query1” tab and then select “SQL View”. For Query 1, “Find
the employee ids of the employees having same salary”, write the query as shown below and
then go to the “Design” ribbon and then click on “RUN”.

Fig 26.6

STEP 7: On running the query, the output will display the Emp_id of the employees having the
same salary.

Fig 26.7

STEP 8: Foe Query 2, “Find the details of the employee working in the same dept.”, write the
query as shown below and then click on “RUN”.

Fig 26.8

Page
148
ISM LAB B.Com-307

STEP 9: On running the query, the output will display the details of the employees working in
same department.

Fig 26.9

STEP 10: For Query 3, “Find employee id, emp_name of the employee having same dob”, write
the query as shown below and then click on “RUN”.

Fig 26.10

STEP 11: On running the query, the output will display the Emp_name and Emp_id of the
employees having same DOB.

Fig 26.11

Page
149
ISM LAB B.Com-307

Q27. Create 2 tables as EMPLOYEE and DEPARTMENT with the following table
structure. Employee should have the following fields:
 F_name
 L_name
 E_id
 Dob
 Add
 Salary
 D_no ()
The fields for dept table are:
 Dept_no
 D_name
 Mgr_no
 Mgr_doj
Perform the following queries on it:
 Select the employee’s f_name, d_no and d_name from the above table.
 Select the f_name, l_name and add of the employee who works in the research dept.
 Select the f_name, l_name, d_no, d_name for all the employees having salary>10000

ANS:
#STEPS

STEP 1: Create a database in MS Access and then create a table and name it as “EMPLOYEE”.

Fig 27.1

STEP 2: Enter the field names and their corresponding data types in the design view.

Fig 27.2
STEP 3: Now go to the datasheet view and enter the records in the table.

Page
150
ISM LAB B.Com-307

Fig 27.3

STEP 4: Now create another table named as “DEPARTMENT” in the same database.

Fig 27.4

STEP 5: Enter the field names and their corresponding data types in the design view.

Fig 27.5

STEP 6: Now go to the datasheet view and enter the records in the table

Page
151
ISM LAB B.Com-307

Fig 27.6

STEP 7: Now close the tables and then go to “Database Tools” ribbon and then click on
“Relationships” button.

Fig 27.7

STEP 8: A dialogue box will appear, add both the tables “EMPLOYEE” and
“DEPARTMENT”.

Fig 27.8
STEP 9: The following window will appear, now drag and drop the primary key of
“EMPLOYEE” table to the primary key of “DEPARTMENT” table.

Page
152
ISM LAB B.Com-307

Fig 27.9

STEP 10: A dialogue box will appear, tick all the checkboxes below and then click on “Create”.

Fig 27.10

STEP 11: A ONE-TO-ONE relationship between “EMPLOYEE” table and “DEPARTMENT”


table as shown below.

Fig 27.11
STEP 12: Now go to “Design” ribbon and then click on “Query Design” and then a dialogue
box will appear, add both the tables “EMPLOYEE” and “DEPARTMENT”.

Page
153
ISM LAB B.Com-307

Fig 27.12

STEP 13: Now right click on the “Query1” tab and then select “SQL View”

Fig 27.13

STEP 14: For Query 1,”Select the employee’s f_name, d_no and d_name from the above table”,
write the query as shown below and then click on “RUN”.

Fig 27.14
STEP 15: On running the query, the output will display the F_name, D_no and D_name of the
employees.

Page
154
ISM LAB B.Com-307

Fig 27.15

STEP 16: For Query 2. “Select the f_name, l_name and add of the employee who works in the
research dept.”, write the query as shown below and then click on “RUN”.

Fig 27.16

STEP 17: On running the query, the output will display the F_name, L_name and Address of the
employee(s) working in research department.

Fig 27.17
STEP 18: For Query 3, “Select the f_name, l_name, d_no, d_name for all the employees having
salary>10000”, write the query as shown below and then click on “RUN”.

Page
155
ISM LAB B.Com-307

Fig 27.18

STEP 19: On running the query, the output will display the F_name, L_name, D_no and
D_name of the employee(s) whose salary is greater than 10000.

Fig 27.19

Q28. Create two tables EMPLOYEE and DEPARTMENT with the following fields:
1. EMPLOYEE

Page
156
ISM LAB B.Com-307

 F_NAME
 L_NAME
 E_ID
 DOB
 ADDRESS
 SALARY
2. DEPARTMENT
 D_NO
 D_NAME
 MGR_NO
 MGR-DOJ
Create the forms for the employee as well as the dept table in tabular form and write the
steps to create the forms. Also provide the suitable title to both the forms and insert the
page no’s to it.

ANS:
A form in Access is a database object that you can use to create a user interface for a
database application.

Fig 28.1

#STEPS
STEP 1: Create a database in MS Access and then create a table named as “EMPLOYEE”.

Fig 28.2
STEP 2: Enter the field names and their corresponding data types in the design view.

Page
157
ISM LAB B.Com-307

Fig 28.3

STEP 3: Now go to the datasheet view and then enter the records in the table.

Fig 28.4

STEP 4: Now create another table named as “DEPARTMENT” in the same database.

Fig 28.5

STEP 5: Enter the field names and their corresponding data types in the design view.

Page
158
ISM LAB B.Com-307

Fig 28.6

STEP 6: Now go to the datasheet view and enter the records in the table.

Fig 28.7

#STEPS TO CREATE FORMS FOR “EMPLOYEE” TABLE.

Fig 28.8

METHOD 1
STEP 1: In the “Create” ribbon, in the forms group, click on “More Forms” option and then
select “FORM WIZARD”.

Page
159
ISM LAB B.Com-307

Fig 28.9

STEP 2: A dialogue box will appear.

Fig 28.10

STEP 3: Transfer all the “Available fields” to the “Selected fields” column and then click on
“Next”.

Page
160
ISM LAB B.Com-307

Fig 28.11

STEP 4: Another dialogue box will appear, select “Tabular” for the form to appear in tabular
form. And then click on Next.

Fig 28.12
STEP 5: Another dialogue box will appear, click on “Next”.

Page
161
ISM LAB B.Com-307

Fig 28.13

STEP 6: Another dialogue box will appear, write the suitable title for your form and then click
on “Finish”.

Fig 28.14
STEP 7: The form will be created as shown below.

Page
162
ISM LAB B.Com-307

Fig 28.15

STEP 8: For editing the form, right click on the “VIEW” button and then select “Layout View”.

Fig 28.16

STEP 9: The form can be edited in the layout view as shown below and the form can also be
given suitable heading as shown.

Page
163
ISM LAB B.Com-307

Fig 28.17

METHOD 2
STEP 1: In the “Create” ribbon, in the forms group, click on “FORM” button.

Fig 28.18

STEP 2: The form will be created as shown below. At the bottom is the page/record number,
which can be changed with the help of the arrows provided.

Page
164
ISM LAB B.Com-307

Fig 28.19

STEP 3: On clicking the forward arrows the further records show up. The form can be edited in
“Layout View” and can be given a suitable heading from the “Layout View”.

Fig 28.20
METHOD 3
STEP 1: In the “Create” ribbon, in the forms group, click on “SPLIT FORM” button.

Page
165
ISM LAB B.Com-307

Fig 28.21

STEP 2: The form will appear as shown below; the form screen will be split between two halves
as the first half displaying a particular record and the second half displaying the whole table.

Fig 28.22

STEP 3: Go to the layout view to edit the form and give it a suitable heading.

Page
166
ISM LAB B.Com-307

Fig 28.23

STEP 4: Also one can go to “Design View” to edit the form as shown below.

Fig 28.24

STEP 5: The form will appear in the design view, where the editing can be done as shown
below.

Fig 28.25
METHOD 4
STEP 1: In the “Create” ribbon, in the forms group, click on “MULTIPLE ITEMS” button.

Page
167
ISM LAB B.Com-307

Fig 28.26

STEP 2: The form will appear as shown below.

Fig 28.27

STEP 3: For editing the form and giving a suitable heading, go to the “Layout View” and the
form can be edited as shown below.

Page
168
ISM LAB B.Com-307

Fig 28.28

#STEPS FOR CREATING FORM FOR “DEPARTMENT” TABLE.

METHOD 1
STEP 1: In the “Create” ribbon, in the forms group, click on “More Forms” option and then
select “FPRM WIZARD”.

Fig 28.29

STEP 2: A dialogue box will appear, Transfer all the “Available fields” to the “Selected fields”
column and then click on “Next”.

Page
169
ISM LAB B.Com-307

Fig 28.30

STEP 3: Another dialogue box will appear, select “Tabular” for the form to appear in tabular
form. And then click on Next.

Fig 28.31
STEP 4: Another dialogue box will appear, click on “Next”.

Page
170
ISM LAB B.Com-307

Fig 28.32

STEP 5: Another dialogue box will appear, write the suitable title for your form and then click
on “Finish”.

Fig 28.33
STEP 6: The form will appear as shown below.

Page
171
ISM LAB B.Com-307

Fig 28.34

STEP 7: Go to the “Layout View” to edit the form.

Fig 28.35

STEP 8: The form can be edited and a suitable heading can be given to the form in the layout
view as shown below.

Page
172
ISM LAB B.Com-307

Fig 28.36

METHOD 2
STEP 1: In the “Create” ribbon, in the forms group, click on “FORM” button.

Fig 28.37

STEP 2: The form will be created as shown below.At the bottom is the page/record number,
which can be changed with the help of the arrows provided.

Page
173
ISM LAB B.Com-307

Fig 28.38

STEP 3: On clicking the forward arrows the further records show up. The form can be edited in
“Layout View” and can be given a suitable heading from the “Layout View”.

Fig 28.39

METHOD 3
STEP 1: In the “Create” ribbon, in the forms group, click on “SPLIT FORM” button.

Page
174
ISM LAB B.Com-307

Fig 28.40

STEP 2: The form will be created as shown below; the form screen will be split between two
halves as the first half displaying a particular record and the second half displaying the whole
table.

Fig 28.41

STEP 3: The form can be edited and can be given a suitable heading in the layout view as shown
below.

Page
175
ISM LAB B.Com-307

Fig 28.42

METHOD 4
STEP 1: In the “Create” ribbon, in the forms group, click on “MULTIPLE ITEMS” button.

Fig 28.43

STEP 2: The form will appear as shown below.

Page
176
ISM LAB B.Com-307

Fig 28.44

STEP 3: The form can be edited in the “Layout View” as shown below.

Fig 28.45
Q29. Create a table named STUDENT_DETAILS with the following fields:
 R_no

Page
177
ISM LAB B.Com-307

 Name
 Course name
 Attendance
 Dob
 Add
Course will have values either economics or dbms. Enter 5 records. Create a form for the
above table in design view. Add text box and the following buttons to it:
 Go to first record
 Go to last record
 Go to previous record
 Go to next record
Add a label student form to it.

ANS:
#STEPS

STEP 1: Create a database in MS Access and then create a table named as


“STUDENT_DETAILS”.

Fig 29.1

STEP 2: Enter the field names and their corresponding data types in the design view.

Fig 29.2
STEP 3: Now go to the datasheet view and then enter the records in the table,

Page
178
ISM LAB B.Com-307

Fig 29.3

STEP 4: Now go to “Create” ribbon and then select “Form Design”.

Fig 29.4

STEP 5: The following window will appear.

Fig 29.5

STEP 6: In the “Design” ribbon, select “Add existing fields”.

Page
179
ISM LAB B.Com-307

Fig 29.6

STEP 7: The following box will appear on the left side of the screen.

Fig 29.7

Fig 29.8

STEP 8: Now drag and drop all the field names to the Design area except “Course_name”. For
“Course_name”, select a label and draw it as shown below.

Page
180
ISM LAB B.Com-307

Fig 29.9

STEP 9: Now select a “Combo box” from the above tab, to create a drop down menu for
“Course_name”.

Fig 29.10

STEP 10: A dialogue box will now appear, select the option “I will type in the values that I
want”, and then click on “Next”.

Page
181
ISM LAB B.Com-307

Fig 29.11

STEP 11: Another dialogue box will appear, type in the values of “Course_name”, i.e.
“Economics” and “DBMS”. And then click on “Next”.

Fig 29.12
STEP 12: Another dialogue box will appear, select “Remember the value for later use” option
and then click on “Next”.

Page
182
ISM LAB B.Com-307

Fig 29.13

STEP 13: Another dialogue box will appear, write the name of the field to which you want to
apply the combo box. And then click on “Finish”

Fig 29.14

STEP 14: The Course_name will have a drop down menu having the options “Economics” and
“DBMS”.

Page
183
ISM LAB B.Com-307

Fig 29.15

STEP 15: To check whether it is working or not, go to “Form View” as shown below.

Fig 29.16

STEP 16: Now go to the design view and edit the form as shown below.

Page
184
ISM LAB B.Com-307

Fig 29.17

STEP 17: Now to add a label “STUDENT FORM” to the form, select the label button from the
“Design” ribbon and draw the label on the top of the form as shown below.

Fig 29.18
STEP 18: Now to add buttons, select the “Button” option from the “Design” ribbon.

Page
185
ISM LAB B.Com-307

Fig 29.19

STEP 19: Draw the button and then a dialogue box will appear, In the Categories column, select
“Record Navigation”.

Fig 29.20

STEP 20: Now select the “Go To First Record” option and then click on “Next”.

Page
186
ISM LAB B.Com-307

Fig 29.21

STEP 21: Another dialogue box will appear, select the type of button you want and then click on
“Next”.

Fig 29.22

STEP 22: Another dialogue box will appear, give a suitable name to your button to save it and
then click on “Finish”.

Page
187
ISM LAB B.Com-307

Fig 29.23

STEP 23: The “Go To First Record” button will appear now.

Fig 29.24

STEP 24: For creating another button, again select the button option and then draw a button and
then a dialogue box will appear. Select the “Go To Last Record” option and then click on
“Next”.

Fig 29.25
STEP 25: Another dialogue box will appear, select the type of button you want and then click on
“Next”.

Page
188
ISM LAB B.Com-307

Fig 29.26

STEP 26: Another dialogue box will appear, give a suitable name to your button to save it and
then click on “Finish”.

Fig 29.27

STEP 27: The “Go To Last Record” button will appear now.

Page
189
ISM LAB B.Com-307

Fig 29.28

STEP 28: For creating another button, again select the button option and then draw a button and
then a dialogue box will appear. Select the “Go To Previous Record” option and then click on
“Next”.

Fig 29.29

STEP 29: Another dialogue box will appear, select the type of button you want and then click on
“Next”.

Fig 29.30
STEP 30: Another dialogue box will appear, give a suitable name to your button to save it and
then click on “Finish”.

Page
190
ISM LAB B.Com-307

Fig 29.31

STEP 31: The “Go To Previous Record” button will appear now.

Fig 29.32

STEP 32: For creating another button, again select the button option and then draw a button and
then a dialogue box will appear. Select the “Go To Next Record” option and then click on
“Next”.

Fig 29.33
STEP 33: Another dialogue box will appear, select the type of button you want and then click on
“Next”.

Page
191
ISM LAB B.Com-307

Fig 29.34

STEP 34: Another dialogue box will appear, give a suitable name to your button to save it and
then click on “Finish”.

Fig 29.35

STEP 35: The “Go To Next Record” button will appear now.

Page
192
ISM LAB B.Com-307

Fig 29.36

STEP 36: The form will look like shown below in the design view,

Fig 29.37

STEP 37: Now go to the “Form View”.

Page
193
ISM LAB B.Com-307

Fig 29.38

STEP 38: New records can be added in the table and the records can be changed/moved by the
buttons below.

Fig 29.39

STEP 39: Example of a record.

Page
194
ISM LAB B.Com-307

Fig 29.40

Page
195

You might also like