0% found this document useful (0 votes)
26 views81 pages

Udyan Kumar - Ism Lab File

Uploaded by

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

Udyan Kumar - Ism Lab File

Uploaded by

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

Practical File on

ISM

Bachelor of Business Administration (BBA-212)

Guru Gobind Singh Indraprastha University, Delhi

Submitted To Submitted By:


Ms. Anjaly Chauhan Udyan kumar
(Assistant Professor, IT Department) Enroll No: 08921101720
Ms. Chitra Nasa Class: BBA 4 th E2
(Assistant Professor, IT Department) Batch: 2020-2023

Institute of Information Technology & Management,

Approved By AICTE
Affiliated to Guru Gobind Singh Indraprastha University, Dwarka, New Delhi
New Delhi – 110058

Batch (2020-2023)
ISM LAB FILE Udyan kumar 08921101720

ISM LAB INDEX


Sr Practical Name Date Signature
No
1 Define Data, Information, Database, DBMS and RDBMS

2 Give 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 tables in database?
3 Give the steps to create table in design view and datasheet view.

4 Explain Field Name, Data Types, Field Size with its Description.

5 Give the steps to open an existing database.

6 Various data types in Database. Create a student database


with a table STUDENT_DETAILS containing the field name
as

ID
FIRST NAME
LAST NAME
AGE
ADDRESS

Insert 5 records using the design view in MS-ACCESS.

Create another table using data sheet view as


STUDENT_COURSE with the field name as

ID
COURSE CODE
COURSE NAME.

Enter 5 records.
7 Steps to create a database, save the database and open the
database. Create a student database with S1 as table
containing the field names as SERIAL NO, ENROLLMENT
NO, NAME, AGE and ADDRESS.

Insert at least 10 records using the design view in MS ACCESS.


8 Create a database named EMPLOYEE with the following
fields as
Emp_code
Emp_ssn
Emp_name
DOB
2 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Emp_design
DOJ
E_sal
Years Of Experience

Delete any two records as well as fields from the table to show
the output.
9 Create an EMPOYEE database with the following fields as
Emp_code
Emp_ssn
Emp_name
DOB
Emp_design
Emp_dept
DOJ
E_SAL
Years of experience

For the above created database set the following fields


properties:
Employee names should be in upper case with field size equal
to10.
Set the default value of Emp_dept as HR.

Date of joining should be set to the current date by default.


E_SAL should be in dollars.

10 Create an EMPLOYEE database with the following fields as:


Emp_code
Emp_ssn
Emp_name
DOB
Emp_design
Emp_dept
DOJ
E_SAL
Years of experience

For the above created database set the input mask for the field
property for Emp_ssn and Emp_dob using the input mask
wizard.
11 Create a database named as STUDENT DATABASE with a
table STUDENT_DETAILS having fields as
St_id
St_roll no.
St_name
St-age
St-dob

3 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

St_course
St-add
St_contact
St_phone no.
S_marks
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 as its values.

3. S_marks, it can be NULL or should be > 50.

4. S_dob should be less than the current date.


Enter at least 10 entries in the table.
12 Create a database named as STUDENT DATABASE with a
table STUDENT_DETAILS having fields as
St_id
St_roll no.
St_name
St-age
St-dob
St_course
St-add
St_contact
St_phone no.
S_marks

Add at least 10 records in the table. Answer the following:


What is a primary key? Make a field stu_id as the primary key
in the table. Also write down the steps for the same.
What is a composite key? In the table
STUDENT_DETAILS, make stu_roll no and stu-dob
as a composite key also write the steps for the same.
13 Create a company database with the following table
EMP_DETAILS with the fields as:
EMP_ID
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 both the fields.
Establish a relationship between the table EMP-

4 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

DETAILS AND DEPT_DETAILS AS 1:1, 1: M and


