ISM Practical File Rekha

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 41

PRACTICAL FILE

ON
INFORMATION SYSTEM MANAGEMENT-LAB

GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY


In partial fulfilment of the requirement for the award of the degree of

BACHELOR OF BUSINESS ADMINISTRATION


Batch 2020 - 23
SUBMITTED BY: SUBMITTED TO:
REKHA RAWAT Mr. SHAILENDRA KUMAR
09350601720 ASSISTANT PROFESSOR

NEW DELHI INSTITUTE OF MANAGEMENT


61A, TUGHLAKABAD, NEW DELHI-62
CERTIFICATE

This is to certify that the practical titled “Information System Management-Lab” submitted by
REKHA RAWAT to New Delhi Institute of Management, Guru Gobind Singh Indraprastha
University in partial fulfilment of requirement for the award of the Bachelor of Business
Administration degree is an original piece of work carried out under my guidance and may be
submitted for evaluation.
The assistance rendered during the study has been duly acknowledged.
No part of this work has been submitted for any other degree.

Place: New Delhi

Faculty Guide
Mr. Shailendra Kumar
Date:26 march 2022
ACKNOWLEDGEMENT

Any accomplishment requires the effort of many people and this work is not different.
Regardless of the source, I wish to express my gratitude to those who may have contributed
to this work, even though anonymously.

I would like to pay my sincere thanks to my Information System Management-Lab faculty


Mr.Shailendra Kumar under whose guidance I was able to complete my Practical
successfully. I have been fortunate enough to get all the support, encouragement and
guidance from him needed to explore, think new and initiate.

My final thank goes out to my parents, family members, teachers and friends who
encouraged me countless times to persevere through this entire process.

REKHA RAWAT
INDEX
1 Explain Information System Management.
a. DSS
b. EIS
c. TPS
2 Introduction of Database Management System.

3 Introduction to the following Concepts.


a. DDL
b. DML
c. TCL
d. Aggregate Function with example

4 Explain ER D with an Example.

5 Create Employee Table with EMP_ID, EMP_NAME, EMP_DEPT,


EMP_ADDRESS, MOBILE_NUMBER, EMP_SALARY and then Use Aggregate
function by Queries
6 Write the query for these command
ALTER
INSERT
UPDATE
LIKE
MANAGEMENT INFORMATION SYSTEM
Management Information Systems (MIS) is the study of people,
technology, organizations, and the relationships among them. MIS
professionals help firms realize maximum benefit from investment in
personnel, equipment, and business processes. MIS is a people-oriented
field with an emphasis on service through technology. If you have an
interest in technology and have the desire to use technology to improve
people’s lives, a degree in MIS may be for you.

DATA DECISION SYSTEM (DSS)

A decision support system (DSS) is an information system that aids a business in


decision-making activities that require judgment, determination, and a sequence
of actions. The information system assists the mid- and high-level management of
an organization by analyzing huge volumes of unstructured data and
accumulating information that can help to solve problems and help in decision-
making. A DSS is either human-powered, automated, or a combination of both.

COMPONENTS
1. Model Management System
The model management system S=stores models that managers can use in their
decision-making. The models are used in decision-making regarding the financial
health of the organization and forecasting demand for a good or service.

2. User Interface
The user interface includes tools that help the end-user of a DSS to navigate through
the system.

3. Knowledge Base
The knowledge base includes information from internal sources (information collected
in a transaction process system) and external sources (newspapers and online
databases).

TYPES OF DSS
Communication-driven: Allows companies to support tasks that require more than
one person to work on the task. It includes integrated tools such as Microsoft
SharePoint Workspace and Google Docs.

Model-driven: Allows access to and the management of financial, organizational, and


statistical models. Data is collected, and parameters are determined using the
information provided by users. The information is created into a decision-making
model to analyze situations. An example of a model-driven DSS is Dicodess – an
open-source model-driven DSS.

