---
title: "Class 12 Computer Science SQL Questions with Output (083)"
description: "Class 12 computer science SQL questions in syllabus order: 50 solved with real MySQL output, GROUP BY, HAVING and join traps, and 4-mark practice."
canonical: https://learn.modernagecoders.com/cbse-class-12-computer-science-sql-queries
source: src/pages/cbse-class-12-computer-science-sql-queries.html
---
> Class 12 computer science SQL questions in syllabus order: 50 solved with real MySQL output, GROUP BY, HAVING and join traps, and 4-mark practice.

Start here

## Courses that teach this SQL

The questions below test SQL. These courses teach it: alone, as part of the whole 083 syllabus, or after the Python it connects to.

[![MySQL for Teens course thumbnail](/images/mysql-teens.webp)  SQL / Start to apps MySQL for Teens Begins at the first SELECT and reaches joins, table design and apps. Past the syllabus in places, and the quickest route if queries feel like guesswork. Open the course →](/courses/mysql-mastery-for-teens)[![Computer Science Class 11 and 12 course thumbnail](/images/ip-cs-class-11-12.webp)  083 / Whole paper Computer Science 11 and 12 SQL taught alongside Python, files and networks for CBSE students, with the report file's query sets built as you go. Open the course →](/courses/cbse-icse-computer-science-class-11-12-python-java-complete-course)[![Python for Teens course thumbnail](/images/python-teens.webp)  Python / The other 40 Python for Teens For a student whose SQL is sound but whose Python is not. Programming is 40 of the 70 theory marks. Open the course →](/courses/python-complete-masterclass-teens)

Ans. The short version

Class 12 computer science SQL questions in CBSE 083 cover keys and constraints, DDL and DML commands, SELECT with WHERE, LIKE, BETWEEN, IN and NULL, aggregate functions, GROUP BY with HAVING, and three joins: cartesian product, equi-join and natural join. Database Management is 20 of the 70 theory marks in 2026-27, and the lab test adds 4 marks for SQL queries. This page has 50 original questions on two tables, with real MySQL output. Modern Age Coders teaches SQL live, personalised one to one at your timing, and a priority demo gives you a full class to try first.

Start here. Two tables, 20 marks

## Which SQL questions come in Class 12 Computer Science?

In the CBSE sample paper for 2026-27, the database unit fills six 1-mark questions, one 2-mark question and three 4-mark questions. One of those three is Python with MySQL; the rest is the SQL and relational theory on this page.

### Where the 20 marks sit

| Sample paper question | What it wants | Marks |
| --- | --- | --- |
| 4, 9, 13, 15, 19, 21 | Keys, domain, degree and cardinality, one query or command to choose, NULL | 6 |
| 27 | Two commands, or a difference with examples | 2 |
| 32 | One table: four queries to write, or four outputs | 4 |
| 34 | Two tables: four queries, joins among them | 4 |
| 35 | A Python-MySQL program | 4 |

In 32 and 34 the marking scheme gives one mark for each correct query or output. There is no partial credit printed, so a missing condition can cost the full mark.

### The database: an animal shelter

PET holds the animals. VISIT holds each trip to a vet. One pet may have several visits or none. Two weights were never taken, and one fee was never charged: those NULLs are there on purpose.

Keep both tables open beside you. Every query from Question 8 on was run on MySQL 26, and an older version in your lab may word an error slightly differently.

### PET

| PID | PName | Species | AgeM | Weight | Arrived |
| --- | --- | --- | --- | --- | --- |
| P01 | Biscuit | Dog | 14 | 11.5 | 2026-08-03 |
| P02 | Mishti | Cat | 8 | 3.2 | 2026-08-19 |
| P03 | Rocket | Dog | 30 | 18.4 | 2026-09-02 |
| P04 | Kaju | Rabbit | 6 | 1.8 | 2026-09-02 |
| P05 | Simba | Cat | 26 | NULL | 2026-10-11 |
| P06 | Bhalu | Dog | 9 | NULL | 2026-10-20 |
| P07 | Pihu | Cat | 5 | 2.4 | 2026-11-05 |
| P08 | Momo | Rabbit | 11 | 2.1 | 2026-11-05 |

AgeM is the age in months.

### VISIT

| VNo | PID | Vet | Reason | Fee | VDate |
| --- | --- | --- | --- | --- | --- |
| 101 | P01 | Dr Sen | Vaccine | 400 | 2026-08-10 |
| 102 | P03 | Dr Roy | Injury | 1500 | 2026-09-03 |
| 103 | P02 | Dr Sen | Vaccine | 400 | 2026-09-12 |
| 104 | P05 | Dr Roy | Checkup | 300 | 2026-10-12 |
| 105 | P01 | Dr Sen | Checkup | 300 | 2026-10-30 |
| 106 | P03 | Dr Roy | Injury | 900 | 2026-11-06 |
| 107 | P07 | Dr Iyer | Vaccine | NULL | 2026-11-09 |

### Relational model, Questions 1 to 5

1. **Q1.** What are the degree and the cardinality of PET? Answer Degree **6** (attributes) and cardinality **8** (tuples).
2. **Q2.** Is PName a candidate key of PET? Answer No. No name repeats today, but a second Biscuit may arrive tomorrow. A candidate key must be unique for every row the table could ever hold, so PID is the only one here, and it is the primary key.
3. **Q3.** Which attribute is a foreign key, and what does it refer to? Answer**VISIT.PID** refers to **PET.PID**. It repeats in VISIT because a pet may visit more than once.
4. **Q4.** What is the domain of Species in this shelter? Answer The set of values it may take: {Dog, Cat, Rabbit}.
5. **Q5.** One pet is adopted and its row deleted, then a column Colour is added. State the new degree and cardinality. Answer Degree **7**, cardinality **7**. Rows change the cardinality, columns change the degree.

Notes first, then commands

## Class 12 SQL notes: every command in the syllabus on one screen

DDL commands build and change the table. DML commands work on the rows inside it. Anything not in this list, such as subqueries, views, triggers or outer joins, is outside the 083 syllabus for 2026-27.

| Command or clause | Kind | What it does | Shape to remember |
| --- | --- | --- | --- |
| CREATE DATABASE, USE, DROP DATABASE | DDL (USE only selects) | Make, open, remove a database | `CREATE DATABASE shelter;` |
| SHOW DATABASES, SHOW TABLES, DESCRIBE | Look only | List databases, list tables, show columns | `DESCRIBE PET;` |
| CREATE TABLE | DDL | Columns, types, constraints | `PName VARCHAR(15) NOT NULL` |
| ALTER TABLE | DDL | Add or remove a column or the primary key | `ALTER TABLE PET ADD Tag CHAR(6);` |
| DROP TABLE | DDL | Remove rows and structure | `DROP TABLE PET;` |
| INSERT | DML | Add rows | `INSERT INTO PET VALUES (...);` |
| UPDATE | DML | Change values in existing rows | `UPDATE PET SET ... WHERE ...;` |
| DELETE | DML | Remove rows, keep the table | `DELETE FROM PET WHERE ...;` |
| SELECT, DISTINCT, alias | DML | Choose columns, drop repeated rows, rename a heading | `SELECT AgeM / 12 AS Years` |
| WHERE with IN, BETWEEN, LIKE, IS NULL | Clause | Keep some rows | `LIKE '_i%'` |
| GROUP BY, HAVING | Clauses | Make groups, keep some groups | `HAVING COUNT(*) > 2` |
| ORDER BY | Clause | Sort the result | `ORDER BY Species, AgeM DESC` |
| MAX, MIN, SUM, AVG, COUNT | Aggregate | One value from many rows | `AVG(Fee)` |

**Data types:** CHAR(n) has a fixed length, VARCHAR(n) holds up to n characters, then INT, FLOAT and DATE written as `'2026-11-05'`. **Constraints:** NOT NULL, UNIQUE, PRIMARY KEY.

### Building and changing tables, Questions 6 to 13

1. **Q6.** Write the commands to create a database named shelter and open it. Answer

  ***SQL**answer*

  ```
  CREATE DATABASE shelter;
  USE shelter;
  ```
2. **Q7.** Write the command to create PET. PID is the primary key and the name must not be empty. Answer

  ***SQL**answer*

  ```
  CREATE TABLE PET(
      PID     CHAR(3) PRIMARY KEY,
      PName   VARCHAR(15) NOT NULL,
      Species VARCHAR(10),
      AgeM    INT,
      Weight  FLOAT,
      Arrived DATE);
  ```
3. **Q8.** Show the structure of VISIT. Answer

  ***MySQL**query and result*

  ```
  DESCRIBE VISIT;
  +--------+-------------+------+-----+---------+-------+
  | Field  | Type        | Null | Key | Default | Extra |
  +--------+-------------+------+-----+---------+-------+
  | VNo    | int         | NO   | PRI | NULL    |       |
  | PID    | char(3)     | NO   |     | NULL    |       |
  | Vet    | varchar(15) | YES  |     | NULL    |       |
  | Reason | varchar(10) | YES  |     | NULL    |       |
  | Fee    | int         | YES  |     | NULL    |       |
  | VDate  | date        | YES  |     | NULL    |       |
  +--------+-------------+------+-----+---------+-------+
  ```

  VNo says NO under Null although NOT NULL was never typed for it: a primary key brings that rule along.
4. **Q9.** Add a column Tag to PET, change its type, then remove it. Answer

  ***MySQL**query and result*

  ```
  ALTER TABLE PET ADD Tag CHAR(6);
  Query OK, 0 rows affected
  Records: 0  Duplicates: 0  Warnings: 0

  ALTER TABLE PET MODIFY Tag VARCHAR(10);
  Query OK, 8 rows affected
  Records: 8  Duplicates: 0  Warnings: 0

  ALTER TABLE PET DROP COLUMN Tag;
  Query OK, 0 rows affected
  Records: 0  Duplicates: 0  Warnings: 0
  ```

1. **Q10.** Remove the primary key of VISIT and then put it back. Answer

  ***MySQL**query and result*

  ```
  ALTER TABLE VISIT DROP PRIMARY KEY;
  Query OK, 7 rows affected
  Records: 7  Duplicates: 0  Warnings: 0

  ALTER TABLE VISIT ADD PRIMARY KEY (VNo);
  Query OK, 0 rows affected
  Records: 0  Duplicates: 0  Warnings: 0
  ```

  Dropping takes no column name, since a table has only one primary key. Adding needs it in brackets.
2. **Q11.** What happens when a row repeats a primary key, and when it leaves a NOT NULL column empty? Answer

  ***MySQL**query and result*

  ```
  INSERT INTO PET VALUES
  ('P03', 'Tara', 'Dog', 7, 6.5, '2026-11-12');
  ERROR 1062 (23000): Duplicate entry 'P03' for key 'pet.PRIMARY'

  INSERT INTO PET VALUES
  ('P09', NULL, 'Dog', 7, 6.5, '2026-11-12');
  ERROR 1048 (23000): Column 'PName' cannot be null
  ```

  Neither row is stored.
3. **Q12.** Tara's age and weight are not known yet. Insert what is known, then complete it. Answer

  ***MySQL**query and result*

  ```
  INSERT INTO PET (PID, PName, Species)
  VALUES ('P09', 'Tara', 'Dog');
  Query OK, 1 row affected

  UPDATE PET SET AgeM = 7, Arrived = '2026-11-12'
  WHERE PID = 'P09';
  Query OK, 1 row affected
  Rows matched: 1  Changed: 1  Warnings: 0

  SELECT * FROM PET WHERE PID = 'P09';
  +-----+-------+---------+------+--------+------------+
  | PID | PName | Species | AgeM | Weight | Arrived    |
  +-----+-------+---------+------+--------+------------+
  | P09 | Tara  | Dog     |    7 |   NULL | 2026-11-12 |
  +-----+-------+---------+------+--------+------------+
  ```

  Columns left out of the list become NULL. Weight still is.
4. **Q13.** Delete Tara's row. What does MySQL say if the PID does not exist? Answer

  ***MySQL**query and result*

  ```
  DELETE FROM PET WHERE PID = 'P09';
  Query OK, 1 row affected

  DELETE FROM PET WHERE PID = 'P55';
  Query OK, 0 rows affected
  ```

  No error, only 0 rows affected. And without WHERE, every row goes.

One table, rows and columns

## SQL queries for Class 12 Computer Science: SELECT and WHERE, Questions 14 to 23

WHERE keeps a row only when its condition is true for that row. False drops it, and so does unknown, which is what NULL produces.

1. **Q14.** Show each dog's name and its age in years under the heading Years. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, AgeM / 12 AS Years FROM PET
  WHERE Species = 'Dog';
  +---------+--------+
  | PName   | Years  |
  +---------+--------+
  | Biscuit | 1.1667 |
  | Rocket  | 2.5000 |
  | Bhalu   | 0.7500 |
  +---------+--------+
  ```

  Division with / gives decimals even for two integers.
2. **Q15.** List the species in the shelter, each once. Answer

  ***MySQL**query and result*

  ```
  SELECT DISTINCT Species FROM PET;
  +---------+
  | Species |
  +---------+
  | Dog     |
  | Cat     |
  | Rabbit  |
  +---------+
  ```

  DISTINCT works on the whole row you select. With two columns, it removes repeated pairs.
3. **Q16.** Names and ages of pets aged 8 to 14 months. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, AgeM FROM PET
  WHERE AgeM BETWEEN 8 AND 14;
  +---------+------+
  | PName   | AgeM |
  +---------+------+
  | Biscuit |   14 |
  | Mishti  |    8 |
  | Bhalu   |    9 |
  | Momo    |   11 |
  +---------+------+
  ```

  Mishti at 8 and Biscuit at 14 are both in: BETWEEN includes its ends.
4. **Q17.** Cats and rabbits younger than 10 months. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Species FROM PET
  WHERE Species IN ('Cat', 'Rabbit') AND AgeM < 10;
  +--------+---------+
  | PName  | Species |
  +--------+---------+
  | Mishti | Cat     |
  | Kaju   | Rabbit  |
  | Pihu   | Cat     |
  +--------+---------+
  ```
5. **Q18.** Names with i as the second letter, and names of exactly four letters. Answer

  ***MySQL**query and result*

  ```
  SELECT PName FROM PET WHERE PName LIKE '_i%';
  +---------+
  | PName   |
  +---------+
  | Biscuit |
  | Mishti  |
  | Simba   |
  | Pihu    |
  +---------+

  SELECT PName FROM PET WHERE PName LIKE '____';
  +-------+
  | PName |
  +-------+
  | Kaju  |
  | Pihu  |
  | Momo  |
  +-------+
  ```

  One underscore is one character. Four underscores and no % means exactly four.

1. **Q19.** Which pets have not been weighed? Why does = NULL not find them? Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Weight FROM PET WHERE Weight IS NULL;
  +-------+--------+
  | PName | Weight |
  +-------+--------+
  | Simba |   NULL |
  | Bhalu |   NULL |
  +-------+--------+

  SELECT PName, Weight FROM PET WHERE Weight = NULL;
  Empty set
  ```

  A comparison with an unknown value is unknown, never true.
2. **Q20.** Predict: pets for which Weight is NOT less than 5. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Weight FROM PET WHERE NOT Weight < 5;
  +---------+--------+
  | PName   | Weight |
  +---------+--------+
  | Biscuit |   11.5 |
  | Rocket  |   18.4 |
  +---------+--------+
  ```

  Simba and Bhalu are missing. NOT unknown is still unknown.
3. **Q21.** Sort by species, and the oldest first inside each species. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Species, AgeM FROM PET
  ORDER BY Species, AgeM DESC;
  +---------+---------+------+
  | PName   | Species | AgeM |
  +---------+---------+------+
  | Simba   | Cat     |   26 |
  | Mishti  | Cat     |    8 |
  | Pihu    | Cat     |    5 |
  | Rocket  | Dog     |   30 |
  | Biscuit | Dog     |   14 |
  | Bhalu   | Dog     |    9 |
  | Momo    | Rabbit  |   11 |
  | Kaju    | Rabbit  |    6 |
  +---------+---------+------+
  ```

  DESC belongs only to the column beside it. Species is still ascending.
4. **Q22.** Find dogs and cats older than 20 months. What goes wrong without brackets? Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Species, AgeM FROM PET
  WHERE Species = 'Dog' OR Species = 'Cat' AND AgeM > 20;
  +---------+---------+------+
  | PName   | Species | AgeM |
  +---------+---------+------+
  | Biscuit | Dog     |   14 |
  | Rocket  | Dog     |   30 |
  | Simba   | Cat     |   26 |
  | Bhalu   | Dog     |    9 |
  +---------+---------+------+

  SELECT PName, Species, AgeM FROM PET
  WHERE (Species = 'Dog' OR Species = 'Cat') AND AgeM > 20;
  +--------+---------+------+
  | PName  | Species | AgeM |
  +--------+---------+------+
  | Rocket | Dog     |   30 |
  | Simba  | Cat     |   26 |
  +--------+---------+------+
  ```

  AND is done before OR, so the first query takes every dog. The second is correct; IN would also do.
5. **Q23.** Mishti weighs 3.2. Why does `SELECT PName FROM PET WHERE Weight = 3.2;` return nothing, when the same query with 11.5 finds Biscuit? Answer

  ***MySQL**query and result*

  ```
  SELECT PName FROM PET WHERE Weight = 3.2;
  Empty set

  SELECT PName FROM PET WHERE Weight = 11.5;
  +---------+
  | PName   |
  +---------+
  | Biscuit |
  +---------+
  ```

  FLOAT stores an approximation of 3.2. The value 11.5 can be stored exactly. Use a range for FLOAT columns.

Many rows, one answer

## GROUP BY and HAVING in Class 12 SQL, Questions 24 to 30

GROUP BY makes one row for each group, and HAVING keeps or drops whole groups. WHERE has already done its work on single rows before any group exists.

### The order MySQL thinks in

| Step | Clause | Question it answers |
| --- | --- | --- |
| 1 | FROM | Which table, or which pair of tables? |
| 2 | WHERE | Which rows stay? |
| 3 | GROUP BY | Which rows belong together? |
| 4 | HAVING | Which groups stay? |
| 5 | SELECT | What is shown for each? |
| 6 | ORDER BY | In what order? |

You write SELECT first and MySQL reaches it fifth. That is why WHERE cannot use COUNT(*): at step 2 nothing has been counted.

1. **Q24.** Predict all six values: `SELECT COUNT(*), COUNT(Weight), MIN(AgeM), MAX(AgeM), SUM(AgeM), AVG(AgeM) FROM PET;`Answer

  ***MySQL**query and result*

  ```
  SELECT COUNT(*), COUNT(Weight), MIN(AgeM),
  MAX(AgeM), SUM(AgeM), AVG(AgeM) FROM PET;
  +----------+---------------+-----------+-----------+-----------+-----------+
  | COUNT(*) | COUNT(Weight) | MIN(AgeM) | MAX(AgeM) | SUM(AgeM) | AVG(AgeM) |
  +----------+---------------+-----------+-----------+-----------+-----------+
  |        8 |             6 |         5 |        30 |       109 |   13.6250 |
  +----------+---------------+-----------+-----------+-----------+-----------+
  ```

  COUNT(Weight) skips the two NULLs. 109 over 8 is 13.6250.
2. **Q25.** Find the number of visits, the number of paid visits, the total and the average fee. Answer

  ***MySQL**query and result*

  ```
  SELECT COUNT(*), COUNT(Fee), SUM(Fee), AVG(Fee)
  FROM VISIT;
  +----------+------------+----------+----------+
  | COUNT(*) | COUNT(Fee) | SUM(Fee) | AVG(Fee) |
  +----------+------------+----------+----------+
  |        7 |          6 |     3800 | 633.3333 |
  +----------+------------+----------+----------+
  ```

  AVG divides by 6, not by 7. A NULL fee is left out; a fee of 0 would have been counted.
3. **Q26.** How many pets of each species, and how old is the oldest of each? Answer

  ***MySQL**query and result*

  ```
  SELECT Species, COUNT(*) AS Pets, MAX(AgeM) AS Oldest
  FROM PET GROUP BY Species;
  +---------+------+--------+
  | Species | Pets | Oldest |
  +---------+------+--------+
  | Dog     |    3 |     30 |
  | Cat     |    3 |     26 |
  | Rabbit  |    2 |     11 |
  +---------+------+--------+
  ```

1. **Q27.** Predict the output, with care for Dr Iyer: `SELECT Vet, COUNT(*), SUM(Fee) FROM VISIT GROUP BY Vet;`Answer

  ***MySQL**query and result*

  ```
  SELECT Vet, COUNT(*), SUM(Fee) FROM VISIT GROUP BY Vet;
  +---------+----------+----------+
  | Vet     | COUNT(*) | SUM(Fee) |
  +---------+----------+----------+
  | Dr Sen  |        3 |     1100 |
  | Dr Roy  |        3 |     2700 |
  | Dr Iyer |        1 |     NULL |
  +---------+----------+----------+
  ```

  The only fee in that group is NULL, so the sum is NULL, not 0.
2. **Q28.** Which reasons occur more than twice? Answer

  ***MySQL**query and result*

  ```
  SELECT Reason, COUNT(*) FROM VISIT
  GROUP BY Reason HAVING COUNT(*) > 2;
  +---------+----------+
  | Reason  | COUNT(*) |
  +---------+----------+
  | Vaccine |        3 |
  +---------+----------+
  ```
3. **Q29.** Leave out injuries. Show vets whose remaining fees total more than 500, the highest first. Answer

  ***MySQL**query and result*

  ```
  SELECT Vet, SUM(Fee) AS Total FROM VISIT
  WHERE Reason <> 'Injury' GROUP BY Vet;
  +---------+-------+
  | Vet     | Total |
  +---------+-------+
  | Dr Sen  |  1100 |
  | Dr Roy  |   300 |
  | Dr Iyer |  NULL |
  +---------+-------+

  SELECT Vet, SUM(Fee) AS Total FROM VISIT
  WHERE Reason <> 'Injury'
  GROUP BY Vet HAVING SUM(Fee) > 500
  ORDER BY Total DESC;
  +--------+-------+
  | Vet    | Total |
  +--------+-------+
  | Dr Sen |  1100 |
  +--------+-------+
  ```

  The first result is what HAVING sees. Dr Roy had 2700 in Question 27, but only 300 once injuries were removed.
4. **Q30.** Both of these fail. Say why. (I) `SELECT Vet FROM VISIT WHERE COUNT(*) > 1 GROUP BY Vet;` (II) `SELECT PName, Species, COUNT(*) FROM PET GROUP BY Species;`Answer

  ***MySQL**query and result*

  ```
  SELECT Vet FROM VISIT WHERE COUNT(*) > 1 GROUP BY Vet;
  ERROR 1111 (HY000): Invalid use of group function

  SELECT PName, Species, COUNT(*) FROM PET
  GROUP BY Species;
  ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'shelter.PET.PName' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
  ```

  (I) has an aggregate in WHERE; move it to HAVING. In (II), three dogs share one row, so which name should it show? A server with a looser setting may print one of them, and that is worse, since it looks like an answer.

Two tables

## Joins in Class 12 Computer Science: cartesian product, equi-join, natural join, Questions 31 to 38

A cartesian product pairs every row of one table with every row of the other. An equi-join keeps the pairs whose common column is equal. A natural join does that by itself, on every column name the tables share.

|   | Cartesian product | Equi-join | Natural join |
| --- | --- | --- | --- |
| Condition | none | you write it: `PET.PID = VISIT.PID` | automatic, on all shared names |
| Rows for our tables | 8 x 7 = 56 | 7 | 7 |
| Columns with SELECT * | 6 + 6 = 12 | 12, PID twice | 11, PID once |
| Pets with no visit | appear, wrongly paired | do not appear | do not appear |

1. **Q31.** How many rows are in the cartesian product of PET and VISIT? Answer

  ***MySQL**query and result*

  ```
  SELECT COUNT(*) FROM PET, VISIT;
  +----------+
  | COUNT(*) |
  +----------+
  |       56 |
  +----------+
  ```
2. **Q32.** Show each visit with the pet's name, the vet, the reason and the fee. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Vet, Reason, Fee FROM PET, VISIT
  WHERE PET.PID = VISIT.PID;
  +---------+---------+---------+------+
  | PName   | Vet     | Reason  | Fee  |
  +---------+---------+---------+------+
  | Biscuit | Dr Sen  | Vaccine |  400 |
  | Rocket  | Dr Roy  | Injury  | 1500 |
  | Mishti  | Dr Sen  | Vaccine |  400 |
  | Simba   | Dr Roy  | Checkup |  300 |
  | Biscuit | Dr Sen  | Checkup |  300 |
  | Rocket  | Dr Roy  | Injury  |  900 |
  | Pihu    | Dr Iyer | Vaccine | NULL |
  +---------+---------+---------+------+
  ```

  Kaju, Bhalu and Momo are absent: no visit matches them.
3. **Q33.** Names of cats with the dates of their visits, using JOIN and ON. Answer

  ***MySQL**query and result*

  ```
  SELECT P.PName, V.VDate
  FROM PET P JOIN VISIT V ON P.PID = V.PID
  WHERE P.Species = 'Cat';
  +--------+------------+
  | PName  | VDate      |
  +--------+------------+
  | Mishti | 2026-09-12 |
  | Simba  | 2026-10-12 |
  | Pihu   | 2026-11-09 |
  +--------+------------+
  ```

  P and V are table aliases. Once given, use them everywhere in the query.
4. **Q34.** How much has been spent on each species? Answer

  ***MySQL**query and result*

  ```
  SELECT Species, SUM(Fee) FROM PET NATURAL JOIN VISIT
  GROUP BY Species;
  +---------+----------+
  | Species | SUM(Fee) |
  +---------+----------+
  | Dog     |     3100 |
  | Cat     |      700 |
  +---------+----------+
  ```

  Rabbits have no visits, so they have no group at all.

1. **Q35.** Pets with more than one visit: name, visits and total fee. Answer

  ***MySQL**query and result*

  ```
  SELECT PName, COUNT(*) AS Visits, SUM(Fee) AS Spent
  FROM PET P, VISIT V WHERE P.PID = V.PID
  GROUP BY PName HAVING COUNT(*) > 1;
  +---------+--------+-------+
  | PName   | Visits | Spent |
  +---------+--------+-------+
  | Biscuit |      2 |   700 |
  | Rocket  |      2 |  2400 |
  +---------+--------+-------+
  ```
2. **Q36.** Why is this an error? `SELECT PID, PName, Vet FROM PET, VISIT WHERE PET.PID = VISIT.PID;`Answer

  ***MySQL**query and result*

  ```
  SELECT PID, PName, Vet FROM PET, VISIT
  WHERE PET.PID = VISIT.PID;
  ERROR 1052 (23000): Column 'PID' in field list is ambiguous
  ```

  Both tables have a PID, and MySQL will not choose. Write PET.PID. A natural join would not need it.
3. **Q37.** Kaju has never seen a vet, yet this returns seven rows. Why? `SELECT PName, Vet FROM PET, VISIT WHERE PName = 'Kaju';`Answer

  ***MySQL**query and result*

  ```
  SELECT PName, Vet FROM PET, VISIT
  WHERE PName = 'Kaju';
  +-------+---------+
  | PName | Vet     |
  +-------+---------+
  | Kaju  | Dr Sen  |
  | Kaju  | Dr Roy  |
  | Kaju  | Dr Sen  |
  | Kaju  | Dr Roy  |
  | Kaju  | Dr Sen  |
  | Kaju  | Dr Roy  |
  | Kaju  | Dr Iyer |
  +-------+---------+
  ```

  The join condition was forgotten, so Kaju is paired with all seven visits. A condition on one table is not a join.
4. **Q38.** The office adds a Weight column to VISIT, still empty. What does `SELECT * FROM PET NATURAL JOIN VISIT;` give now, and why? Answer

  ***MySQL**query and result*

  ```
  ALTER TABLE VISIT ADD Weight FLOAT;
  Query OK, 0 rows affected
  Records: 0  Duplicates: 0  Warnings: 0

  SELECT * FROM PET NATURAL JOIN VISIT;
  Empty set
  ```

  Two names are shared now, PID and Weight, and both must match. NULL matches nothing. An equi-join on PID would be unharmed.

### See the difference in columns

The same two visits, joined both ways. Count the PID headings.

***Natural join, 11 columns**MySQL*

```
SELECT * FROM PET NATURAL JOIN VISIT WHERE Reason = 'Injury';
+-----+--------+---------+------+--------+------------+-----+--------+--------+------+------------+
| PID | PName  | Species | AgeM | Weight | Arrived    | VNo | Vet    | Reason | Fee  | VDate      |
+-----+--------+---------+------+--------+------------+-----+--------+--------+------+------------+
| P03 | Rocket | Dog     |   30 |   18.4 | 2026-09-02 | 102 | Dr Roy | Injury | 1500 | 2026-09-03 |
| P03 | Rocket | Dog     |   30 |   18.4 | 2026-09-02 | 106 | Dr Roy | Injury |  900 | 2026-11-06 |
+-----+--------+---------+------+--------+------------+-----+--------+--------+------+------------+
```

***Equi-join, 12 columns**MySQL*

```
SELECT * FROM PET P, VISIT V WHERE P.PID = V.PID AND Reason = 'Injury';
+-----+--------+---------+------+--------+------------+-----+-----+--------+--------+------+------------+
| PID | PName  | Species | AgeM | Weight | Arrived    | VNo | PID | Vet    | Reason | Fee  | VDate      |
+-----+--------+---------+------+--------+------------+-----+-----+--------+--------+------+------------+
| P03 | Rocket | Dog     |   30 |   18.4 | 2026-09-02 | 102 | P03 | Dr Roy | Injury | 1500 | 2026-09-03 |
| P03 | Rocket | Dog     |   30 |   18.4 | 2026-09-02 | 106 | P03 | Dr Roy | Injury |  900 | 2026-11-06 |
+-----+--------+---------+------+--------+------------+-----+-----+--------+--------+------+------------+
```

To send these queries from a program, continue with [Python MySQL connectivity for Class 12](/cbse-class-12-computer-science-python-mysql-connectivity). To see them inside a finished application, read [the Python and MySQL project](/cbse-class-12-computer-science-project-python-mysql).

Now under exam conditions

## SQL important questions for Class 12: board-style sets, Questions 39 to 50

Thirty minutes, no computer. The marks beside each question follow the sample paper's sizes; the questions are ours, on the same two tables.

### One mark each

1. **Q39.** Which clause removes repeated rows from a result? (a) UNIQUE (b) DISTINCT (c) GROUP (d) DIFFERENT Answer**(b) DISTINCT.** UNIQUE is a constraint on a column.
2. **Q40.**`SELECT PName FROM PET WHERE PName LIKE '%o';` returns: (a) Rocket and Momo (b) Momo (c) no rows (d) every name with an o Answer**(b) Momo.** Nothing follows the o in the pattern, so the name must end with it.
3. **Q41.** Which of these is a DML command? (a) ALTER (b) CREATE (c) UPDATE (d) DROP Answer**(c) UPDATE.** It changes rows; the others change structure.
4. **Q42.** One visit is deleted. Rows in the cartesian product of PET and VISIT are now: (a) 56 (b) 55 (c) 48 (d) 13 Answer**(c) 48,** which is 8 x 6.
5. **Q43.****Assertion:**`DELETE FROM PET;` removes the table PET from the database. **Reason:** DROP TABLE removes both the rows and the structure. Answer**Assertion false, Reason true.** DELETE leaves an empty table with its columns in place.
6. **Q44.** Which constraint allows NULL but refuses a repeated value? (a) PRIMARY KEY (b) NOT NULL (c) UNIQUE (d) CHECK Answer**(c) UNIQUE.**

### Two marks each

1. **Q45.** Write commands to (I) list all databases on the server, (II) show the columns of VISIT. Answer (I) `SHOW DATABASES;` (II) `DESCRIBE VISIT;` or `DESC VISIT;`
2. **Q46.** Differentiate between WHERE and HAVING, with an example of each. Answer WHERE tests single rows before grouping and cannot hold an aggregate: `WHERE Fee > 300`. HAVING tests groups after GROUP BY: `HAVING SUM(Fee) > 300`.
3. **Q47.** Differentiate between DDL and DML, with two commands of each. Answer DDL defines structure: CREATE TABLE, ALTER TABLE. DML handles the data: INSERT, DELETE.

### Four marks each

1. **Q48.** On VISIT, predict the output: (I) `SELECT Vet, MAX(Fee) FROM VISIT GROUP BY Vet;` (II) `SELECT PID, Reason FROM VISIT WHERE Vet LIKE '%y%';` (III) `SELECT COUNT(PID), COUNT(DISTINCT PID) FROM VISIT;` (IV) `SELECT SUM(Fee) FROM VISIT WHERE Reason IN ('Vaccine', 'Checkup');`Answer

  ***MySQL**four results*

  ```
  (I)
  +---------+----------+
  | Vet     | MAX(Fee) |
  +---------+----------+
  | Dr Sen  |      400 |
  | Dr Roy  |     1500 |
  | Dr Iyer |     NULL |
  +---------+----------+

  (II)
  +-----+---------+
  | PID | Reason  |
  +-----+---------+
  | P03 | Injury  |
  | P05 | Checkup |
  | P03 | Injury  |
  | P07 | Vaccine |
  +-----+---------+

  (III)
  +------------+---------------------+
  | COUNT(PID) | COUNT(DISTINCT PID) |
  +------------+---------------------+
  |          7 |                   5 |
  +------------+---------------------+

  (IV)
  +----------+
  | SUM(Fee) |
  +----------+
  |     1400 |
  +----------+
  ```

  In (II) both Roy and Iyer contain y. Copy the headings too: they are part of the output.
2. **Q49.** On VISIT, write queries for: (I) the number of visits for each reason, only where it is above 1; (II) each vet once; (III) visits in November 2026 or later; (IV) visit numbers and fees, highest fee first. Answer

  ***MySQL**query and result*

  ```
  SELECT Reason, COUNT(*) AS Visits FROM VISIT
  GROUP BY Reason HAVING COUNT(*) > 1;
  +---------+--------+
  | Reason  | Visits |
  +---------+--------+
  | Vaccine |      3 |
  | Injury  |      2 |
  | Checkup |      2 |
  +---------+--------+

  SELECT DISTINCT Vet FROM VISIT;
  +---------+
  | Vet     |
  +---------+
  | Dr Sen  |
  | Dr Roy  |
  | Dr Iyer |
  +---------+

  SELECT * FROM VISIT WHERE VDate >= '2026-11-01';
  +-----+-----+---------+---------+------+------------+
  | VNo | PID | Vet     | Reason  | Fee  | VDate      |
  +-----+-----+---------+---------+------+------------+
  | 106 | P03 | Dr Roy  | Injury  |  900 | 2026-11-06 |
  | 107 | P07 | Dr Iyer | Vaccine | NULL | 2026-11-09 |
  +-----+-----+---------+---------+------+------------+

  SELECT VNo, Fee FROM VISIT ORDER BY Fee DESC;
  +-----+------+
  | VNo | Fee  |
  +-----+------+
  | 102 | 1500 |
  | 106 |  900 |
  | 101 |  400 |
  | 103 |  400 |
  | 104 |  300 |
  | 105 |  300 |
  | 107 | NULL |
  +-----+------+
  ```

  NULL comes last in descending order and first in ascending order.
3. **Q50.** On both tables, write queries for: (I) raise the fee of every vaccine visit by 50; (II) name and species of pets that arrived in October 2026; (III) visit number, reason and date for Biscuit and Simba; (IV) pet names with vets, in alphabetical order of name. Answer

  ***MySQL**query and result*

  ```
  UPDATE VISIT SET Fee = Fee + 50 WHERE Reason = 'Vaccine';
  Query OK, 2 rows affected
  Rows matched: 3  Changed: 2  Warnings: 0

  SELECT VNo, Fee FROM VISIT WHERE Reason = 'Vaccine';
  +-----+------+
  | VNo | Fee  |
  +-----+------+
  | 101 |  450 |
  | 103 |  450 |
  | 107 | NULL |
  +-----+------+

  SELECT PName, Species FROM PET
  WHERE Arrived BETWEEN '2026-10-01' AND '2026-10-31';
  +-------+---------+
  | PName | Species |
  +-------+---------+
  | Simba | Cat     |
  | Bhalu | Dog     |
  +-------+---------+

  SELECT V.VNo, V.Reason, V.VDate FROM PET P, VISIT V
  WHERE P.PID = V.PID AND P.PName IN ('Biscuit', 'Simba');
  +-----+---------+------------+
  | VNo | Reason  | VDate      |
  +-----+---------+------------+
  | 101 | Vaccine | 2026-08-10 |
  | 104 | Checkup | 2026-10-12 |
  | 105 | Checkup | 2026-10-30 |
  +-----+---------+------------+

  SELECT PName, Vet FROM PET NATURAL JOIN VISIT
  ORDER BY PName;
  +---------+---------+
  | PName   | Vet     |
  +---------+---------+
  | Biscuit | Dr Sen  |
  | Biscuit | Dr Sen  |
  | Mishti  | Dr Sen  |
  | Pihu    | Dr Iyer |
  | Rocket  | Dr Roy  |
  | Rocket  | Dr Roy  |
  | Simba   | Dr Roy  |
  +---------+---------+
  ```

  Three rows matched in (I) and two changed: NULL + 50 is NULL. The second query only shows that.

### Eight traps, and the habit that beats each

| Trap | Seen in | Habit |
| --- | --- | --- |
| `= NULL` | Q19 | Say "is", write IS NULL |
| AVG over a column with NULL | Q25 | Count the values, not the rows, before dividing |
| Aggregate in WHERE | Q30 | If it counts or adds, it goes in HAVING |
| A column that is neither grouped nor aggregated | Q30 | Every plain column after SELECT must be in GROUP BY |
| AND mixed with OR | Q22 | Put brackets round the OR part |
| Join condition missing | Q37 | Two tables in FROM: write the link before anything else |
| Shared column without a table name | Q36 | Prefix every column that both tables have |
| Natural join on an extra shared column | Q38 | List the common names before you trust it |

### Predict, then run

In a one to one class you write the result grid by hand, NULLs included, before the teacher presses Enter. The gap between the two is the lesson.

### Four queries in the lab

The practical asks for four queries on one or two tables. We set a fresh pair of tables and you type, test and correct against the clock.

### Marked one by one

Each query is right or it is not. The teacher shows which row your version let in or lost, so the same slip is not repeated.

Go further with [the Class 12 CS MCQ test](/cbse-class-12-computer-science-mcq-test), [important questions by unit](/cbse-class-12-computer-science-important-questions), and a whole paper under time on [the 2026-27 sample paper](/cbse-class-12-computer-science-sample-paper-2026-27). Spoken SQL answers are in [the viva bank](/cbse-class-12-computer-science-viva-questions).

One to one, at your own timing

## SQL improves fastest when somebody sees your query

A wrong query often runs without complaint and returns a believable table, so practice alone can fix a mistake in place. Our SQL classes are personalised one to one only, at a time you set. The priority demo is a complete class you can take before enrolling, and its fee is adjusted against the first month; a free demo class is the shorter look. Fees are monthly, nothing is charged for admission, and you may leave at any month end.

Before you enrol · Try a class

### Priority demo, at a slot you pick

a full live class of about 45 to 60 minutes

- Ten queries on two new tables, to see where you stand
- Output predicted on paper, then compared with MySQL
- GROUP BY or joins taught afresh if that is the gap
- A written skill report naming the clauses to practise

[Book a priority demo](/book-demo)

The classes · Choose your own timing

### Personalised one to one

₹4,999

per month, 4 private classes, fully flexible timing

- Start at CREATE TABLE or at joins, wherever you need
- Query sets for your report file, written by you and checked
- Lab-test practice: four queries, timed
- Python, files and networks in the same weekly plan

Ask for a personalised plan

MySQL need not be installed for the first class. If it is missing or refuses to start, the teacher helps you set it up, and the practice then happens on your own machine, where the lab test habits are made.

Studying outside India?

## SQL classes for 083 students abroad

Whether your CBSE school is in Abu Dhabi, Jeddah or Bangkok, the database unit is the same 20 marks. Pick a morning, an evening or a weekend hour by your own clock.

| Where you live | Time difference | Usual class window, local time | Format |
| --- | --- | --- | --- |
| India every Indian city | Indian time | Any time you choose | Personalised 1-on-1 |
| UAE and Oman Dubai, Abu Dhabi, Sharjah, Muscat | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Saudi Arabia, Qatar, Kuwait, Bahrain Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama | 2 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Nepal Kathmandu | 15 min ahead of India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Ethiopia and East Africa Addis Ababa and East Africa Time | 2 h 30 min behind India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore and Malaysia Singapore, Kuala Lumpur | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |

Typing matters in SQL, so you share your screen and we read the query as you write it. A missed semicolon is noticed on the spot, not a week later.

What families say

## Rated 4.9 across 547 Google reviews

Real reviews from real families. We neither write nor commission them.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

The rest of the Class 12 series

## More pages for Class 12 students

Every page in the CBSE Class 12 Computer Science series, grouped by what you need.

### Practicals, project and viva

- [Class 12 CS viva questions](/cbse-class-12-computer-science-viva-questions)
- [Class 12 CS project with source code](/cbse-class-12-computer-science-project-python-mysql)
- [Class 12 CS project topics](/cbse-class-12-computer-science-project-topics)

### Exam, papers and marks

- [Class 12 CS sample paper practice](/cbse-class-12-computer-science-sample-paper-2026-27)
- [Class 12 CS exam date, pattern and marks](/cbse-class-12-computer-science-paper-pattern-and-marking-scheme)
- [Class 12 CS important questions](/cbse-class-12-computer-science-important-questions)

### Questions and practice

- [Class 12 CS MCQ test](/cbse-class-12-computer-science-mcq-test)
- [Class 12 CS output questions](/cbse-class-12-computer-science-output-questions)
- [Class 12 CS case study questions](/cbse-class-12-computer-science-case-study-questions)

### Chapter by chapter

- [Functions in Python Class 12](/cbse-class-12-computer-science-functions)
- [Exception handling Class 12](/cbse-class-12-computer-science-exception-handling)
- [Text file handling Class 12](/cbse-class-12-computer-science-file-handling)
- [CSV and binary files Class 12](/cbse-class-12-computer-science-csv-and-binary-files)
- [Stack Class 12 Computer Science](/cbse-class-12-computer-science-stack)
- [Computer networks Class 12](/cbse-class-12-computer-science-computer-networks)
- [Python MySQL connectivity Class 12](/cbse-class-12-computer-science-python-mysql-connectivity)

### Notes, revision and help

- [Class 12 CS syllabus 2026-27](/cbse-class-12-computer-science-syllabus-2026-27)
- [Class 12 CS notes](/cbse-class-12-computer-science-notes)
- [Class 12 CS revision plan](/cbse-class-12-computer-science-revision-plan)
- [Class 12 CS crash course](/cbse-class-12-computer-science-crash-course)

**CBSE Class 12 Informatics Practices (065):** [Class 12 IP practical file](/cbse-class-12-informatics-practices-practical-file)  [Class 12 IP project with source code](/cbse-class-12-informatics-practices-project)  [Class 12 IP sample paper practice](/cbse-class-12-informatics-practices-sample-paper-2026-27)  [Class 12 IP important questions](/cbse-class-12-informatics-practices-important-questions)

**CBSE Class 12 Information Technology (802):** [IT 802 practical and project file](/cbse-class-12-it-802-practical-and-project-file)  [IT 802 Java notes and programs](/cbse-class-12-it-802-java-programs)  [IT 802 notes](/cbse-class-12-it-802-notes)

**CBSE Class 11 CS, IP and AI:** [Class 11 CS practical file](/cbse-class-11-computer-science-practical-file)  [Class 11 IP practical file](/cbse-class-11-informatics-practices-practical-file)  [CS or IP in Class 11](/computer-science-or-informatics-practices-class-11)

**ISC Computer Science (868):** [ISC Class 12 CS syllabus 2027](/isc-class-12-computer-science-syllabus-2027)  [ISC Class 12 CS practice paper](/isc-class-12-computer-science-specimen-paper-practice)  [ISC Class 12 practical questions solved](/isc-class-12-computer-science-practical-questions)  [ISC Boolean algebra and K-maps](/isc-class-12-computer-science-boolean-algebra)

**Program lists with output:** [Class 12 CS practical file](/blog/python-practical-file-class-12)  [20 Python programs for Class 12](/blog/python-programs-for-cbse-class-12)  [Menu-driven programs in Python](/blog/how-to-build-menu-driven-program-in-python)

SQL questions, answered

## What Class 12 students ask about SQL

### How many marks is SQL in Class 12 Computer Science?

Database Management is 20 of the 70 theory marks in CBSE 083 for 2026-27. In the sample paper, 4 of those 20 are for a Python-MySQL program and 16 for SQL and relational theory. The practical adds 4 marks for SQL queries in the lab test.

### Which SQL queries are important for Class 12 Computer Science?

GROUP BY with HAVING, aggregates on a column that has NULL, LIKE patterns, BETWEEN and IN, ORDER BY on two columns, UPDATE, ALTER TABLE for a column or primary key, and an equi-join of two tables with a condition. The sample paper uses most of these in Questions 27, 32 and 34.

### What is the difference between equi-join and natural join in Class 12?

An equi-join needs the condition written out and, with SELECT *, shows the common column twice. A natural join matches every column name the two tables share and shows each once. On our tables the first gives 12 columns, the second 11.

### What is the difference between WHERE and HAVING in SQL?

WHERE filters single rows before they are grouped, so it cannot contain COUNT, SUM, AVG, MAX or MIN. HAVING filters groups after GROUP BY and usually does contain one. A query may use both, with WHERE written first.

### Are subqueries, views or outer joins in the Class 12 CS syllabus?

They are not listed in the 083 syllabus for 2026-27. The joins named are cartesian product, equi-join and natural join. Questions such as "pets that never visited" need an outer join or a subquery, so they are outside what is named.

### Is SQL case sensitive in the CBSE exam?

Keywords such as SELECT may be typed in any case in MySQL. Write keywords in capitals for clarity and copy table and column names as the question spells them. Keep text values exactly as given, since you cannot be sure how a comparison treats case.

### What is the order of clauses in a SELECT query?

SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY. Any of the last four may be absent, but they may not change places. MySQL works them out in a different order: FROM and WHERE first, then groups, then SELECT, then sorting.

### Do I have to write the output table with headings?

Yes, write the column headings exactly as the query would show them, including an alias or a heading such as MAX(Fee). Write NULL where the value is missing, not a blank or a zero.

### Is SQL in Computer Science the same as in Informatics Practices?

No. IP (065) adds math, text and date functions and gives SQL 25 theory marks. CS (083) has no such functions but adds natural join and the Python interface. SELECT, GROUP BY, HAVING and equi-join are common to both.

### How can I practise SQL queries for Class 12 with a teacher?

Modern Age Coders teaches 083 SQL live and personalised one to one at your own timing. Book a priority demo for a full class of about 45 to 60 minutes with a written skill report; its fee is adjusted against the first month if you enrol. A free demo class is available as well.

Start

## Write ten queries. See which ones fail.

The free demo class is enough to try a few queries on a table you have not seen and find out whether SELECT, grouping or joins is the weak step.

The **priority demo** goes the full distance: ten queries, the failed ones rebuilt with a teacher, and a written skill report. You choose the slot, and the fee is adjusted against the first month if you enrol.

New to both SQL and Python? [The practical file guide](/blog/python-practical-file-class-12) shows what your school will want to see from each.

[WhatsApp us](https://wa.me/919123366161?text=Hello%20Modern%20Age%20Coders.%20I%20want%20one%20to%20one%20SQL%20classes%20for%20CBSE%20Class%2012%20Computer%20Science%20083.) · [+91 91233 66161](tel:+919123366161) · [connect@modernagecoders.com](mailto:connect@modernagecoders.com)

Every class is live video. The form requests a callback and reserves nothing.

### Want it sooner? Book a priority demo

A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.

[Book a priority demo](/book-demo)

## Keep exploring Modern Age Coders

### By class and age

- [Class 12 IP Computer Networks Notes: Unit 3 for 2026-27](/cbse-class-12-informatics-practices-computer-networks)
- [Class 12 IP Crash Course 2027: Live One to One Classes](/cbse-class-12-informatics-practices-crash-course)
- [DataFrame Class 12 IP: Notes, loc and iloc, Programs](/cbse-class-12-informatics-practices-dataframe)
- [Class 12 IP Data Visualization: Line, Bar, Histogram](/cbse-class-12-informatics-practices-matplotlib-charts)
- [Class 12 IP MCQ with Answers 2026-27: a 40-Question Test](/cbse-class-12-informatics-practices-mcq-test)
- [Pandas Series Class 12 IP: Notes, Outputs and Questions](/cbse-class-12-informatics-practices-pandas-series)
- [Exception Handling Class 12 Computer Science: Notes, Q&A](/cbse-class-12-computer-science-exception-handling)
- [Class 12 Computer Science Crash Course 2027: Live 1-on-1](/cbse-class-12-computer-science-crash-course)
- [Computer Networks Class 12 Notes: CS 083 Unit 2 for 2027](/cbse-class-12-computer-science-computer-networks)

### Learn more

- [Informatics Practices (IP) Class 11-12: CBSE Python & SQL](/courses/cbse-informatics-practices-ip-class-11-12-python-pandas-sql-complete-course)
- [IGCSE Computer Science (0478): Full Syllabus and Exam Prep](/courses/igcse-computer-science-0478-course)
- [Java Programming for Kids & Teens: Learn Java Online](/java-programming-for-kids-teens)
- [MySQL Course: SQL, Database Design and Real Administration](/courses/mysql-database-complete-masterclass-college)

### Free resources

- [SQL Tutorial: Databases, Basics to Advanced](/resources/sql)
- [Self Joins and Multi-Table Queries](/resources/sql/self-joins-and-multi-table)
- [SQL Interview Masterclass](/resources/sql/sql-interview-masterclass)
- [Triggers and Scheduled Events](/resources/sql/triggers-and-events)

### From the blog

- [Python Programs for Class 11 CBSE (CS and IP) With Output](/blog/python-programs-for-class-11)
- [Java Programs for ISC Class 11 and 12 (Solved, 2026)](/blog/java-programs-for-isc-class-11-and-12)
- [IGCSE 0478 Pseudocode: The Rules Examiners Mark](/blog/igcse-computer-science-0478-pseudocode-guide)

### Start here

- [What Modern Age Coders families say](/love)
- [Book a free demo class with Modern Age Coders](/book-demo)

---

*Canonical: https://learn.modernagecoders.com/cbse-class-12-computer-science-sql-queries*