Also enforce referential integrity constraint on it and write
down the steps for the same.
14 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:
Acc no
Act type
Do_opening
Transaction_type
Balance
Account H_name
Transaction ID
Enter 12 records in the table and perform the following queries
on it.
Display the acc no in ascending order.
Display the details of account where acc no is 675.
Display the details of where acc no is 675 and name is AJAY.
Display the acc no, acc type, account H_name and balance where
balance is greater than 5000.
15 Create a table Student with following fields
Enrolment_no
S_name
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 detail of student named Anjali.
Display the list of students of batch ‘2017-2020’ and course_is
17.
Display the number of students in course_id 44.
16 Create a table EMPLOYEE with the following fields:
Emp_id
Emp_name
Dept_name
Salary
Add
Date of joining
Perform the following queries on it.
Delete the records of the employee whose Emp_id is 101
Delete the record of the employees whose Dept_name is HR
and salary >10000
Delete the record of the employee whose name begins with S
or salary >10000
Update the record of the employees, set Dept_name = IT
where Dept_name is PRODUCTION.
Update the record of the employee, set salary to 15000 where
5 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Dept_name is IT.
17 Write SQL Queries using Data Definition Commands like CREATE,
DROP, TRUNCATE, RENAME, ALTER. And Data manipulation
commands like INSERT, UPDATE, DELETE and SELECT

Create Table named Student with Fields Student id, Name, Age,
Course, Fees.

And apply above mentioned commands on the table.


18 Write SQL Queries using SQL Commands

Create a Table Product with Fields

PRO_ID
PRO_NAME
PRO_PRICE
And make PRO_ID as the primary key.
Insert 10 Records into the Table.

1. Write a query to find the Name of Product where PRO_PRICE>=


500 from PRODUCT Table.

2. Write a query to implement Aggregate Functions on field


PRICE”.

3. Write a query to COUNT the number of Records in the Product


Table.
19 Write SQL Queries using Data Manipulation Commands

Insert record into Table named Employee with Fields

EMP_ID
EMP_NAME
EMP_DESIGNATION
EMP_AGE
EMP_DEPARTMENT
EMP_SALARY
And make EMP_ID as the primary key.
1. Write a query to find the salary of a person where age is <= 26
and salary >= 25000 from Employee Table.

2. Write a query to find the name of Employee whose name is like


“Ku%”.

3. Write a query to find the customer details using “IN” and


“Between” operator where age can be 25 or 27.

20 Create an ER Diagram for COLLEGE Management system.

21 Create an ER Diagram for Airline Reservation System.

6 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO-1
7 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

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


ANS:
 DATA
Data can be defined as a systematic record of a particular  quantity. It is the different values of
that quantity represented together in a set. It is a collection of facts and figures to be used for a
specific purpose such as a survey or analysis. When arranged in an organized form, can be called
information. The source of data (primary data, secondary data) is also an important factor.

Fig.1.1
 INFORMATION
Information is processed, organized and structured data. It provides context for data and
enables decision making process. For example, a single customer’s sale at a restaurant is data
– this becomes information when the business is able to identify the most popular or least
popular dish.
More technically, information can be thought of as the resolution of uncertainty; it answers
the question of "What an entity is" and thus defines both its essence and the nature of its
characteristics. The concept of information has different meanings in different contexts.

Fig.1.2

 DATABASE

8 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

In computing, a database is an organized collection of data stored and accessed electronically.


Small databases can be stored on a file system, while large databases are hosted on computer
clusters or cloud storage. The design of databases spans formal techniques and practical
considerations including data modeling, efficient data representation and storage, query
languages, security and privacy of sensitive data, and distributed computing issues including
supporting concurrent access and fault tolerance.

Fig.1.3
 DBMS
 Database management system (or DBMS) is essentially nothing more than a computerized
data-keeping system. Users of the system are given facilities to perform several kinds of
operations on such a system for either manipulation of the data in the database or the
management of the database structure itself.
Database management systems are set up on specific data handling concepts, as the practice
of administrating a database evolves. The earliest databases only handled individual single
pieces of specially formatted data. Today’s more evolved systems can handle different kinds
of less formatted data and tie them together in more elaborate ways.

Fig.1.4

 RDBMS