Knowledge-driven: Provides factual and specialized solutions to situations using


stored facts, procedures, rules, or interactive decision-making structures
like flowcharts.

Document-driven: Manages unstructured information in different electronic formats.

Data-driven: Helps companies to store and analyze internal and external data.
 EXECUTIVE INFORMATION SYSTEM

EIS is an information system based on computer which generally serves the


information needs of the top level management of an organization. Check
Complete details for EIS System like – What is Executive Information
System?, Components of Executive Information System, Advantages
of Executive Information System, Application of Executive Information
System etc. Now scroll down below n check more details for “Executive
Information System”

COMPONENTS
 USER INTERFACE: User Interface allows the users to communicate with
the EIS. User interface must be easy to use and understand. Users should
not be required to understand the complex query languages and other
mathematical or statistical formulas.
 HARDWARE: Hardware refers to devices by which users give input, data
processing and the output is received. Users may give input via keyboard
and mouse and CPU may be used for processing and output may be
received on monitor or from printer.
 SOFTWARE: Software is required for various calculations, providing
graphical view to the management, storing data in the form of
Information, etc. Software allows user to get information in the form it is
actually required.
 TELECOMMUNICATION: In today’s world the most important thing is
communication. Users may require transferring information from one
point to another point. The information might be a little confidential in
nature. The secrecy of the information should be well maintained.
Transaction Processing System (TPS)
TPS is an information system that is used to process day to day transactions
such as purchases, expenses, sales, receipts, payments, etc. TPS may provide us
with meaningful routine reports such as profit & loss a/c and balance sheet,
etc.

TPS basically manipulates data from business transactions. The users of TPS
generally are not in a position to make typical management decisions. A TPS
captures data, processes it and makes available such data in the form of
reports to be utilized by the management. TPS is the oldest known information
system used for business applications. However, TPS has progressed a lot since
then, majorly due to availability of the Internet.

A TPS may be defined as an Information system that collects, stores, retrieves


day to day transactions of the organization. TPS generally may be used in
Railway Reservation Systems, Accounting Systems, Banking Systems, etc.
Global economy is a major reason for the advancement of TPS.

Components
 Inputs: Source documents such as Customer orders, invoices, purchase
orders, etc. serves as Inputs to the TPS system.
 Processing: Once the inputs are provided, they are further processed to
get an output.
 Storage: Ledgers serves as a source of storage.
 Output: Any document generated is termed as output.
DBMS : Database Management
System
A database management system (DBMS) is a software tool
that enables users to manage a database easily. It allows
users to access and interact with the underlying data in the
database. These actions can range from simply querying data
to defining database schemas that fundamentally affect the
database structure.

Furthermore, DBMS allow users to interact with a database


securely and concurrently without interfering with each
user and while maintaining data integrity.
Components
All DBMS comes with various integrated components and tools
necessary to carry out almost all database management tasks. Some
DBMS software even provides the ability to extend beyond the core
functionality by integrating with third-party tools and services,
directly or via plugins.

In this section, we will look at the common components that are


universal across all DBMS software, including:
 Storage engine
 Query language
 Query processor
 Optimization engine
 Metadata catalog
 Log manager
 Reporting and monitoring tools
 Data utilities

 DDL
Data Definition Language(DDL) is a subset of SQL and a part
of DBMS(Database Management System) . DDL consist of Commands to
commands like CREATE, ALTER, TRUNCATE and DROP. These
commands are used to create or modify the tables in SQL.

Command-1 : CREATE
This command is used to create a new table in SQL. The user has to give
information like table name, column names, and their datatypes.

Syntax –
CREATE TABLE table_name
(column_1 datatype,
column_2 datatype,
column_3 datatype,
.... );

Example

We need to create a table for storing Student information of a particular


College. Create syntax would be as below.

CREATE TABLE Student_info


(College_Id number(2),
College_name varchar(30),Branch varchar(10) );

Command-2 : ALTER

