CLASS XA_XB
CLASS XA_XB
INFORMATION TECHNOLOGY
(Subject Code: 402)
QUERIES
NAME :
AISSE ROLL NO :
TABLE OF CONTENTS
1. ACKNOWLEDGEMENT 1
2. INTRODUCTION 2
3. SQL QUERIES 3
4. CONCLUSION 5
ACKNOWLEDGEMENT
I would like to extend my special thanks of gratitude to our Vice Principal Mrs Deepa Rai Rakali
Ma’am for providing me this golden opportunity to work on this project on Queries and our
Subject Teacher Mr P K Das Sir for helping me to complete this project under his guidance.
NAME:
-1-
INTRODUCTION
In a database we can define the structure of the data and manipulate the data using some
commands. There are two types of languages for this task. They are:
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
A query language is a part of DML involving information retrieval only. The terms DML and
query language are often used synonymously.
A popular data manipulation language is Structured Query Language (SQL). This is used to
retrieve and manipulate data in a relational database. Data manipulation language comprises the
SQL data change statements, which modify stored data but not the schema or database objects.
-2-
SQL QUERIES
1. Create a table STUDENT with the following structure:
INSERT INTO STUDENT VALUES (1001, ‘RAMESH SHARMA’, ‘MCA’, 30000, ‘2020-06-21’);
INSERT INTO STUDENT VALUES (1002, ‘SANTOSH AGARWAL’, ‘BCA’, 25000, ‘2020-06-21’);
INSERT INTO STUDENT VALUES (1003, ‘ANIMESH MUKHERJEE’, ‘MCA’, 30000, ‘2020-06-23’);
INSERT INTO STUDENT VALUES (1004, ‘SANTOSH SINHA, ‘PGDCA’, 20000, ‘2020-07-02’);
INSERT INTO STUDENT VALUES (1005, ‘JAYANTA RAY’, ‘BCA’, 25000, ‘2020-07-03’);
Output:
ADMNO STUDNAME COURSE FEES ADMDATE
1001 RAMESH SHARMA MCA 30000 2020-06-21
1002 SANTOSH AGARWAL BCA 25000 2020-06-21
1003 ANIMESH MUKHERJEE MCA 30000 2020-06-23
1004 SANTOSH SINHA PGDCA 20000 2020-07-02
1005 JAYANTA RAY BCA 25000 2020-07-03
4. Display the records from table STUDENT whose COURSE is either ‘BCA’ or ‘MCA’
Output:
ADMNO STUDNAME COURSE FEES ADMDATE
1001 RAMESH SHARMA MCA 30000 2020-06-21
1002 SANTOSH AGARWAL BCA 25000 2020-06-21
1003 ANIMESH MUKHERJEE MCA 30000 2020-06-23
1005 JAYANTA RAY BCA 25000 2020-07-03
-3-
5. Display the records from table STUDENT whose STUDNAME starts with ‘SANTOSH’
Output:
ADMNO STUDNAME COURSE FEES ADMDATE
1002 SANTOSH AGARWAL BCA 25000 2020-06-21
1004 SANTOSH SINHA PGDCA 20000 2020-07-02
Output:
ADMNO STUDNAME COURSE FEES ADMDATE
1003 ANIMESH MUKHERJEE MCA 30000 2020-06-23
1005 JAYANTA RAY BCA 25000 2020-07-03
1001 RAMESH SHARMA MCA 30000 2020-06-21
1002 SANTOSH AGARWAL BCA 25000 2020-06-21
1004 SANTOSH SINHA PGDCA 20000 2020-07-02
7. Change the value of STUDNAME ‘JAYANTA RAY’ to ‘JAYANTA KR. ROY’ in table
STUDENT
UPDATE STUDENT
SET STUDNAME = ‘JAYANTA KR ROY’
WHERE STUDNAME = ‘JAYANTA RAY’;
-4-
CONCLUSION
The scope of the SQL commands provide the capability to create a wide variety of database
objects like TABLES, VIEWS etc using the various DDL commands such as
CREATE, ALTER, and DROP commands.
These database objects can then be inserted with data using the DML command INSERT. The
data can be manipulated using a wide variety of other DML commands such
as SELECT, DELETE, and UPDATE.
-5-