9 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

The software used to store, manage, query, and retrieve data stored in a relational database
is called a relational database management system (RDBMS). The RDBMS provides an
interface between users and applications and the database, as well as administrative
functions for managing data storage, access, and performance.
It is a DBMS in which the database is organized and accessed according to the
relationships between data items. In a relational database, relationships between data items
are expressed by means of tables. Interdependencies among these tables are expressed by
data values rather than by pointers. This allows a high degree of data independence.

Fig.1.5

PRACTICAL NO. 2

10 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Q.1 Give some 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
tables in database?
Steps to open Microsoft Access
Step 1: Go to windows tab Search Microsoft office Select Microsoft Access
2013.

Fig.2.1
Step 2: Open Microsoft Access 2013.

Fig.2.2

#VARIOUS ELEMENTS OF DATABASE:-

11 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

1. TABEL:- Tables contain fields or columns that store different kinds of data, such
as a name or an address, and records or rows that collect all the information about a
particular instance of the subject, such as all the information about a customer or
employee etc.
2. FORM:- Form is an object in a desktop database designed primarily for data input
or display or for control of application execution. You use forms to customize the
presentation of data that your application extracts from queries or tables.

3. REPORT:- Report is an object in desktop databases designed for formatting,


calculating, printing, and summarizing selected data. You can view a report on your
screen before you print it.
4. QUERY:- An object that provides a custom view of data from one or more tables.
Queries are a way of searching for and compiling data from one or more tables. You
can define queries to Select, Update, Insert, or Delete data.

Fig.2.3

12 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.3
Q.3. Give the steps to create table in design view and datasheet view.
Soln Steps
Step 1: Open Microsoft office access from Windows Tab.

Fig 3.1

13 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Step 2: open any existing database or create a new one.

Fig 3.2

Fig.3.2.1
Step 4: Default, table appears in datasheet view, Have to change it in design view.

Fig.3.4
Step 5: Now input the desirable in the fields of the table.

Fig.3.5

14 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

#Steps to create a table in design view:


Step 1: After the above steps, save the table by clicking on save as from the office view.

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

Fig.3.7
Step 3: Now the design view will appear.

Fig3.8

15 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.4
Q. Give the step to open an existing database.
Step 1 Go to windows tab Open MS Access 2013 in Microsoft 2013

Fig.4.1
Step 2 In open tab select your existing file to open.

16 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.4.2

PRACTICAL NO.5
Q. Explain field name, data types and Field Size. With its description
Answer:-
Field Name:
Field name is the name of column. It should represent the contents of the field such as !
"Name", "Address" and "Final Grade" etc. the name of the field cannot exceed 64 characters
in length. It many include spaces. The use of spaces in field name is not a good practice.

Fig.5.1
17 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Data Type
Each filed must be assigned a particular data type. The data type specifies the type of data
that can be stored in the field. Common data types in MS Access are Number, Text, Currency
and Date etc.

Fig.5.2

Field Size
Field size is used to set the number of characters required in text or number held. The default
field size for the text type is 50 characters. The field size can be limited to ai certain number
of characters if value in field is small. It waves disk space and prevents entry errors. The filed
size is set in exact characters for Text type. The options for numbers are as follows.

Fig.5.3

18 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.6
Q.1Create a student database with STUDENT DETAILS containing the fields name as
 ID
 FIRSTNAME
 LASTNAME
 AGE
 ADDRESS

Insert 5 records using the design view in MS-ACCESS.


STEPS:-
1. Create a new database named as student in Design View in MS-Access.

19 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig:-6.1

2. Save the table as STUDENT_DETAILS.

Fig:-6.2

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

Fig:-6.3

20 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

4. Now go to the database view and enter the records in the table.

Fig:-6.4

21 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Q2.Create another table using datasheet views As STUDENT_COURSE with the field name
as
 ID
 COURSE CODE
 COURSE NAME

Enter 5 records.
STEPS:-
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:-6.5

2. Save the name of the table as STUDENT_COURSE.]