This command is used to add, delete or change columns in the existing table.
The user needs to know the existing table name and can do add, delete or
modify tasks easily.

Syntax –
Syntax to add a column to an existing table.

ALTER TABLE table_name


ADD column_name datatype;

ALTER TABLE table_name


Delete column_name datatype;

Example

In our Student_info table, we want to add a new column for CGPA. The
syntax would be as below as follows.

ALTER TABLE Student_info


ADD CGPA number;

ALTER TABLE Student_info


Delete CGPA number;

Command-3 : TRUNCATE

This command is used to remove all rows from the table, but the structure of
the table still exists.

Syntax
Syntax to remove an existing table.

TRUNCATE TABLE table_name;

Example

The College Authority wants to remove the details of all students for new
batches but wants to keep the table structure. The command they can use is
as follows.

TRUNCATE TABLE Student_info;


Command-4 : DROP
This command is used to remove an existing table along with its structure
from the Database.

Syntax

Syntax to drop an existing table.
DROP TABLE table_name;
Example

If the College Authority wants to change their Database by deleting the


Student_info Table. 

DROP TABLE Student_info;

 DML
DML stands for Data Manipulation Language. Tables and formulas are
helpful when communicating with data stored up to a point in a database
through SQL, but a time comes when we actually want to execute some
fairly complicated data interactions. We will also need the Data
Manipulation Language in that situation. DML is a way to inform a
database precisely what we want it to do by conversing in a manner that it
has been built to comprehend from the scratch. When it comes to
interacting within existing data, whether adding, moving, or deleting data, it
provides a convenient way to do so.

Command-1 SELECT

This command is used to get data out of the database. It helps users of the
database to access from an operating system, the significant data they
need. It sends a track result set from one tables or more.

Syntax :
SELECT * FROM <table_name>;
EXAMPLE:
SELECT * FROM students;

Command-2 INSERT

This command is used to enter the information or values into a row. We can
connect one or more records to a single table within a repository using this
instruction. This is often used to connect an unused tag to the documents.

Syntax :
INSERT INTO <table_name>
('column_name1' <datatype>, 'column_name2' <datatype>)
VALUES ('value1', 'value2');
Example :
INSERT INTO students
('stu_id' int, 'stu_name' varchar(20), 'city' varchar(20))
VALUES ('1', 'Nirmit', 'Gorakhpur');

Command-3 UPDATE

This command is used to alter existing table records. Within a table, it


modifies data from one or more records. This command is used to alter the
data which is already present in a table.

Syntax :
UPDATE <table_name>
SET <column_name = value>
WHERE condition;
Example :
UPDATE students
SET due_fees = 20000
WHERE stu_name = 'Mini';

Command-4 DELETE

It deletes all archives from a table. This command is used to erase some or
all of the previous table’s records. If we do not specify the ‘WHERE’
condition then all the rows would be erased or deleted.

Syntax :
DELETE FROM <table_name>
WHERE <condition>;
Example :
DELETE FROM students
WHERE stu_id = '001';

 TCL
TCL stands for Transaction Control Languages. These commands are
used for maintaining consistency of the database and for the management
of transactions made by the DML commands. 
A Transaction is a set of SQL statements that are executed on the data
stored in DBMS. Whenever any transaction is made these transactions are
temporarily happen in database.So to make the changes permanent, we
use TCL commands.

 Consider the following Table Student: 

Name Marks

John 79
Jolly 65

Shuzan 70

COMMAND-1 COMMIT

This command is used to save the data permanently. 


Whenever we perform any of the DDL command like -INSERT, DELETE or
UPDATE, these can be rollback if the data is not stored permanently. So in
order to be at the safer side COMMIT command is used. 

Syntax:  
commit;
EXAMPLE:
UPDATE STUDENT
SET NAME = ‘Sherlock’
WHERE NAME = ‘Jolly’
COMMIT;

OUTPUT:

Name Marks

John 79

Sherlock 65

