ISM Lab File
ISM Lab File
PRACTICAL - 1
Q) Define Data Information, Database, DBMS and RDBMS.
DATA - Data is any sort of information which is stored in computer memory. This information can later be used
for a website, an application or any other client to store for future purpose. The most common information is User
information in the form of user personal, address and banking information. Let’s consider Facebook, it stores our
personal data, images, posts, comments and many more things. Banking application also stores user data, their
transactions details, funds summary etc. All this information is data, but when it put together and store in a
structural way, it becomes informational data.
DATABASE - Database (DB) are organized, they have a structure, and all the data they store it fits into that
structure. More specifically, a database is an electronic system that allows data to be stored, easily accessed,
manipulated and updated. Databases are quite similar to spreadsheets as they are mostly made up of tables which
contain rows and columns like a spreadsheet. A database needs to be hosted or created on some special database
platform, some of the famous Database platforms are:
● PostgreSQL
● MySQL
● Microsoft Access
● SQLite
Database Management System -A database management system is a software used to perform different
operations, like addition, access, updating, and deletion of the data, like adding your name in the database for an
online retail store as a customer. A database management system acts as the backbone of a database and makes
using a database a cakewalk as it makes access and management of data a lot easier.
RDBMS - 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.
PRACTICAL – 2
Q) Give steps to Open Microsoft Access. Write steps to create a database. What are the
various elements of a database? What are the various ways to create tables in databases ?
Microsoft Access is a Database Management System offered by Microsoft. It uses the Microsoft Jet Database
Engine and comes as a part of the Microsoft Office suite of applications .
Microsoft Access offers the functionality of a database and the programming capabilities to create easy to navigate
screens (forms).
Step 1) Click on the 'Windows' icon. You will find the list of installed programs.
Step 3) Select blank database and enter the name in file name field
Step 4) After entering file name click create option. Access will download that database template and open a
new blank database as shown in the following screenshot.
● Tables
● Fields
● Records
Tables
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.
Fields
A field is part of a record and contains a single piece of data for the subject of the record. In the database table
illustrated in Figure 4, each record contains four fields:
Log ID A number assigned to this customer support incident for
identification purposes
Operator The code for the customer support operator who handled
this incident
Resolved A check box to indicate whether the incident was resolved
Duration The time in seconds the operator spent on this incident
Records
Data is stored in records. A record is composed of fields and contains all the data about one particular person,
company, or item in a database. In this database, a record contains the data for one customer support incident
report. Records appear as rows in the database table.
Forms
A database form shows all or selected fields for one record. Forms show field names and data in an attractive and
easy-to-read format.
you can enter data in fields in a form just as you can in a table. Navigation buttons for moving from record to
record are displayed at the bottom of the form.
Filters
A filter displays records in a database according to criteria you select. Although the database used as an example in
this seminar is small, a database can contain a large amount of data. You might want to filter the data, hiding some
records and displaying others. For example, you might want to display records for Operator CS1 only. A filter
allows you to do so easily.
The other records are still in the table even though they are not displayed. The filter can be removed to display all
the records in the table.
Queries
A query finds records in a database according to the criteria you specify. Sometimes working with all the data in a
large database is not practical. You might wish to work with just a small part or subset of the data. For example,
you might want to find records for unresolved customer support incidents. A query can be used to display these
records. You could construct the query to display only selected fields, such as Log ID and Resolved. A query
displays only the data you request.
Only the Log ID and Resolved fields for unresolved incidents are displayed.
Reports
A report presents data in an attractive format and is especially suitable for printing. Reports can display data from
tables or queries. All or selected fields can be included in a report. Data can be grouped or sorted and arranged in a
variety of ways.
Step 2) System will display the default table created with 'Table1' name.
3) To Rename Column, double click on Column Header and enter the new column Name.
Step 7) Press 'Ctrl + S' and Enter the new table name to save the table.
Step 2) Table Dialog box appears. For each Field enter Field Name, Data Type and Description.
Steps 3) To Add Course ID as Primary Key, select it and Click on 'Primary Key.' Course Id will be Preceded by
KEY ICON as shown below:
PRACTICAL- 3
Q) Write down the features of SQL and Define also.
SQL is a database computer language designed for the retrieval and management of data in a relational database.
SQL stands for Structured Query Language. This tutorial will give you a quick start to SQL. It covers most of the
topics required for a basic understanding of SQL and to get a feel of how it works.
FEATURES
● High Performance
o SQL provides high performance programming capability for a highly transactional, heavy workload and
high usage database system. SQL programming gives various ways to describe the data more
analytically.
● High Availability
o SQL is compatible with databases like MS Access, Microsoft SQL Server, MySQL, Oracle Database,
SAP HANA, SAP Adaptive Server, etc. All of these relational database management systems support
SQL and it is easy to create an application extension for procedural programming and various other
functions which are additional features thus converting SQL into a powerful tool.
● High Security
o It is very easy to provide permissions on tables, procedures, and views hence SQL gives security to your
data.
● Comprehensive Application Development
o SQL is used by many programmers to program apps to access a database. No matter what the size of
organization, SQL works for every small or large organization.
PRACTICAL- 4
Q) Give the steps to create a table in design view and datasheet view.
Create Table – Datasheet View
Step 1) First Click the Create tab. Then from the Tables group, click Table.
Step 2) System will display the default table created with 'Table1' name.
3) To Rename Column, double click on Column Header and enter the new column Name.
Step 7) Press 'Ctrl + S' and Enter the new table name to save the table.
Step 2) Table Dialog box appears. For each Field enter Filed Name, Data Type and Description.
Steps 3) To Add Course ID as Primary Key, select it and Click on 'Primary Key.' Course Id will be Preceded by
KEY ICON as shown below:
PRACTICAL-5
Q) Explain Field Name, Data Types, Field Size with its Description.
SOLUTION:
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.
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.
Field Size
Field size is used to set the number of characters required in text or number field. The
default field size for the text type is 50 characters. The field size can be limited to a
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;
PRACTICAL-6
Step 2) Click open, and select the location of existing database, a dialogue
box will appear.
Step 3) Choose the Database which you want to open and click on it.
ADITYA DAS 22 40221101718
Information System Management
PRACTICAL-7
Q) 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 MSACCESS.
Create another table using data sheet view as STUDENT_COURSE with the field name as
• ID
• COURSE CODE
• COURSE Name Enter 5
records.
SOLUTION: STUDENT_DETAILS
Design View
Datasheet View
STUDENT_COURSE
Design View
Datasheet View
PRACTICAL-8
Q) 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.
SOLUTION: Student Database
Design View
Datasheet View
PRACTICAL-9
Q) Define data type and explain the various data types available in MS-ACCESS. Create a
database DB1 with a table T1 with the following fields as:
● ST_NO.
● ST_ID
● ST_NAME
● ST_ADD
● ST_PHONE NO.
● ST_HOBBIES
In the design view and add at least 10 records in the table.
SOLUTION:
Design View
Datasheet View
PRACTICAL-10
Q) Create a database named EMPLOYEE with the following fields as
EMPLOYEE NAME, EMPLOYEE CODE, EMPLOYEE DESIGNATION,
EMPLOYEE DEPARTMENT, DATE OF JOINING and YEAR OF
EXPERIENCE. Delete any two records as well as fields from the table
to show the output.
SOLUTION: Employee Database
Design View
Datasheet View
Deleted records
Deleted fields
PRACTICAL-11
Q) 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:
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.
SOLUTION
Employee names should be in upper case with field size equal to10.
PRACTICAL-12
Q) Create an EMPOYEE database with the following fields as:
• Emp_code
• Emp_ssn
• Emp_name
• Emp-dob
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
PRACTICAL-13
• S_id
• 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 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.
PRACTICAL-14
Q) 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.
(A) Primary key:- A column or group of columns in a table which helps us to uniquely
identifies every row in that table is called a primary key. This DBMS can't be a duplicate. The
same value can't appear more than once in the table.
The value in a primary key column can never be modified or updated if any foreign
key refers to that primary key.
Step1:- Click on ‘view’ option then select ‘design view’
(B) Composite key : A key that has more than one attributes is known as composite key. It is also
known as compound key..
PRACTICAL-15
Q) 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- DETAILS AND DEPT_DETAILS AS 1:1,
1: M and M: 1. Also enforce referential integrity constraint on it and write down the steps
for the same
MANY TO ONE
PRACTICAL-16
Q) Explain in brief about the query object in MSACCESS 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: 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.
Queries that you use to retrieve data from a table or to make calculations
are called select queries.
Queries that add, change, or delete data are called action queries.
You can also use a query to supply data for a form or report.
In a well-designed database, the data that you want to present by using a
form or report is often located in several different tables.
Display the acc no in ascending order
Display the acc no, acc type, account H_name and balance where balance is greater than 5000
PRACTICAL-17
Q) 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 list of students of batch ‘2017-2020’ and course_is 17.
Display the number of students in course_id 44.
SOLUTION
Display the list of Students in batch ‘2017-2020’
PRACTICAL-18
Q) Create the following table CUSTOMER having the
columns, data types.
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 customerwho isliving in Canada.
Show details of the customer whose name is Victoria.
Showdetail ofthe customer who lives in Sweden.
Show detail of the customer who is owner.
SOLUTION
PRACTICAL – 19
Q) Create a table EMPLOYEE either the following fields: •Emp_id •Emp_name
•Dept_name •Salary •Add •Date of joining
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
5. Update the record of the employee, set salary to 15000 where Dept_name is IT.
SOLUTION
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 employee, set salary to 15000 where Dept_name is IT
ADITYA DAS 70 40221101718
Information System Management
PRACTICAL – 20
Q) Create a table named STUDENT_DETAILS with the following fields: • R_no • Name •
Course name • Attendance • Dob • Add Course will have values either economics or dbms.
Enter 5 records.
Create a form for the above table and add the following buttons to it:
Go to first record
Go to last record
Go to previous record
Go to next record
PRACTICAL – 21
Q) Discuss All DDL Commands with its syntax.
CREATE DATABASE
A Database is defined as a structured set of data. So, in SQL the very first step to store the data in a well
structured manner is to create a database. The CREATE DATABASE statement is used to create a new database
in SQL.
Syntax:
CREATE DATABASE database_name; database_name: name of the database.
CREATE TABLE
The CREATE TABLE statement is used to create a table in SQL. We know that a table comprises of rows and
columns. So while creating tables we have to provide all the information to SQL about the names of the columns,
type of data to be stored in columns, size of the data etc. Let us now dive into details on how to use CREATE
TABLE statement to create tables in SQL.
Syntax:
CREATE TABLE table_name
(column1 data_type(size),
column2 data_type(size),
column3 data_type(size),
DROP
It is used to delete a whole database or just a table.The DROP statement destroys the objects like an existing
database, table, index, or view. A DROP statement in SQL removes a component from a relational database
management system(RDBMS).
Syntax:
TRUNCATE
TRUNCATE statement is a Data Definition Language (DDL) operation that is used to mark the extents of a table
for deallocation (empty for reuse). The result of this operation quickly removes all data from a table, typically
bypassing a number of integrity enforcing mechanisms. The TRUNCATE TABLE mytablestatement is logically
(though not physically) equivalent to the DELETE FROM mytable statement (without a WHERE clause).
Syntax:
ADITYA DAS 73 40221101718
Information System Management
ALTER
Sometimes we may want to rename our table to give it a more relevant name. For this purpose we can use ALTER
TABLE to rename the name of table.
Syntax
RENAME TO new_table_name;
PRACTICAL – 22
Q). Write SQL Queries using Data Definition Commands like CREATE, DROP, TRUNCATE, RENAME,
ALTER. Create Table named Student with Fields Student id, Name, Age, Course, Fees. And apply above
mentioned commands on the table.
CREATE
INSERT
OUTPUT
ALTER
RENAME
DROP
OUTPUT
DELETE
ADITYA DAS 77 40221101718
Information System Management
PRACTICAL – 23
Q) Write SQL Queries using Data Definition Commands Create Table named Employee
with Fields • EMP_ID
• EMP_NAME
• EMP_DESIGNATION
• EMP_DEPARTMENT
• EMP_CONTACT
And make EMP_ID as the primary key.
SOLUTION
CREATE
PRACTICAL-24
Q) Write SQL Queries using Data Definition Commands Create Table
named Employee with Fields
EMP_ID
EMP_NAME
EMP_DESIGNATION
And make EMP_ID as the primary key.
Apply TRUNCATE, RENAME and ALTER commands.
SOLUTION
CREATE
ALTER
PRACTICAL-25
Q) Discuss All DML Commands with its syntax.
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.
Commands of DML:
INSERT
The INSERT INTO statement of SQL is used to insert a new row in a table. There are two ways of
using INSERT INTO statement for inserting rows:
1. Only values: First method is to specify only the value of data to be inserted without the
column names.
Syntax:
INSERT INTO table_name VALUES (value1,
value2, value3,…); table_name: name of the table.
value1,names
2. Column value2,.. : value
and values both:ofInfirst column,
the second second
method column,…
we will specify bothfor
thethe new
columns
which we want to fill and their corresponding values as
shownbelow:
Syntax:
INSERT INTO table_name (column1, column2, column3,..) VALUES
( value1, value2, value3,..);
UPDATE
The UPDATE statement in SQL is used to update the data of an existing table in database. We can
update single columns as well as multiple columns using UPDATE statement as per our requirement.
Syntax:
UPDATE table_name SET column1 = value1,
column2 = value2,... WHERE condition;
DELETE
The DELETE Statement in SQL is used to delete existing records from a table. We can delete a
single record or multiple records depending on the condition we specify in the WHERE clause.
Syntax:
PRACTICAL -26
Q) Write SQL Queries using Data Manipulation Commands like INSERT, UPDATE,
DELETE and SELECT. Insert record into Table named Student with Fields Student id,
Name, Age, Course, Fees. And apply above mentioned commands on the table.
SOLUTION
INSERT
UPDATE
DELETE
SELECT
PRACTICAL-27
Q) Write SQL Queries using Data Manipulation Commands Insert record into Table
named Employee with Fields
• EMP_ID
• EMP_NAME
• EMP_DESIGNATION
• EMP_DEPARTMENT
• EMP_CONTACT
And make EMP_ID as the primary key. And apply above mentioned commands on the
table
CREATE
INSERT
PRACTICAL-28
An aggregate function allows you to perform a calculation on a set of values to return a single
scalar value. We often use aggregate functions with the GROUP BY and HAVING clauses of the
SELECT statement.
The following are the most commonly used SQL aggregate functions:
ADITYA DAS 92 40221101718
Information System Management
Example:
1.COUNT function
2.AVG function
3.SUM function
4.MIN function
ADITYA DAS 97
40221101718
Information System Management
5.MAX function
PRACTICAL-29
Q) 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
Command:
CREATE TABLE EMPLOYEE
(EMP_ID NUMBER PRIMARY KEY,
EMP_NAME TEXT,
EMP_DESIGNATION TEXT,
EMP_AGE NUMBER,
EMP_DEPARTMENT TEXT,
EMP_SALARY CURRENCY);
Output
Command :
INSERT INTO EMPLOYEE VALUES (1001,"NAMAN","MANAGER",20,"HR",40000);
QUERY 1 :
SELECT EMP_SALARY FROM EMPLOYEE
WHERE EMP_AGE<=26 AND EMP_SALARY>=25000;
QUERY 2 :
SELECT EMP_NAME FROM EMPLOYEE
WHERE EMP_NAME LIKE 'KU*';
PRACTICAL -30
Q) 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
INSERT
QUERY1
QUERY2
AVG
COUNT
SUM
MINIMUM
MAXIMUM
QUERY3
PRACTICAL-31
Q) Create an ER diagram for COLLEGE MANAGEMENT SYSTEM
Last
name Stud_num
First
name
Tim
Time e
table
Attribut Dat
es e
Teacher’s
name
am
Last name
e
First name
Sub
Subje code
Email Lecturer Lectur
es cts
Lecturer
Address Sub
unit
PRACTICAL-32
Q) Create an ER diagram for COLLEGE MANAGEMENT SYSTEM
Login id Login user
Address
Per id
Permission
Per name
Manage
Passpor
t
Id Pass
Airlines
P-id Passenger Reservatio
Date n
date
P _name
Type Type
Address has Passpor
t
Ticket
reservation Date
type
Book id
PRACTICAL-33
Q) Create an ER Diagram for Employee Management System
Address
Per Id
Permission
Per Name
Manage
Sal_id
Password
Statuss Salary
Em_Id Leaves
Employees datee
Leave from
Em_phn Sal_month
has
Leave
Address Emp account
Departmen
t
Dep_id Dep_date
PRACTICAL-34
Q) Create an ER Diagram for Library Management System
Address
Per id
Permission
Per name
Manage
Name Name
has House no.
Email Phone no.
Book
s Book_issue
date
Book _ id
115
NAMAN DHINGRA 06121101718