Fig:-6.6

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

22 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig:-6.7

4. Enter 5 records in the table.

Fig:-6.8

PRACTICAL NO.7
23 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Q- Write the Steps to create a database, save the database and open the
database. Create a student database with S1 as table containing the field
names as SERIAL NO, ENROLLMENT NO, NAME, AGE and
ADDRESS.
Insert at least 10 records using the design view in MS ACCESS.

STEPS:-
1. Create a new database named as student in Design View in MS-Access.

Fig:-7.1

2. Save the table as STUDENT_DETAILS.

Fig:-7.2

24 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

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

Fig:-7.3

4. Now go to the database view and enter the records in the table.

Fig:-7.4

25 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.8

Create a database named EMPLOYEE with the following fields as


EMPLOYEE _ID,
EMPLOYEE_NAME,
EMPLOYEE_DESIGNATION,
EMPLOYEE_DEPARTMENT,
DATE OF JOINING,
SALARY and
YEAR OF EXPERIENCE

Delete any two records as well as fields from the table to show the output.

Fig No. 8.1

Fig No. 8.2

26 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 8.3

Fig No. 8.4

Fig No. 8.5

Fig No. 8.6

Fig No. 8.8


8.7
27 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 8.8

PRACTICAL NO.9
Create an EMPOYEE database with the following fields as
● Emp_code
● Emp_ssn
● Emp_name
● DOB
● Emp_design
● Emp_dept
● DOJ
28 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

● E_SAL
● Years of experience
For the above created database set the following fields properties:
1. Employee names should be in upper case with field size equal to10.
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-

Fig No. 9.1

# Steps For Creating EMPLOYEE Data base and S1 table.


Step 1: Create a new database named as EMPLOYEE

Fig No. 9.2

STEP 2: Save the table name as Employee.

Fig No. 9.3

STEP: For gender


29 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 9.4

Fig No. 9.5

30 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 9.6

Fig No. 9.7

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 No. 9.8

31 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 9.9

Fig No. 9.10

Fig No. 9.11

32 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 9.12

33 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.10
Create an EMPLOYEE database with the following fields as:
● Emp_code
● Emp_ssn
● Emp_name
● DOB
● Emp_design
● Emp_dept
● DOJ
● E_SAL
● Years of experience
For the above created database set the input mask for the field property for Emp_ssn and
Emp_dob using the input mask wizard.
Solution:
STEP: FOR SSN
1. Use text as data type.
2. Go to general, click on input Mask wizard.
3. Now in the dialogue box, click on "social security number" and press "Next".

Fig No. 10.1

4. In the "place character", select any character ("-" in this case); then press "next".
34 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 10.2


5. Now select the way you want to store the data i.e. with symbols or without symbols.
And press "next".

Fig No. 10.3

6. Click on finish

35 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 10.4


7. Now the input mask will display the format of emp sen.

Fig No. 10.5

36 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

FOR DOJ
1. Go to design view. In data type select “TEXT”.

Fig No. 10.6


2. Go to general, click on input Mask wizard.
3. Now in the dialogue box, click on "short date" and press "Next".

Fig No. 10.7

4. In the "placeholder character", select any character ("-" in this case); then press
"next".

37 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig No. 10.8


5. Click finish.

Fig No. 10.9

Fig No. 10.10


PRACTICAL NO.11
Create a database named as STUDENT DATABASE with a table
STUDENT_DETAILS having fields as
38 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 St_id
 St_roll no.
 St_name
 St-age
 St-dob
 St_course
 St-add
 St_contact
 St_phone no.
 S_marks
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 as its values.
3. S_marks, it can be NULL or should be > 50.
4. S_dob should be less than the current date.
Enter at least 10 entries in the table.
SOLUTION:-

Fig.11.1

Make S_id as the primary key and apply the following validations: 

Steps
1. Select the field you want to add primary key.

Fig.11.2

2. Go to ‘Design’ option in Menu bar.


3. You will find Primary Key option, click on that.

39 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.11.3

