ISM Kartik Arora
ISM Kartik Arora
(AFFILIATED TO GGSIPU)
(PRATICAL FILE)
1 Introduction to SQL 1
2 Definition of SQL 2
Characteristics of SQL
3 Advantages of SQL 3
4 Types of SQL statements 4
6 Literal in SQL 6
PRACTICAL-1
DEFINITION :
1
CHARACTERISTICS :
• SQL is an ANSI(American National Standard Institute) and
ISO(International Organization for Standardization) standard
computer language for creating and manipulating databases.
2
ADVANTAGES :
• Faster Query Processing: Large amount of data is retrieved quickly
and efficiently. Operations like Insertion, deletion, manipulation of
data is also done in almost no time.
3
SQL STATEMENTS
CHAR- It will accept character strings of fixed length. The length of the
character string should be specified in the data type declaration.
Syntax: CHAR(Length)
4
Syntax: INT
5
Eg. 547
Eg. 5.78
Eg. ‘2015/04/30’
PRACTICAL 1
Que.1: Create Table related to student records with columns Roll No.,
Name, Subject and Marks.
6
Que.2: Describe the table.
7
4. Que.4: Display the details of all the students.
Que.5: Display the details of Students whose marks is greater than 70.
8
9
Que.6: Display the details of Students whose subject is ‘Computer”.
Que.7: Display the details of Students whose name starts with ‘A’.
10
Que.8: Display the details whose marks are in between 70 to 80.
11
Que.10: Display the details of students whose subject is either Maths or
Computer.
PRATICAL 2
Que. 1: Create a table student with column Roll No. Name, Subject,
marks
12
Que. 2: Update the Marks of the student to 95 whose roll no. is 5.
13
14
Que. 3: Add a column whose name is Phone No. and data type is ‘int’.
15
Que.5: Modify the data type of column named “Name’ to char(20).
16
Que.6: Modify the table to Student Details.(Alter, Rename)
17
PRATICAL 3
18
Que. 2: Insert five records in it. Display all the records.
19
Que. 3: Display subject wise average marks. (Use Group By and
AVG Function)
20
Que. 5: Count no of entries of each subject marks.
21
Que. 6: Find the Maximum Marks and Group by subject.
PRATICAL 4
22
Que. 2: Insert 5 record
in the table.
23
24
Que. 4: Display all such items which has having quantity more than 200.
25
Que. 5: Display all the records where item name starts with alphabet ‘B’.
Que. 6: Display all the records where there the price range is in between
5000 to 15000.
26
Que. 7: Display all the records where item name is either Milk or Ice-
cream.
PRATICAL-5
27
2. Create table Product_Master as the below given format
28
29