Udyan Kumar - Ism Lab File
Udyan Kumar - Ism Lab File
ISM
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
4 Explain Field Name, Data Types, Field Size with its Description.
ID
FIRST NAME
LAST NAME
AGE
ADDRESS
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.
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 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.
4 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.
PRO_ID
PRO_NAME
PRO_PRICE
And make PRO_ID as the primary key.
Insert 10 Records into the Table.
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.
6 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
PRACTICAL NO-1
7 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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
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
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.
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
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
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
19 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
Fig:-6.1
Fig:-6.2
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
Fig:-6.6
22 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
Fig:-6.7
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
Fig:-7.2
24 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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
Delete any two records as well as fields from the table to show the output.
26 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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-
30 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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.
31 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
32 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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".
4. In the "place character", select any character ("-" in this case); then press "next".
34 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
6. Click on finish
35 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
36 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
FOR DOJ
1. Go to design view. In data type select “TEXT”.
4. In the "placeholder character", select any character ("-" in this case); then press
"next".
37 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
39 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
Fig.11.3
Fig.11.4
Fig.11.5
Fig.11.6
40 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
Fig.11.7
Fig.11.8
Fig.11.9
Fig.11.10
41 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
Select the Field you want to modify. Field Properties will appear.
Fig.11.11
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
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
Fig.12.3
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
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
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
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
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
Fig.14.8
51 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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
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
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
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
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
Fig.16.2
60 BBA IV E2
ISM LAB FILE Udyan kumar 08921101720
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
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
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:-
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
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