Shuzan 70

COMMAND:2 ROLLBACK

This command is used to get the data or restore the data to the last savepoint
or last committed state. If due to some reasons the data inserted, deleted or
updated is not correct, you can rollback the data to a particular savepoint or if
savepoint is not done, then to the last committed state. 

Syntax:  
rollback;
EXAMPLE:
UPDATE STUDENT
SET NAME = ‘Sherlock’
WHERE NAME = ‘Jolly’
ROLLBACK;
OUTPUT:
Name Marks

John 79

Jolly 65

Shuzan 70

COMMAND:3 SAVEPOINT

This command is used to save the data at a particular point temporarily, so


that whenever needed can be rollback to that particular point. 

Syntax:  
Savepoint A;

EXAMPLE:
INSERT into STUDENT
VALUES ('Jack', 95);
Commit;
UPDATE NAME
SET NAME= ‘Rossie’
WHERE marks= 70;
SAVEPOINT A;
INSERT INTO STUDENT
VALUES (‘Zack’, 76);
Savepoint B;
INSERT INTO STUDENT
VALUES (‘Bruno’, 85);
Savepoint C;
SELECT *
FROM STUDENT;

OUTPUT:
Name Marks

John 79

Jolly 65

Rossie 70

Jack 95

Zack 76

Bruno 85

 AGGREGATE FUNCTIONS
 An aggregate function in SQL returns one value after calculating multiple
values of a column. We often use aggregate functions with the GROUP BY
and HAVING clauses of the SELECT statement.

o Various types of SQL aggregate functions are:

 Count()
 Sum()
 Avg()
 Min()
 Max()

1. COUNT() Function

The COUNT() function returns the number of rows in a database table.

Syntax:

COUNT(*)  or  

COUNT( [ALL|DISTINCT] expression )  

Example:

We will use the ‘products’ table from the sample database for our
demonstration.
The following SQL statement fetches the number of products in the table.

This will produce the following result.

The below-given command will display those product ids where the unit price is
greater than 4.

This will display the following result.

Let's look at how we can use GROUP BY and HAVING functions with the
COUNT function.

Consider the following dataset:


The SQL command given below will list the number of customers in each city.

This will produce the following results:

2. SUM() Function

The SUM() function returns the total sum of a numeric column.

Syntax:
SUM()  or  

SUM( [ALL|DISTINCT] expression )  

Example:

The following SQL statement finds the sum of the "unit price" fields in the "products"
table:

This will produce the following result.

Let’s look at how we can use GROUP BY and HAVING functions with the SUM
function.

Consider the following dataset:


The SQL command below will list the number of customers in each city, having a sum
of points greater than 3000.

This will produce the following result:

3. AVG() Function

The AVG() function calculates the average of a set of values.

Syntax:

AVG()  or  

AVG( [ALL|DISTINCT] expression )  

Example:

The following SQL command calculates the average quantity in stock.

This will produce the following result.


4. MIN() Function

The MIN() aggregate function returns the lowest value (minimum) in a set of non-
NULL values.

Syntax:

MIN()  or  

MIN( [ALL|DISTINCT] expression )  

Example:

The above code will give us the minimum quantity in stock in the products table.

5. MAX() Function

The MAX() aggregate function returns the highest value (maximum) in a set of non-
NULL values.

Syntax:

AVG()  or  
AVG( [ALL|DISTINCT] expression )  

Example:

The code depicted below will give us the maximum quantity in stock in the products
table.

This will produce the following result.

 ENTITY RELATIONSHIP DIAGRAM (ERD)


Entity Relationship Diagram, also known as ERD is a diagram that displays the
relationship of entity sets stored in a database. In other words, ER diagrams
help to explain the logical structure of databases. ER diagrams are created
based on three basic concepts: entities, attributes and relationships.

ER Diagrams contain different symbols that use rectangles to represent