4. Now your field got the primary key.

Fig.11.4

1. S_name should start with A and end with M. 


Steps
 Select the Field you want to modify. Field Properties will appear.

Fig.11.5

 Go to Validation Rule in Field Properties


 Write ‘Like “A*M”’ inside validation rule and save the table.

Fig.11.6

 Only names start with A and ends with M will be accept.

40 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.11.7

2. S_course can have only BBA OR MBA as its values.


Steps
 Select the Field you want to modify. Field Properties will appear.

Fig.11.8

 Go to Validation rule in Field Properties.


 Write “BBA” Or “MBA” inside validation rule box and save.

Fig.11.9

 Only BBA and MBA courses will be accept in table.

Fig.11.10

3. S_marks, it can be NULL or should be > 50.


Steps

41 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Select the Field you want to modify. Field Properties will appear.

Fig.11.11

 Go to Validation rule in Field Properties.


 Write “<=50 Or Is Null” inside validation rule box and save.

Fig.11.12
 Only marks between 0 and 50 will be accepted by table.

Fig.11.13

PRACTICAL NO.12
Create a database named as STUDENT DATABASE with a table

42 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

STUDENT_DETAILS having fields as


 St_id
 St_roll no.
 St_name
 St-age
 St-dob
 St_course
 St-add
 St_contact
 St_phone no.
 S_marks

Add at least 10 records in the table. Answer the following:
A. What is a primary key? Make a field stu_id 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_roll no and stu-dob
as a composite key also write the steps for the same.
SOLUTION:-
Add at least 10 records in the table.

Fig.12.1
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. 
A primary key is the column or columns that contain values that uniquely identify each
row in a table. A database table must have a primary key for Optima to insert, update,
restore, or delete data from a database table. Optima uses primary keys that are defined
to the database.

Steps
 Select the field you want to add primary key.
43 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.12.2

 Go to ‘Design’ option in Menu bar.


 You will find Primary Key option, click on that.

Fig.12.3

 Now your field got the primary key.

Fig.12.4

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. 

44 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

A composite key is made by the 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 of a row is guaranteed, but when it is taken individually it does not guarantee
uniqueness, or it can also be understood as a primary key made by the combination of
two or more attributes to uniquely identify every row in a table.

Steps
 Select the fields you want to add the composite key.

Fig.12.5
 Go to ‘Design’ option in Menu bar.
 You will find Primary Key option, click on that.

Fig.12.6

 Now your field got the primary key.

Fig.12.7

PRACTICAL NO.13
45 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Create a company database with the following table EMP_DETAILS with the
fields as:
 EMP_ID
 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 both the fields.
Establish arelationshipbetween the table EMP- DETAILS AND
DEPT_DETAILS AS 1:1, 1: M and
Also enforce referential integrity constraint on it and write down the steps for
the same.
SOLUTION:-
 Make a department details record in access.

Fig.13.1
 Make an Employee details record in access.

Fig.13.2

46 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Make a Projects record in access.

Fig.13.3
 Select the Relationships option from database tools.

Fig.13.4
 Establish a relationship between the table Emp_details and Dept_details as 1:1 and 1:M.

Fig.13.5

 Establish a relationship between tables Emp_details and Projects as 1:1.


47 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.13.6
 The relations will be shown as follows:

Fig.13.7

48 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.14
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:
• Acc no
• Act type
• Do_opening
• Transaction_type
• Balance
• Account H_name
• Transaction ID
Enter 12 records in the table and perform the following queries on it.
 Display the acc no in ascending order.
 Display the details of account where acc no is 675.
 Display the details of where acc no is 675 and name is AJAY.
Display the acc no, acc type, account H_name and balance where balance is
greater than 5000.

SOLUTION:-
 Create a table named ACCOUNT and enter 10 records in it.

Fig.14.1
 Select the query wizard.

Fig.14.2

49 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Select simple query wizard and click on OK.

Fig.14.3
 Add the fields in selected fields column.

Fig.14.4
 Select the detailed query and click on next.

Fig.14.5

