0% found this document useful (0 votes)
5 views4 pages

SQL Practical File Kalpit Sharma

This SQL practical file contains the structure and operations for a STUDENT table, including commands for creating the table, inserting values, and performing various queries such as displaying records, filtering by marks, and updating or deleting records. It also includes aggregate functions like counting students and calculating average marks. The document is designed for students in classes XI/XII for the 2024-25 session.

Uploaded by

palkalpit2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

SQL Practical File Kalpit Sharma

This SQL practical file contains the structure and operations for a STUDENT table, including commands for creating the table, inserting values, and performing various queries such as displaying records, filtering by marks, and updating or deleting records. It also includes aggregate functions like counting students and calculating average marks. The document is designed for students in classes XI/XII for the 2024-25 session.

Uploaded by

palkalpit2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL PRACTICAL FILE

SQL PRACTICAL FILE

Name: Kalpit Sharma

Class: XI / XII

Roll Number: __________

Subject: Computer Science / IP

Session: 2024-25
SQL PRACTICAL FILE

Table Structure

CREATE TABLE STUDENT (

ROLLNO INT PRIMARY KEY,

NAME VARCHAR(30),

CLASS INT,

SECTION CHAR(1),

MARKS INT

);

Insert Values

INSERT INTO STUDENT VALUES (1, 'Aryan', 12, 'A', 85);

INSERT INTO STUDENT VALUES (2, 'Riya', 12, 'B', 92);

INSERT INTO STUDENT VALUES (3, 'Manish', 12, 'A', 78);

INSERT INTO STUDENT VALUES (4, 'Simran', 11, 'B', 88);

INSERT INTO STUDENT VALUES (5, 'Aakash', 11, 'A', 95);

1. Display All Records

SELECT * FROM STUDENT;

2. Students with Marks > 80

SELECT * FROM STUDENT WHERE MARKS > 80;

3. Class 12 Students

SELECT NAME FROM STUDENT WHERE CLASS = 12;


SQL PRACTICAL FILE

4. Count Total Students

SELECT COUNT(*) FROM STUDENT;

5. Find Maximum Marks

SELECT MAX(MARKS) FROM STUDENT;

6. Find Average Marks

SELECT AVG(MARKS) FROM STUDENT;

7. Students in Section A

SELECT * FROM STUDENT WHERE SECTION = 'A';

8. Order by Marks Descending

SELECT * FROM STUDENT ORDER BY MARKS DESC;

9. Names Starting with 'A'

SELECT * FROM STUDENT WHERE NAME LIKE 'A%';

10. Marks Between 80 and 90

SELECT * FROM STUDENT WHERE MARKS BETWEEN 80 AND 90;

11. Update Marks

UPDATE STUDENT SET MARKS = 83 WHERE NAME = 'Manish';

12. Delete Record


SQL PRACTICAL FILE

DELETE FROM STUDENT WHERE ROLLNO = 5;

13. Group by Class and Avg Marks

SELECT CLASS, AVG(MARKS) FROM STUDENT GROUP BY CLASS;

You might also like