entities, ovals to define attributes and diamond shapes to represent
relationships.
At first look, an ER diagram looks very similar to the flowchart. However, ER
Diagram includes many specialized symbols, and its meanings make this
model unique. The purpose of ER Diagram is to represent the entity framework
infrastructure.

 ER Diagrams Symbols & Notations


It Mainly contains three basic symbols which are rectangle, oval and diamond
to represent relationships between elements, entities and attributes. There are
some sub-elements which are based on main elements in ERD Diagram. ER
Diagram is a visual representation of data that describes how data is related to
each other using different ERD Symbols and Notations.

Following are the main components and its symbols in ER Diagrams:

 Rectangles: This Entity Relationship Diagram symbol represents entity


type
 Ellipses : Symbol represent attributes
 Diamonds: This symbol represents relationship types
 Lines: It links attributes to entity types and entity types with other
relationship types
 Primary key: attributes are underlined
 Double Ellipses: Represent multi-valued attributes

 Components of the ER Diagram


This model is based on three basic concepts:

 Entities
 Attributes
 Relationships

EXAMLE:
 The library management system has a database that shows the
relationships between the entities such as a book, publisher, and
member. Since this is a simple system, it has only three entities. Other
systems can be more complex with a more significant number of entities
such as staff etc. book entity can have attributes like book_ID, title, price,
and availability. Publisher entity can have attributes like publisher_ID,
publisher_address, and publisher_name. member entity can have
attributes like member_ID, member_date, member_type,
member_address, member_name, and expiry_date.

Entities and Attributes

 Book Entity: It has author, book_ID, title, price, and availability.


 Publisher Entity: It has publisher_ID, publisher_address, and
publisher_name.
 Member Entity: It has member_ID, member_date, member_type,
member_address, member_name, and expiry_date.
 EMPLOYEE’S TABLE
STEP – 1
CREATE TABLE EMPLOYEE
(EMP_ID INT , EMP_NAME VARCHAR(255) , EMP_DEPT
VARCHAR(255) , EMP_ADDRESS VARCHAR(255),
MOBILE_NUMBER INT , EMP_SALARY INT);

STEP- 2
INSERT INTO EMPLOYEE
(EMP_ID, EMP_NAME ,EMP_DEPT, EMP_ADDRESS, MOBILE_NUMBER,
EMP_SALARY)
VALUES('101', 'REKHA', 'HR', 'KALKAJI', '9876543456', '65000');
STEP- 3 RECORD MORE VALUES .

FINAL OUTPUT:

QUERIES FOR THE SAME:

SUM( )
SELECT SUM(EMP_SALARY) from Employee ;

MAX( )
SELECT MAX(EMP_SALARY) from Employee ;
MIN( )
SELECT MIN(EMP_SALARY) from Employee ;

AVG( )
SELECT AVG(EMP_SALARY) from Employee ;

GROUP BY :
SELECT EMP_NAME,EMP_ID,EMP_SALARY from Employee GROUP BY
EMP_NAME;
COUNT(*):
SELECT EMP_NAME,
COUNT(*) FROM EMPLOYEE GROUP BY EMP_ID ;

UPDATE:
UPDATE EMPLOYEE
SET EMP_SALARY = "1000000"
WHERE EMP_ID = "104" ;

LIKE:
SELECT * FROM EMPLOYEE WHERE EMP_NAME LIKE "M%" ;
SELECT *FROM EMPLOYEE WHERE EMP_NAME LIKE "_A%";

DELETE:
DELETE FROM EMPLOYEE
WHERE EMP_ID = "104" ;
QUERY
1. ALTER COMMAND

Consider the CUSTOMERS table having the following records

| ID | NAME | AGE | ADDRESS | SALARY |


| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

Syntax
The basic syntax of an ALTER TABLE command to add a New Column in an existing table is as
follows.
ALTER TABLE table_name ADD column_name datatype;
The basic syntax of an ALTER TABLE command to DROP COLUMN in an existing table is as
follows.
ALTER TABLE table_name DROP COLUMN column_name;