50 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Give suitable title to the query and select the modify query design.

Fig.14.6
Steps to display the Acc_no in ascending order:
 From Account query select sort.
 From the drop-down menu select ascending.

Fig.14.7

 Following screenshot shows the SQL view of the query.

Fig.14.8

51 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 The Data is now arranged in the ascending order.

Fig.14.9
Steps to display the details of the account where account no is 675:
 From the query go to criterial field.
 In criteria field type 675.

Fig.14.10
 Following screenshot shows the SQL view of the Query.

Fig.14.11

52 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Now, only the details of account 675 will be shown.

Fig.14.12
Steps to display the details of the account where the account no is 675 and name is Ajay:
 From the account query, go to criteria.
 In criteria type 675 in account number field and type Ajay in account holder name.

Fig.14.13

 Following Screenshot shows the SQL view of the query.

Fig.14.14

 Now only record with account number 675 and account holder name Ajay will be shown.

Fig.14.15

53 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Steps to display the account no, account type, Acc_H_name, and balance and where the
balance is greater than 5000:
 In the account query go to criteria.
 In criteria write >5000 in account balance field.

Fig.14.16

 Following screenshot shows the SQL view of the Query.

Fig.14.17

 The result will show all the accounts with the balance greeater than 5000.

Fig.14.18

PRACTICAL NO.15
54 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Create a table Student with following fields


• Enrolment_no
• S_name
• 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 detail of student named Anjali.
• Display the list of students of batch ‘2017-2020’ and course_is 17.
Display the number of students in course_id 44.

SOLUTION:-

Step 1: Enter the field names and there corresponding data types in the design view.

Fig.15.1

Step 2: Now enter the records in the table in the datasheet view.
55 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.15.2
Step 3: For Query 1, “Display the list of students in batch “2017-2020”, write the query as
shown below and then click on “RUN”.

Fig.15.3
Step 4: On running the query, the output will display the list of students of batch ‘2017-20’.

Fig.15.4

56 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

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

Fig.15.5

Step 6: On running the query, the output will display the Enrollment no. of the students who
are in fourth semester.

Fig.15.6

57 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Step 7: For Query 3, “Display the detail of student named “Anjali”, write the query as shown
below and then click on “RUN”.

Fig.15.7
Step 8: On running the Query, the output will display the detail of student named “Anjali”.

Fig.15.8
Step 9: For Query 4, “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.15.9
58 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Step 10: On running the Query, the output will display the details of the students of 2017-20
and course ID is 17.

Fig.15.10
Step 11: For Query 5, “Display the number of students in Course_ID 44” , write the query as
shown below and then click on “RUN”.

Fig.15.11
Step 12: On running the query, the output will display the number of student in course ID 44.

Fig.15.12

59 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.16
Create a table EMPLOYEE with 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.
Update the record of the employee, set salary to 15000 where Dept_name is
IT.
SOLUTION:-
 Date of joining

Fig.16.1

Perform the following queries on it.


1. Display the dept_name and total salary of employees department wise where
salary is greater than 40,000.

Fig.16.2

60 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

2. Delete the records of the employee whose Emp_id is 101

Fig.16.3

3. Delete the record of the employees whose Dept_name is HR and salary >100

Fig.16.4
4. Delete the record of the employee whose name begins with S or salary >10000

Fig.16.5

5. Update the record of the employees, set Dept_name = IT where Dept_name is


61 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRODUCTION.

Fig.16.6
6. Update the record of the employee, set salary to 15000 where Dept_name is
IT.

Fig.16.7

PRACTICAL NO.17
62 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Write SQL Queries using Data Definition Commands like CREATE, DROP,
TRUNCATE, RENAME, And ALTER. And Data manipulation commands like
INSERT, UPDATE, DELETE and SELECT
Create Table named Student with Fields Student id, Name, Age, Course, Fees.
And apply above mentioned commands on the table.
SOLUTION:-
CREATE

Fig.17.1
INSERT

Fig.17.2
OUTPUT
63 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.17.3

