School Revise · Class 11 Computer Science · Chapter 8
Code 083, Class 12. SQL is the language for talking to a database. Here we create tables and ask questions of the data with queries.
|
|
SQL (Structured Query Language) creates and uses databases. DDL commands define tables (CREATE), and DML commands work with the data (INSERT, SELECT, UPDATE, DELETE).
SELECT reads data. SELECT * FROM STUDENT shows all columns, and a WHERE clause filters rows. ORDER BY sorts the result.
|
SELECT name FROM STUDENT WHERE marks > 80; (shows the names of students who scored above 80) |
These summarise data: COUNT counts rows, SUM adds, AVG averages, and MAX and MIN find the largest and smallest.
INSERT INTO adds a row, UPDATE changes values, and DELETE removes rows. Always use a WHERE clause with UPDATE and DELETE so you change only the rows you mean to.
Explore the idea by tapping. The interactive opens right here in the lesson.
Type each one into the code lab above, then open the card to see the worked solution and its output.
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SOLUTION
OUTPUT
SELECT.
WHERE.
COUNT.
INSERT INTO.
|
SQL creates and uses databases. DDL defines tables (CREATE); DML works with data. SELECT reads data, WHERE filters rows, ORDER BY sorts. Aggregate functions COUNT, SUM, AVG, MAX and MIN summarise data. INSERT adds rows, UPDATE changes them, and DELETE removes them, and UPDATE and DELETE should use a WHERE clause. |
| Open the Virtual Lab |
These free Class 12 Computer Science notes explain SQL, SELECT with WHERE and ORDER BY, aggregate functions COUNT SUM AVG MAX and MIN, and INSERT UPDATE and DELETE with worked examples and practice, for CBSE students across India and the Gulf including the UAE, Saudi Arabia, Qatar, Oman, Kuwait and Bahrain.
© 2026 School Revise. All rights reserved. Original content aligned to the CBSE and NCERT Class 12 Computer Science syllabus. Unauthorised copying is not permitted.