Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

TRINITY INSTITUTE OF PROFESSIONAL STUDIES

Sec-9, DWARKA, NEW DELHI-110075

(AFFILIATED TO)

GURU GOBIND SINGH INDRAPRASTHA


UNIVERSITY SECTOR-16C, DWARKA, NEW
DELHI

INFORMATION SYSTEM MANAGEMENT LAB

PRACTICAL FILE

SUBMITTED TO SUBMITTED BY
Ms. Neha Aggarwal RASHI VERMA
Teacher’s
S.No.
TOPIC Signature
Introduction to SQL
PRACTICAL-1
1. Create any table “keeping table name as your name” with column
names as roll no, name, subject, marks as data type int, varchar
(30), varchar (30), int respectively.
2. Describe the table.

3. Insert five records in the student table.

4. Display the details of all the students.

5. Display the details of students whose marks is greater than 70.

6. Display the details of students whose subject is ‘ISM’

7. Display the details of Students whose name starts with ‘R’.

8. Display the details of students whose marks are 70 or 80.

9. Display the details of the students whose marks are between 70 and
80.
10. Display the details of students whose subject is either ‘ISM’ or ‘HRM’
PRACTICAL-2
1. Create a table student with columns roll no, name, subject, marks.

2. Update the marks of the student to 95 whose roll_no is 4.

3. Add a column whose name is ‘phoneno’ and datatype is ‘int’.

4. Delete the column whose name is phoneno.

5. Modify the datatype of column named ‘name’ to char (20).

6. Modify the table name to StudentDetails.


PRACTICAL-3

1. Create a table student with columns roll no, name, subject, marks.

2. Find the average marks and group by subject.

3. Find the maximum marks and group by subject.

4. Find the minimum marks and group by subject

5. Find the sum of marks and group by subject.

6. Find the total count of marks and group by subject.


PRACTICAL4// your
project//
1. Create a table ‘BAKERY’ with any no of columns.

2. Describe the table.


3. Insert five records in the table.

4. Display the details of all the items in the table.

5. Display the details of all items whose item quantity is greater than 200.

6. Display the details of all items whose item name is ‘bread’.

7. Display the details of all items whose item name is starts with ‘b’.

8. Display the details of all items whose price is either 10000 or 12000.

Display the details of all items whose price is between 5000 and 15000.
9.
Display the details of all items whose item name is ‘Milk’ or ‘Ice
10.
Cream’.
11. Update the price of the item to 9000 whose item number is 1

12. Delete the record of the item whose item number is 5.

13. Add a column named ‘Supplier Phone No’ and datatype is ‘Int’.

14. Delete the column whose name is ‘Supplier Phone No’.

15. Modify the datatype of column whose name is Item_Name to char(30).

16. Modify the table name to BakeryProducts.

17. Find the average price and group by Item_Supplier.

18. Find the maximum price and group by Item_Supplier.

19. Find the minimum price and group by Item_Supplier.

20. Find the sum of price and group by Item_Supplier.

21. Find the total count of price and group by Item_Supplier.


PRACTICAL -1
Q1 Create any table “keeping table name as your name” with column names as roll no,
name, subject, marks as data type int, varchar (30), varchar (30), int respectively.

SYNTAX;- CREATE TABLE (TABLE NAME) (COLOUMN NAME WITH DATA TYPE);

Q2 Describe the table.

SYNTAX ;- DESC (TABLE NAME );

Q3 Insert five records in the student table

SYNTAX;- INSERT INTO (TABLE NAME) VALUES();


Q4 Display the details of all the students.

SYNTAX;- SELECT* FROM (TABLE NAME );

Q5 Display the details of students whose marks is greater than 70.

SYNTAX;- SELECT*FROM (TABLE NAME) WHERE MARKS>70;

Q6) Display the details of students whose subject is ‘ISM’

SYNTAX;- SELECT* FROM (TABLE NAME )WHERE SUBJECT = ‘ISM’;

Q7) Display the details of Students whose name starts with ‘R’.

SYNTAX ;- SELECT* FROM (TABLE NAME ) WHERE COLOUMN NAME LIKE ’R%’;
Q8) Display the details of students whose marks are 70 or 80.

SYNTAX ;- SELECT* FROM (TABLE NAME ) WHERE CONDITION;

No student got marks 70 or 80. It is an empty set

Q9) Display the details of the students whose marks are between 70 and 80.

SYNTAX ;- SELECT* FROM (TABLE NAME ) WHERE CONDITION;

No student got marks between 70 and 80.

Q10) Display the details of students whose subject is either ‘ISM’ or ‘HRM’

SYNTAX;-SELECT* FROM (TABLE NAME)WHERE CONDITION;


PRACTICAL - 2
Q1 Create a table student with columns with sno, roll no, name,class, subject, marks.

Insert five records in the student table

SYNTAX;- INSERT INTO (TABLE NAME) VALUES();

Q3 Add a column whose name is ‘phoneno’ and datatype is ‘int’.


Syntax-alter table ( table name) add phoneno int;
Q4 Delete the column whose name is phoneno.

Syntax- alter table ( table name) drop column phoneno;

You might also like