★★★★★
"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
CBSE Class 12 · Information Technology 802 · 2026-27
Everything the 40-mark practical of Class 12 IT 802 asks you to bring, in one place: a practical file with 15 Java programs and 15 MySQL entries, a NetBeans project you can build and change, a practice lab test, and the viva questions your own pages invite.
Live online · Java run on version 21, SQL run on MySQL 26 · your days and your timing · first class free
Start here
IT 802 is one half Java and one half MySQL in the lab. Pick the course for the half that worries you, or the Class 11 and 12 course if you also need computer science theory.

Java half / 802
Starts from a first program and reaches arrays, strings, exceptions and object oriented programming, the topics of Unit 3, before going on to apps and games.
Open the course →
MySQL half / 802
From the first query to joins, grouping, constraints and database design, with a connected project at the end.
Open the course →
Wider / 11 and 12
For students who take computer science in another school or board, or want the theory taught alongside programming.
Open the course →Ans. The short version
A Class 12 IT 802 project file has two parts that are marked separately in 2026-27. The practical file, 10 marks, must hold at least 15 Java programs and 15 MySQL queries. The project, 5 marks, can be any application made in Java NetBeans IDE. The lab test gives 10 marks for a Java program and 10 for creating a table and answering five queries, and the viva gives 5, so the practical totals 40. Every program and query on this page was run. Modern Age Coders teaches this practical in personalised one to one classes, and a priority demo lets you try a full class before enrolling.
Q1. What is the practical worth?
The practical file carries 10 marks and the project 5. Together with the lab test and viva they make 40 of the 100 marks, so the lab is worth two thirds of what the theory paper is.
| Part of the practical | Marks | What you must show |
|---|---|---|
| Java program | 10 | A program written and run in the lab |
| SQL queries | 10 | One table created, then five queries on it |
| Practical file | 10 | Minimum 15 Java programs and minimum 15 queries in MySQL |
| Viva voce | 5 | Spoken answers |
| Project | 5 | Any application made using Java NetBeans IDE |
| Total | 40 | Theory is the other 60 |
Two things in that table are easy to get wrong. The Class 11 split is different (office tools take 15 marks there and the file only 5), so a senior’s Class 11 file is no guide. And the table does not say how the 10 marks of the Java program are divided between logic, comments and output; if a website prints such a division for 802, ask where it came from.
CBSE has scheduled 2026-27 practicals from 1 January 2027, and from 9 November to 19 December 2026 for winter-bound schools; your school fixes the day. The theory units behind this work are set out on the IT 802 syllabus page.
Q2. How is the file laid out?
Keep one file with two halves, Java first and MySQL second, and the project in a thin file of its own because it is marked on its own. The board prescribes the counts, not the decoration, so a format from your teacher comes first.
Information Technology (Code 802)
Practical File: Java and MySQL
Session 2026-27
Name, Class XII and section
Board roll number (leave blank until you have it)
School and teacher in charge
This is to certify that the Java programs and MySQL queries recorded here were executed by [name] of Class XII [section] in the school computer laboratory during 2026-27.
Signature of teacher, signature of examiner, date, school seal
Aim in one line, then the code, then the output you actually saw. If the program takes a decision, paste a run for each side of it. Put the class name in the heading, since Java refuses to compile a public class saved under another name.
The question in English, the query in capitals for keywords, and the result grid. Print the starting table once, at the front of the MySQL half, so any reader can check a result by eye.
| No. | Java entry | Topic in Unit 3 | MySQL entry |
|---|---|---|---|
| 1 | Details card | Language elements | Create and open a database |
| 2 | Call time | Operators | Create a table, see its structure |
| 3 | Net cafe charge | Control flow, if | Second table with a foreign key |
| 4 | Helpdesk menu | Control flow, switch | Insert rows |
| 5 | Savings table | Control flow, for | Insert with a default value |
| 6 | Ticket number | Control flow, while | BETWEEN |
| 7 | Shop total | Control flow, do-while | LIKE and IN |
| 8 | Marks | Array | IS NULL |
| 9 | Pages by lab and day | Array, two dimensions | DISTINCT and ORDER BY |
| 10 | Ticket | Class design | UPDATE |
| 11 | Device and printer | Object oriented programming | ALTER TABLE |
| 12 | Cartridge | Exception handling | Aggregate functions |
| 13 | Discount | Assertions | GROUP BY |
| 14 | Two jobs | Threads | HAVING |
| 15 | Stock line | Wrapper classes, strings | Two tables joined |
Each topic named in the Java unit has an entry, so the index itself shows the examiner full coverage.
Q3. Which Java programs go in?
The programs follow a computer helpdesk and lab, since the job role printed on the 802 syllabus is Domestic IT Helpdesk Assistant. They are console programs: in NetBeans make a Java Application project, add a class with the name shown and press Run File. A dashed line in an output box separates two runs.
To store details in variables of different data types and display them.
// Program 1: a details card using variables of five types
public class DetailsCard {
public static void main(String[] args) {
String name = "Meher Sandhu";
int rollNo = 14;
char section = 'B';
double height = 1.58; // in metres
boolean hosteller = false;
System.out.println("Name : " + name);
System.out.println("Class : XII " + section);
System.out.println("Roll no : " + rollNo);
System.out.println("Height : " + height + " m");
System.out.println("Hosteller : " + hosteller);
System.out.print("Session");
System.out.println(" : 2026-27");
}
}
Name : Meher Sandhu Class : XII B Roll no : 14 Height : 1.58 m Hosteller : false Session : 2026-27
Why is the f or L suffix not needed here? 1.58 is a double by default, and 14 fits an int. A float would need 1.58f, a large long would need L.
To convert seconds into hours, minutes and seconds using / and %.
// Program 2: seconds spent on a call, as hours, minutes, seconds
import java.util.Scanner;
public class CallTime {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Call length in seconds: ");
int total = in.nextInt();
int hours = total / 3600; // whole hours
int rest = total % 3600; // seconds left over
int minutes = rest / 60;
int seconds = rest % 60;
System.out.println(hours + " h " + minutes + " min "
+ seconds + " s");
System.out.println("Over an hour: " + (total > 3600));
}
}
Call length in seconds: 4075 1 h 7 min 55 s Over an hour: true - - - - - - - - Call length in seconds: 3600 1 h 0 min 0 s Over an hour: false
Why is the second run false? 3600 is not greater than 3600. With >= it would be true.
To find the charge for computer use from slabs, using if, else if and else.
// Program 3: charge for using a computer at a net cafe
import java.util.Scanner;
public class CafeCharge {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Minutes used: ");
int minutes = in.nextInt();
int charge;
if (minutes <= 0) {
charge = 0;
} else if (minutes <= 30) {
charge = 20; // flat for the first 30
} else {
int extra = minutes - 30;
int blocks = (extra + 14) / 15; // started blocks
charge = 20 + blocks * 8;
if (charge > 100) {
charge = 100; // daily limit
}
}
System.out.println("Pay Rs " + charge);
}
}
Minutes used: 25 Pay Rs 20 - - - - - - - - Minutes used: 70 Pay Rs 44 - - - - - - - - Minutes used: 600 Pay Rs 100
Why add 14 before dividing? Integer division drops the fraction. Adding 14 makes every started block of 15 count, so 70 minutes is 20 + 3 blocks of 8.
To show advice for a chosen problem using switch.
// Program 4: helpdesk menu with switch
import java.util.Scanner;
public class HelpMenu {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("1 Printer 2 Network 3 Password");
System.out.print("Your choice: ");
int choice = in.nextInt();
switch (choice) {
case 1:
System.out.println("Check paper and toner.");
break;
case 2:
System.out.println("Check the cable first.");
break;
case 3:
System.out.println("Ask the lab teacher.");
break;
default:
System.out.println("No such option: " + choice);
}
}
}
1 Printer 2 Network 3 Password Your choice: 2 Check the cable first. - - - - - - - - 1 Printer 2 Network 3 Password Your choice: 7 No such option: 7
Can switch replace any if? No. It compares one value with constants; a range such as marks above 75 needs if.
To print a six-month savings table using a for loop.
// Program 5: monthly savings with 1% interest, using for
public class SavingsTable {
public static void main(String[] args) {
double balance = 0;
double deposit = 500;
System.out.println("Month Interest Balance");
for (int month = 1; month <= 6; month++) {
double interest = balance * 1 / 100;
balance = balance + interest + deposit;
System.out.printf("%5d %9.2f %9.2f%n",
month, interest, balance);
}
}
}
Month Interest Balance
1 0.00 500.00
2 5.00 1005.00
3 10.05 1515.05
4 15.15 2030.20
5 20.30 2550.50
6 25.51 3076.01
What does %9.2f mean? A decimal number in a width of 9 with 2 digits after the point. %5d is the same idea for an integer, and %n ends the line.
To find the digit sum and the reverse of a number using while.
// Program 6: digits of a ticket number, using while
import java.util.Scanner;
public class TicketNumber {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Ticket number: ");
int number = in.nextInt();
int copy = number; // number is needed later
int sum = 0;
int reverse = 0;
while (copy > 0) {
int digit = copy % 10;
sum = sum + digit;
reverse = reverse * 10 + digit;
copy = copy / 10;
}
System.out.println("Sum of digits: " + sum);
System.out.println("Reversed : " + reverse);
System.out.println("Palindrome : " + (reverse == number));
}
}
Ticket number: 48084 Sum of digits: 24 Reversed : 48084 Palindrome : true - - - - - - - - Ticket number: 1250 Sum of digits: 8 Reversed : 521 Palindrome : false
Why keep a copy? The loop reduces copy to 0, so without number there would be nothing left to compare with.
To add prices until zero is entered, using do-while.
// Program 7: add prices until 0 is typed, using do-while
import java.util.Scanner;
public class ShopTotal {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double price;
double total = 0;
int items = 0;
do {
System.out.print("Price (0 to stop): ");
price = in.nextDouble();
if (price > 0) {
total = total + price;
items++;
}
} while (price != 0);
System.out.println(items + " items, total Rs " + total);
}
}
Price (0 to stop): 45.5 Price (0 to stop): 120 Price (0 to stop): 0 2 items, total Rs 165.5
Why do-while and not while? The price has to be read once before it can be tested. The body of do-while always runs at least once.
To find the highest, lowest and average of an array and count the values above average.
// Program 8: highest, lowest and average in an array
public class MarksArray {
public static void main(String[] args) {
int[] marks = {41, 56, 38, 56, 27, 49};
int highest = marks[0];
int lowest = marks[0];
int total = 0;
for (int i = 0; i < marks.length; i++) {
total = total + marks[i];
if (marks[i] > highest) {
highest = marks[i];
}
if (marks[i] < lowest) {
lowest = marks[i];
}
}
double average = (double) total / marks.length;
int above = 0;
for (int m : marks) { // enhanced for
if (m > average) {
above++;
}
}
System.out.println("Highest " + highest
+ ", lowest " + lowest);
System.out.println("Average " + average);
System.out.println("Above average: " + above + " students");
}
}
Highest 56, lowest 27 Average 44.5 Above average: 3 students
Why start highest at marks[0] and not 0? With negative data, such as temperatures, 0 could be larger than every value and the answer would be wrong.
To find row totals and the largest column total of a two-dimensional array.
// Program 9: pages printed in 3 labs on 4 days (2D array)
public class LabPages {
public static void main(String[] args) {
int[][] pages = {
{20, 35, 10, 15},
{12, 18, 40, 22},
{30, 25, 28, 5}
};
for (int lab = 0; lab < pages.length; lab++) {
int total = 0;
for (int day = 0; day < pages[lab].length; day++) {
System.out.print(pages[lab][day] + "\t");
total = total + pages[lab][day];
}
System.out.println("= " + total);
}
int bestDay = 0;
int bestTotal = 0;
for (int day = 0; day < 4; day++) {
int total = 0;
for (int lab = 0; lab < 3; lab++) {
total = total + pages[lab][day];
}
if (total > bestTotal) {
bestTotal = total;
bestDay = day + 1;
}
}
System.out.println("Busiest day: " + bestDay
+ " with " + bestTotal + " pages");
}
}
20 35 10 15 = 80 12 18 40 22 = 92 30 25 28 5 = 88 Busiest day: 2 with 78 pages
Which index is the row? The first. Adding along a row keeps lab fixed; adding down a column keeps day fixed.
To define a class with private data, a constructor, methods and a static member.
// Program 10: class with constructor, methods, static count
class Ticket {
private static int count = 0; // shared by all tickets
private int number;
private String problem;
private boolean open;
Ticket(String problem) {
count++;
number = count;
this.problem = problem;
open = true;
}
void close() {
open = false;
}
void show() {
String status = open ? "open" : "closed";
System.out.println("#" + number + " " + problem
+ " (" + status + ")");
}
static int getCount() {
return count;
}
}
public class TicketDemo {
public static void main(String[] args) {
Ticket first = new Ticket("No sound in speaker");
Ticket second = new Ticket("Mouse not detected");
first.close();
first.show();
second.show();
System.out.println("Tickets raised: " + Ticket.getCount());
}
}
#1 No sound in speaker (closed) #2 Mouse not detected (open) Tickets raised: 2
What does this.problem mean? The variable of the object. The plain name problem is the parameter of the constructor.
To show inheritance, the super keyword and method overriding.
// Program 11: inheritance, super and method overriding
class Device {
String brand;
double price;
Device(String brand, double price) {
this.brand = brand;
this.price = price;
}
void describe() {
System.out.println(brand + ", Rs " + price);
}
}
class Printer extends Device {
int pagesPerMinute;
Printer(String brand, double price, int pagesPerMinute) {
super(brand, price); // parent constructor first
this.pagesPerMinute = pagesPerMinute;
}
@Override
void describe() {
super.describe();
System.out.println("Prints " + pagesPerMinute
+ " pages a minute");
}
}
public class DeviceDemo {
public static void main(String[] args) {
Device scanner = new Device("Orbit Scan", 6500);
Device printer = new Printer("Orbit Jet", 9200, 18);
scanner.describe();
printer.describe(); // Printer version runs
}
}
Orbit Scan, Rs 6500.0 Orbit Jet, Rs 9200.0 Prints 18 pages a minute
The variable is of type Device. Why does the Printer version run? Java picks an overridden method by the object, not by the type of the variable. This is run-time polymorphism.
To handle arithmetic and input exceptions with try, catch and finally.
// Program 12: try, catch and finally
import java.util.InputMismatchException;
import java.util.Scanner;
public class Cartridge {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
try {
System.out.print("Pages printed: ");
int pages = in.nextInt();
System.out.print("Cartridges used: ");
int used = in.nextInt();
System.out.println("Pages per cartridge: "
+ pages / used);
} catch (ArithmeticException e) {
System.out.println("Cannot divide: " + e.getMessage());
} catch (InputMismatchException e) {
System.out.println("Please type a whole number.");
} finally {
System.out.println("Register closed.");
}
}
}
Pages printed: 900 Cartridges used: 4 Pages per cartridge: 225 Register closed. - - - - - - - - Pages printed: 900 Cartridges used: 0 Cannot divide: / by zero Register closed. - - - - - - - - Pages printed: nine Please type a whole number. Register closed.
Why are there two catch blocks? They answer two different mistakes: a zero where we divide, and letters where a whole number is needed. Only the matching block runs.
To test a condition with assert, with assertions off and on.
// Program 13: an assertion on a discount
public class DiscountCheck {
static double payable(double price, double percent) {
assert percent >= 0 && percent <= 100
: "bad percent " + percent;
return price - price * percent / 100;
}
public static void main(String[] args) {
System.out.println(payable(800, 15));
System.out.println(payable(800, 150));
}
}
680.0 -400.0 - - - - - - - - 680.0 Exception in thread "main" java.lang.AssertionError: bad percent 150.0 at DiscountCheck.payable(DiscountCheck.java:4) at DiscountCheck.main(DiscountCheck.java:11)
How do you switch assertions on in NetBeans? Project Properties, Run, VM Options: type -ea. The first run had them off and gave a wrong answer quietly; the second stopped at the mistake.
To run two threads at the same time and wait for both.
// Program 14: two threads working at the same time
class Job extends Thread {
private int steps;
private int pause; // milliseconds
Job(String name, int steps, int pause) {
super(name);
this.steps = steps;
this.pause = pause;
}
@Override
public void run() {
for (int i = 1; i <= steps; i++) {
try {
Thread.sleep(pause);
} catch (InterruptedException e) {
return;
}
System.out.println(getName() + " step " + i);
}
}
}
public class TwoJobs {
public static void main(String[] args)
throws InterruptedException {
Job scan = new Job("Virus scan", 2, 1000);
Job copy = new Job("File copy", 3, 400);
scan.start();
copy.start();
scan.join(); // wait for both to end
copy.join();
System.out.println("Both jobs finished");
}
}
File copy step 1 File copy step 2 Virus scan step 1 File copy step 3 Virus scan step 2 Both jobs finished
Is the order always this? No. It depends on the pauses and the machine; only the last line is certain, because join() makes main wait.
To split a line of text and convert its parts with wrapper classes.
// Program 15: strings and wrapper classes on one line of stock
public class StockLine {
public static void main(String[] args) {
String line = " pen drive, 12 ,349.50,y ";
String[] part = line.trim().split(",");
String item = part[0].toUpperCase();
Integer quantity = Integer.valueOf(part[1].trim());
double rate = Double.parseDouble(part[2]);
char flag = part[3].charAt(0);
boolean inStock = Character.toUpperCase(flag) == 'Y';
System.out.println("Item : " + item);
String joined = item.replace(" ", "");
System.out.println("Letters : " + joined.length());
System.out.println("First 3 : " + item.substring(0, 3));
System.out.println("Quantity : " + (quantity + 1)
+ " with sample");
System.out.println("Value : " + quantity * rate);
System.out.println("In stock : " + inStock);
System.out.println("Binary : "
+ Integer.toBinaryString(quantity));
}
}
Item : PEN DRIVE Letters : 8 First 3 : PEN Quantity : 13 with sample Value : 4194.0 In stock : true Binary : 1100
Why trim part[1]? Integer.valueOf(" 12 ") throws a NumberFormatException because of the spaces. Adding 1 to the Integer unboxes it to an int automatically.
A file can hold more than 15. If you want spare entries on a different subject matter, or the notes behind each topic, use Java notes and 20 more programs for IT 802. For string practice beyond the syllabus there are 33 string and array programs in Java on the blog.
Q4. Which queries go in?
Two related tables are enough for all fifteen: EQUIPMENT, one row per machine in a school, and REPAIR, one row per job done on it. The queries were run in this order on MySQL 26, so later results include earlier changes.
Create a database for the lab and open it.
CREATE DATABASE itlab; USE itlab;
Query OK, 1 row affected Database changed
USE must be given again each time MySQL is opened.
Create the table EQUIPMENT and show its structure.
CREATE TABLE Equipment ( EqNo INT PRIMARY KEY, EqName VARCHAR(20) NOT NULL, Lab CHAR(2), Price DECIMAL(9,2), BoughtOn DATE ); DESC Equipment;
Query OK, 0 rows affected +----------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+-------+ | EqNo | int | NO | PRI | NULL | | | EqName | varchar(20) | NO | | NULL | | | Lab | char(2) | YES | | NULL | | | Price | decimal(9,2) | YES | | NULL | | | BoughtOn | date | YES | | NULL | | +----------+--------------+------+-----+---------+-------+ 5 rows in set
PRI under Key marks the primary key, which also becomes NOT NULL.
Create the table REPAIR so that every repair belongs to a machine in EQUIPMENT.
CREATE TABLE Repair ( RepNo INT PRIMARY KEY, EqNo INT, Problem VARCHAR(25) NOT NULL, Cost DECIMAL(8,2), Status VARCHAR(8) DEFAULT 'Open', FOREIGN KEY (EqNo) REFERENCES Equipment(EqNo) );
Query OK, 0 rows affected
The parent table has to exist first, so EQUIPMENT was made before REPAIR.
Insert six machines and display the table.
INSERT INTO Equipment VALUES (101, 'Laser Printer', 'L1', 14500.00, '2022-07-18'), (102, 'Projector', 'L2', 32000.00, '2021-04-05'), (103, 'Desktop PC', 'L1', 41500.00, '2023-01-12'), (104, 'Desktop PC', 'L2', 39900.00, '2022-11-30'), (105, 'Scanner', 'L3', 6800.00, '2024-06-21'), (106, 'Network Switch', NULL, 5200.00, '2023-09-08'); SELECT * FROM Equipment;
Query OK, 6 rows affected Records: 6 Duplicates: 0 Warnings: 0 +------+----------------+------+----------+------------+ | EqNo | EqName | Lab | Price | BoughtOn | +------+----------------+------+----------+------------+ | 101 | Laser Printer | L1 | 14500.00 | 2022-07-18 | | 102 | Projector | L2 | 32000.00 | 2021-04-05 | | 103 | Desktop PC | L1 | 41500.00 | 2023-01-12 | | 104 | Desktop PC | L2 | 39900.00 | 2022-11-30 | | 105 | Scanner | L3 | 6800.00 | 2024-06-21 | | 106 | Network Switch | NULL | 5200.00 | 2023-09-08 | +------+----------------+------+----------+------------+ 6 rows in set
Dates and text go in quotes; NULL does not, because it is not text.
Insert repairs, the last one without a cost or status.
INSERT INTO Repair VALUES (1, 101, 'Paper jam', 350.00, 'Done'), (2, 103, 'No display', 2100.00, 'Done'), (3, 104, 'Noisy fan', 600.00, 'Open'), (4, 101, 'Faded print', 1250.00, 'Open'); INSERT INTO Repair (RepNo, EqNo, Problem) VALUES (5, 102, 'Lamp not working'); SELECT * FROM Repair;
Query OK, 4 rows affected Records: 4 Duplicates: 0 Warnings: 0 Query OK, 1 row affected +-------+------+------------------+---------+--------+ | RepNo | EqNo | Problem | Cost | Status | +-------+------+------------------+---------+--------+ | 1 | 101 | Paper jam | 350.00 | Done | | 2 | 103 | No display | 2100.00 | Done | | 3 | 104 | Noisy fan | 600.00 | Open | | 4 | 101 | Faded print | 1250.00 | Open | | 5 | 102 | Lamp not working | NULL | Open | +-------+------+------------------+---------+--------+ 5 rows in set
The status of repair 5 came from DEFAULT; its cost became NULL.
List machines priced from 6000 to 35000.
SELECT EqName, Price FROM Equipment WHERE Price BETWEEN 6000 AND 35000;
+---------------+----------+ | EqName | Price | +---------------+----------+ | Laser Printer | 14500.00 | | Projector | 32000.00 | | Scanner | 6800.00 | +---------------+----------+ 3 rows in set
BETWEEN includes both end values.
List machines whose name ends in "or", or that are in lab L3.
SELECT EqNo, EqName FROM Equipment
WHERE EqName LIKE '%or' OR Lab IN ('L3');
+------+-----------+ | EqNo | EqName | +------+-----------+ | 102 | Projector | | 105 | Scanner | +------+-----------+ 2 rows in set
The per cent sign stands for any number of characters. The scanner is here because of its lab.
Find the machine with no lab, and the repair with no cost.
SELECT EqNo, EqName FROM Equipment WHERE Lab IS NULL; SELECT RepNo, Problem FROM Repair WHERE Cost IS NULL;
+------+----------------+ | EqNo | EqName | +------+----------------+ | 106 | Network Switch | +------+----------------+ 1 row in set +-------+------------------+ | RepNo | Problem | +-------+------------------+ | 5 | Lamp not working | +-------+------------------+ 1 row in set
NULL is tested with IS, never with the equals sign.
List each kind of machine once; then sort by name, dearest first within a name.
SELECT DISTINCT EqName FROM Equipment; SELECT EqName, Lab, Price FROM Equipment ORDER BY EqName, Price DESC;
+----------------+ | EqName | +----------------+ | Laser Printer | | Projector | | Desktop PC | | Scanner | | Network Switch | +----------------+ 5 rows in set +----------------+------+----------+ | EqName | Lab | Price | +----------------+------+----------+ | Desktop PC | L1 | 41500.00 | | Desktop PC | L2 | 39900.00 | | Laser Printer | L1 | 14500.00 | | Network Switch | NULL | 5200.00 | | Projector | L2 | 32000.00 | | Scanner | L3 | 6800.00 | +----------------+------+----------+ 6 rows in set
DESC applies only to the column before it, so the names are still A to Z.
Give the switch a lab and add 100 to the cost of every open repair.
UPDATE Equipment SET Lab = 'L3' WHERE EqNo = 106; UPDATE Repair SET Cost = Cost + 100 WHERE Status = 'Open'; SELECT RepNo, Cost, Status FROM Repair;
Query OK, 1 row affected Rows matched: 1 Changed: 1 Warnings: 0 Query OK, 2 rows affected Rows matched: 3 Changed: 2 Warnings: 0 +-------+---------+--------+ | RepNo | Cost | Status | +-------+---------+--------+ | 1 | 350.00 | Done | | 2 | 2100.00 | Done | | 3 | 700.00 | Open | | 4 | 1350.00 | Open | | 5 | NULL | Open | +-------+---------+--------+ 5 rows in set
Three rows matched, two changed: a NULL cost stays NULL.
Add a column for the date of repair, make PROBLEM wider, and fill one date.
ALTER TABLE Repair ADD RepairedOn DATE; ALTER TABLE Repair MODIFY Problem VARCHAR(40) NOT NULL; UPDATE Repair SET RepairedOn = '2026-08-14' WHERE RepNo = 1; DESC Repair;
Query OK, 0 rows affected Records: 0 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected Records: 0 Duplicates: 0 Warnings: 0 Query OK, 1 row affected Rows matched: 1 Changed: 1 Warnings: 0 +------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+-------+ | RepNo | int | NO | PRI | NULL | | | EqNo | int | YES | MUL | NULL | | | Problem | varchar(40) | NO | | NULL | | | Cost | decimal(8,2) | YES | | NULL | | | Status | varchar(8) | YES | | Open | | | RepairedOn | date | YES | | NULL | | +------------+--------------+------+-----+---------+-------+ 6 rows in set
ALTER changes the structure, UPDATE changes the content. MUL under Key appears because MySQL indexes the foreign key column.
Count the repairs and find the total, average, lowest and highest cost.
SELECT COUNT(*), COUNT(Cost), SUM(Cost) FROM Repair; SELECT AVG(Cost), MIN(Cost), MAX(Cost) FROM Repair;
+----------+-------------+-----------+ | COUNT(*) | COUNT(Cost) | SUM(Cost) | +----------+-------------+-----------+ | 5 | 4 | 4500.00 | +----------+-------------+-----------+ 1 row in set +-------------+-----------+-----------+ | AVG(Cost) | MIN(Cost) | MAX(Cost) | +-------------+-----------+-----------+ | 1125.000000 | 350.00 | 2100.00 | +-------------+-----------+-----------+ 1 row in set
COUNT(Cost) leaves out the NULL. The average is 4500 / 4, not 4500 / 5.
Show the number of machines and their total price in each lab.
SELECT Lab, COUNT(*) AS Items, SUM(Price) AS Value FROM Equipment GROUP BY Lab ORDER BY Lab;
+------+-------+----------+ | Lab | Items | Value | +------+-------+----------+ | L1 | 2 | 56000.00 | | L2 | 2 | 71900.00 | | L3 | 2 | 12000.00 | +------+-------+----------+ 3 rows in set
Every column in SELECT is either grouped or inside an aggregate function.
List machines repaired more than once with the money spent on them.
SELECT EqNo, COUNT(*) AS Repairs, SUM(Cost) AS Spent FROM Repair GROUP BY EqNo HAVING COUNT(*) > 1;
+------+---------+---------+ | EqNo | Repairs | Spent | +------+---------+---------+ | 101 | 2 | 1700.00 | +------+---------+---------+ 1 row in set
HAVING checks the group after counting; WHERE cannot use COUNT(*).
Show the machine, lab, problem and cost of every open repair.
SELECT E.EqName, E.Lab, R.Problem, R.Cost FROM Equipment E, Repair R WHERE E.EqNo = R.EqNo AND R.Status = 'Open' ORDER BY R.RepNo;
+---------------+------+------------------+---------+ | EqName | Lab | Problem | Cost | +---------------+------+------------------+---------+ | Desktop PC | L2 | Noisy fan | 700.00 | | Laser Printer | L1 | Faded print | 1350.00 | | Projector | L2 | Lamp not working | NULL | +---------------+------+------------------+---------+ 3 rows in set
The condition E.EqNo = R.EqNo is the join. Without it every machine would pair with every repair.
Spare entry. Remove machine 103 from both tables.
DELETE FROM Repair WHERE EqNo = 103; DELETE FROM Equipment WHERE EqNo = 103; SELECT COUNT(*) FROM Equipment;
Query OK, 1 row affected Query OK, 1 row affected +----------+ | COUNT(*) | +----------+ | 5 | +----------+ 1 row in set
Deleting the machine first fails with error 1451, since a repair still refers to it. The child row goes first.
An older MySQL in the school lab may print int(11) where this page shows int. That is a display habit of the version and changes nothing in the table. More join and grouping practice, on the same syntax, is in our Class 12 SQL queries.
Q5. What should the project be?
The syllabus allows any application made in NetBeans, so choose a small one you can finish and explain. This example bills a computer repair: a form takes the customer, service, units and type of visit, and prints the amount.
It also touches Unit 2, where the syllabus lists an online bill calculator as a case study. The trick that keeps it manageable is to split it in two: a class that knows the rules and a form that only reads boxes and shows text. The rules can then be tested before any button exists.
In NetBeans create a Java Application project named RepairShop. Add a Java class RepairBill and type the rules below.
Add TestBill, run it, and paste the output into the project file as your test evidence. Two good bills, one blank name, one impossible quantity.
Add a JFrame Form named BillForm. Drag the controls in the table from the palette and rename each variable before writing any code. Put both radio buttons in one button group.
Double click each button and NetBeans opens its method. The bodies are given below; the rest of the file is generated for you.
New services, a late fee, a second combo box, a counter of bills made today. The viva is about what you changed.
// RepairBill.java: the rules of the bill, no form code here
public class RepairBill {
static final String[] SERVICE = {"Screen change",
"Keyboard change", "System reinstall", "Virus removal"};
static final double[] RATE = {2500, 900, 600, 400};
static final double VISIT = 150; // home visit charge
private String customer;
private int service; // index in SERVICE
private int units;
private boolean home;
private boolean member;
public RepairBill(String customer, int service, int units,
boolean home, boolean member) {
if (customer.trim().length() == 0) {
throw new IllegalArgumentException("Type the customer name");
}
if (units < 1 || units > 10) {
throw new IllegalArgumentException("Units must be 1 to 10");
}
this.customer = customer.trim();
this.service = service;
this.units = units;
this.home = home;
this.member = member;
}
public double subTotal() {
return RATE[service] * units;
}
public double visitCharge() {
return home ? VISIT : 0;
}
public double discount() { // members get 10%
return member ? subTotal() * 10 / 100 : 0;
}
public double payable() {
return subTotal() + visitCharge() - discount();
}
public String text() {
return customer + "\n" + SERVICE[service] + " x " + units
+ " = " + subTotal()
+ "\nVisit " + visitCharge()
+ "\nDiscount " + discount()
+ "\nPayable Rs " + payable();
}
}
// TestBill.java: checks the rules before the form is made
public class TestBill {
static void check(String name, int service, int units,
boolean home, boolean member) {
try {
RepairBill b = new RepairBill(name, service, units,
home, member);
System.out.println(b.text());
} catch (IllegalArgumentException e) {
System.out.println("Refused: " + e.getMessage());
}
System.out.println();
}
public static void main(String[] args) {
check("Harleen", 1, 2, true, true);
check("Dev", 0, 1, false, false);
check(" ", 2, 1, false, false);
check("Tara", 3, 11, true, false);
}
}
Harleen Keyboard change x 2 = 1800.0 Visit 150.0 Discount 180.0 Payable Rs 1770.0 Dev Screen change x 1 = 2500.0 Visit 0.0 Discount 0.0 Payable Rs 2500.0 Refused: Type the customer name Refused: Units must be 1 to 10
| Control | Variable name | Property to set |
|---|---|---|
| jTextField | txtName, txtUnits | text empty |
| jComboBox | cmbService | model: Screen change, Keyboard change, System reinstall, Virus removal, in this order |
| jRadioButton, two | rdoHome, rdoShop | same buttonGroup; rdoShop selected |
| jCheckBox | chkMember | text Member |
| jButton, three | btnBill, btnClear, btnExit | text Make bill, Clear, Exit |
| jTextArea | txaBill | editable off |
| jLabel | lblMessage | a space as text; error messages appear here |
private void btnBillActionPerformed(java.awt.event.ActionEvent evt) {
lblMessage.setText(" ");
try {
int units = Integer.parseInt(txtUnits.getText().trim());
RepairBill b = new RepairBill(txtName.getText(),
cmbService.getSelectedIndex(), units,
rdoHome.isSelected(), chkMember.isSelected());
txaBill.setText(b.text());
} catch (NumberFormatException e) {
lblMessage.setText("Units must be a number");
} catch (IllegalArgumentException e) {
lblMessage.setText(e.getMessage());
}
}
private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {
txtName.setText("");
txtUnits.setText("");
cmbService.setSelectedIndex(0);
rdoShop.setSelected(true);
chkMember.setSelected(false);
txaBill.setText("");
lblMessage.setText(" ");
txtName.requestFocus();
}
private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
We compiled this with Java 21 and fired each button from a test: a good bill printed the same text as TestBill, "two" in the units box gave "Units must be a number", 11 gave "Units must be 1 to 10", and Clear emptied the form.
Cover, certificate and acknowledgement; one page on the problem and who uses the application; hardware and software used; the form with its controls; code of both classes; test cases with output; limits of the program; what you would add next; books and sites you used. Connecting the form to a MySQL table is optional extra work: the 802 syllabus does not name Java database connectivity. Other directions are in 25 Java project ideas.
Q6. What will the lab test feel like?
The pattern is fixed by the syllabus: one Java program, then a table and five queries on it. The questions are chosen at the school, so practise the shape with several topics rather than memorising one answer.
book(int n) that refuses more than the free seats.Say the plan aloud first: inputs, the one line that does the work, output. In our classes the student writes it on a shared screen while the teacher stays silent, and the marking comes after.
Create WORKSHOP with the structure and rows shown, then write queries for:
CREATE TABLE Workshop (
WId CHAR(3) PRIMARY KEY,
Title VARCHAR(20) NOT NULL,
Trainer VARCHAR(15),
Fee DECIMAL(6,2),
Seats INT
);
INSERT INTO Workshop VALUES
('W01', 'Network Basics', 'Ishaan', 400, 30),
('W02', 'Safe Passwords', 'Leela', 150, 45),
('W03', 'Printer Care', 'Ishaan', 250, 20),
('W04', 'Spreadsheets', 'Noor', 300, 35);
SELECT Title, Fee FROM Workshop WHERE Seats > 25 AND Fee < 350;
SELECT Title FROM Workshop WHERE Title LIKE '%s';
SELECT Trainer, COUNT(*), SUM(Seats) FROM Workshop GROUP BY Trainer ORDER BY Trainer;
UPDATE Workshop SET Fee = Fee * 1.10 WHERE Trainer = 'Ishaan';
SELECT WId, Fee FROM Workshop;
SELECT Title, Fee * Seats AS FullHouse FROM Workshop ORDER BY FullHouse DESC;
+----------------+--------+ | Title | Fee | +----------------+--------+ | Safe Passwords | 150.00 | | Spreadsheets | 300.00 | +----------------+--------+ 2 rows in set +----------------+ | Title | +----------------+ | Network Basics | | Safe Passwords | | Spreadsheets | +----------------+ 3 rows in set +---------+----------+------------+ | Trainer | COUNT(*) | SUM(Seats) | +---------+----------+------------+ | Ishaan | 2 | 50 | | Leela | 1 | 45 | | Noor | 1 | 35 | +---------+----------+------------+ 3 rows in set Query OK, 2 rows affected Rows matched: 2 Changed: 2 Warnings: 0 +-----+--------+ | WId | Fee | +-----+--------+ | W01 | 440.00 | | W02 | 150.00 | | W03 | 275.00 | | W04 | 300.00 | +-----+--------+ 4 rows in set +----------------+-----------+ | Title | FullHouse | +----------------+-----------+ | Network Basics | 13200.00 | | Spreadsheets | 10500.00 | | Safe Passwords | 6750.00 | | Printer Care | 5500.00 | +----------------+-----------+ 4 rows in set
A written paper in the same style is on the IT 802 sample paper page.
Q7. What will the examiner ask?
The viva carries 5 marks and no official question list exists. These 24 are the ones this file naturally leads to. Answer in one sentence, then point at the line.
javac writes in a .class file. The JVM on any machine runs it, which is why Java is called platform independent.rest would be the full total, so the minutes would come out as 67 for 4075 seconds.-ea.start() creates a new thread and calls run() in it. Calling run() directly is an ordinary method call.EqNo is the primary key of EQUIPMENT and a foreign key in REPAIR, so a repair cannot name a machine that is not there.Cost IS NULL.Integer.parseInt() converts it.Revise definitions from the IT 802 notes. Then ask someone to open your file at any page and begin with "why". That is how the viva is rehearsed in a one to one class.
One to one, at your own timing
There are two ways to see a class first. The priority demo is a paid full live class at the slot you want, followed by a written skill report, and the fee comes off your first month if you enrol. The other is a free demo class. After that, classes are one to one, with your family choosing the days and the hour.
Before you enrol · Try a class
a full live class of about 45 to 60 minutes
The classes · Choose your own timing
₹4,999
per month, 4 private classes, fully flexible timingtwo private classes a week, at a time set with you
Tell us the date your school wants the file and the date of the practical, if you know them. A student with neither half started needs a different month from one whose project is the only thing left. Your fee is shown above.
Studying outside India?
Schools that offer 802 abroad use the same 40-mark practical and the same NetBeans and MySQL. Find the hours that usually work where you live.
| 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 |
If your school’s lab still uses an older JDK, say so at the demo: none of the fifteen programs needs a new Java feature. Students still deciding on a subject can compare them on CS, IP, AI and IT in Class 11.
What families say
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
Every page in the CBSE Class 12 Information Technology series, grouped by what you need.
CBSE Class 12 Computer Science (083): Class 12 CS viva questions Class 12 CS sample paper practice Class 12 CS project with source code Class 12 CS important questions
CBSE Class 12 Informatics Practices (065): Class 12 IP practical file Class 12 IP project with source code Class 12 IP sample paper practice Class 12 IP important questions
CBSE Class 11 CS, IP and AI: Class 11 CS practical file Class 11 IP practical file CS or IP in Class 11
ISC Computer Science (868): ISC Class 12 CS syllabus 2027 ISC Class 12 CS practice paper ISC Class 12 practical questions solved ISC Boolean algebra and K-maps
Program lists with output: String and array programs in Java Java project ideas
Practical and project questions
The 2026-27 curriculum says the practical file must contain a minimum of 15 Java programs and a minimum of 15 queries in MySQL. The file is worth 10 marks. Writing one or two more in each half is sensible, because an entry the teacher rejects then does not bring you under the minimum.
Project work is 5 marks, and the curriculum describes it as any application made using Java NetBeans IDE. A bill calculator, a quiz, a fee register or a small stock form all qualify. Pick something with a form, at least one decision and one check on wrong input, so that you have something to explain.
You can save this page with your browser: choose Print, then Save as PDF. Treat it as a reference. The file you submit needs your own names, data and output, because the practical includes a viva and a lab test in which you write a fresh program and fresh queries.
Prepare one program for each topic of Unit 3: language elements, operators, control flow, arrays, class design, inheritance, exception handling, assertions, threads, wrapper classes and strings. The fifteen on this page are arranged that way. Schools set the lab question, so no list can tell you the exact program.
The syllabus says table creation and 5 queries, for 10 marks. Expect a CREATE TABLE with a primary key, rows to insert, and then conditions, ordering, grouping with aggregate functions, an update or alter, and perhaps two tables. This page has a practice set with results.
No such rule appears in the 802 curriculum. The Class 12 units do not name Java database connectivity, and the project line asks only for an application made in NetBeans. If your teacher wants a connected project, follow the teacher; otherwise a form with tested rules is enough.
For the practical file programs the code is the same anywhere. For the project the curriculum names Java NetBeans IDE, so build it there. Learning the NetBeans screen also helps in the lab, where your school will have it installed.
CBSE does not publish a list. Questions usually begin from your own file: why a line is there, what changes if it is removed, what the output would be for another input. Prepare the difference between start and run, WHERE and HAVING, overloading and overriding, and be honest about the limits of your project.
CBSE has scheduled practical, project and internal assessment from 1 January 2027 for the 2026-27 session; winter-bound schools have 9 November to 19 December 2026. The exact day is set by each school. The 802 theory paper is on 31 March 2027.
Yes. In Class 11 the practical file carries 5 marks and the practical work includes office automation tools for 15 marks, Java 10 and MySQL 5. In Class 12 the file carries 10 marks, office tools drop out, and Java and SQL carry 10 marks each.
We do not write projects or files for students, and a project you did not write is hard to defend in the viva. In a one to one class your child writes the code, the teacher asks questions and corrects the thinking. A priority demo or the free demo is the way to see how that feels.
Start
Send the list of entries you have finished, or say that you have none. In the demo class your child runs one Java program and one query, explains both, and we list what the file, the project and the lab test still need before your school’s date.
If that date is near, the priority demo is the quicker route: pick the slot, take a full class, receive the written skill report, and have the fee adjusted against the first month if you enrol.
WhatsApp us · +91 91233 66161 · connect@modernagecoders.com
Every class is live video. The form requests a callback and reserves nothing.
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