EXAMPLE: 1
ALTER TABLE CUSTOMERS ADD SEX char(1);

OUTPUT:
ID | NAME | AGE | ADDRESS | SALARY | SEX |
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 | NULL |
| 2 | Ramesh | 25 | Delhi | 1500.00 | NULL |
| 3 | kaushik | 23 | Kota | 2000.00 | NULL |
| 4 | kaushik | 25 | Mumbai | 6500.00 | NULL |
| 5 | Hardik | 27 | Bhopal | 8500.00 | NULL |
| 6 | Komal | 22 | MP | 4500.00 | NULL |
| 7 | Muffy | 24 | Indore | 10000.00 | NULL |

EXAMPLE 2:
ALTER TABLE CUSTOMERS DROP SEX;
OUTPUT:
ID | NAME | AGE | ADDRESS | SALARY
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Ramesh | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | kaushik | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

2 INSERT COMMAND

Syntax
INSERT INTO TABLE_NAME
(column1, column2, column3,...columnN)
VALUES (value1, value2, value3,...valueN);

EXAMPLE :
INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000.00 );

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)


VALUES (2, 'Khilan', 25, 'Delhi', 1500.00 );

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)


VALUES (3, 'kaushik', 23, 'Kota', 2000.00 );

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)


VALUES (4, 'Chaitali', 25, 'Mumbai', 6500.00 );

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)


VALUES (5, 'Hardik', 27, 'Bhopal', 8500.00 );

INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS,SALARY)


VALUES (6, 'Komal', 22, 'MP', 4500.00 );

OUTPUT:
ID | NAME | AGE | ADDRESS | SALARY |
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |

3 UPDATE COMMAND

Consider the CUSTOMERS table having the following records −


ID | NAME | AGE | ADDRESS | SALARY |
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00

Syntax:

The basic syntax of the UPDATE query with a WHERE clause is as follows −
UPDATE table_name
SET column1 = value1, column2 = value2...., columnN =
valueN
WHERE [condition];

EXAMPLE:

UPDATE CUSTOMERS
SET ADDRESS = 'Pune'
WHERE ID = 6;
OUTPUT:

ID | NAME | AGE | ADDRESS | SALARY |


| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | Pune | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00
4 LIKE COMAND

Syntax

The basic syntax of % and _ is as follows −


SELECT FROM table_name
WHERE column LIKE 'XXXX%'

or

SELECT FROM table_name


WHERE column LIKE '%XXXX%'

or

SELECT FROM table_name


WHERE column LIKE 'XXXX_'

or

SELECT FROM table_name


WHERE column LIKE '_XXXX'

or

SELECT FROM table_name


WHERE column LIKE '_XXXX_'

Sr.No. Statement & Description

1 WHERE SALARY LIKE '200%'


Finds any values that start with 200.

WHERE SALARY LIKE '%200%'


2
Finds any values that have 200 in any position.
WHERE SALARY LIKE '_00%'
3
Finds any values that have 00 in the second and third positions.

WHERE SALARY LIKE '2_%_%'


4
Finds any values that start with 2 and are at least 3 characters in length.

WHERE SALARY LIKE '%2'


5
Finds any values that end with 2.

WHERE SALARY LIKE '_2%3'


6
Finds any values that have a 2 in the second position and end with a 3.

WHERE SALARY LIKE '2___3'


7
Finds any values in a five-digit number that start with 2 and end with 3.

EXAMPLE:
Consider the CUSTOMERS table having the following records −

ID | NAME | AGE | ADDRESS | SALARY |


| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

It will display all the records from the CUSTOMERS table, where the SALARY starts with 200.

SELECT * FROM CUSTOMERS


WHERE SALARY LIKE '200%';

OUTPUT:
ID | NAME | AGE | ADDRESS | SALARY |
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 3 | kaushik | 23 | Kota | 2000.00

You might also like