ALTER

Fig.17.4

RENAME
64 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.17.5
DROP

Fig.17.6
OUTPUT

Fig.17.7

DELETE

65 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.17.8

Queries using Data Manipulation Commands like INSERT, UPDATE,


DELETE and SELECT. Insert record into Table named Student with
66 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fields Student id, Name, Age, Course, Fees. And apply above mentioned
commands on the table.
INSERT

Fig.17.9
OUTPUT

Fig.17.10

UPDATE
67 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.17.11
OUTPUT

Fig.17.12
DELETE

Fig.17.13
OUTPUT

68 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.17.14
SELECT

Fig.17.15
OUTPUT

Fig.17.16

69 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

PRACTICAL NO.18
Write SQL Queries using SQL Commands
Create a Table Product with Fields
 PRO_ID
 PRO_NAME
 PRO_PRICE
And make PRO_ID as the primary key.
Insert 10 Records into the Table.

1. Write a query to find the Name of Product where PRO_PRICE>= 500 from
PRODUCT Table.
2. Write a query to implement Aggregate Functions on field PRICE”.
3. Write a query to COUNT the number of Records in the Product Table.
SOLUTION:-
 Create a table with fields mentioned above in question, using SQL commands.

Fig.18.1

Fig.18.2
70 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

 Enter 10 records.

Fig.18.3
 QUERY 1

Fig.18.4

 Output

71 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.18.5
 QUERY 2 AVG:

Fig.18.6
 OUTPUT

Fig.18.7
 COUNT

72 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.18.8
 OUTPUT

Fig.18.9

 SUM

Fig.18.10
 OUTPUT

73 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.18.11
 MINIMUM

Fig.18.12

 OUTPUT

74 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.18.13

 MAXIMUM

Fig.18.14
 OUTPUT

Fig.18.15

 QUERY

Fig.18.16

 OUTPUT
75 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.18.17

PRACTICAL NO.19
Write SQL Queries using Data Manipulation Commands
Insert record into Table named Employee with Fields
 EMP_ID
 EMP_NAME
 EMP_DESIGNATION
 EMP_AGE
 EMP_DEPARTMENT
 EMP_SALARY
And make EMP_ID as the primary key.
1. Write a query to find the salary of a person where age is <= 26 and salary >=
25000 from Employee Table.
2. Write a query to find the name of Employee whose name is like “Ku%”.
3. Write a query to find the customer details using “IN” and “Between” operator
where age can be 25 or 27.
SOLUTION:-

STEP1: Enter the records in the table in the datasheet view.

76 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.19.1

STEP2: FOR QUERY 1, FIND SALARY OF A PERSON WHERE AGE IS<=26 AND
SALARY>=25000 FROM EMPLOYEE TABLE, WRITE THE QUERY AS SHOWN
BELOW AND THEN CLICK ON “RUN”.

Fig.19.2
STEP3: On running the query, the output will display the EMP_SALARY.

77 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

Fig.19.3
STEP4: For query 2, the name of employee whose name is like “ku%”, write the query as
shown below and then click on “run”.

Fig.19.4
STEP5: ON RUNNING THE QUERY, THE OUTPUT WILL DISPLAY THE NAME OF
EMPLOYEE WHOSE NAME STARTS WITH “KU”

Fig.19.5
STEP6: FOR QUERY 3, THE EMPLOYEE DETAILS USING “IN” AND “BETWEEN”
OPERATOR WHERE AGE CAN BE 25 OR 27, WRITE THE QUERY AS SHOWN

78 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

BELOW AND THEN CLICK ON “RUN”.

Fig.19.6
STEP7: On running the query, the output will display the employee details where age is
between 25 or 27.

Fig.19.7

PRACTICAL NO.20
Create an ER Diagram for COLLEGE Management system.

79 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

SOLUTION:-1

Fig.21.1

PRACTICAL NO.21
Create an ER Diagram for Airline Reservation System.

80 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720

SOLUTION:-

Fig.22.1

81 BBA IV E2

You might also like