Class 10 IT Practical File 2025 – 2026
1. Introduction to MySQL
MySQL is one of the most widely used Relational Database Management Systems (RDBMS) in the world. It is an open source software developed initially by MySQL AB, a Swedish company, and later acquired by Oracle Corporation.
MySQL is popular for its speed, reliability, flexibility, and ease of use. It supports multiuser access and handles large volumes of data efficiently, making it ideal for both smallscale and largescale applications. MySQL forms the database backbone for many dynamic websites and webbased applications, including wellknown platforms such as Facebook, YouTube, Twitter, and WordPress.
What is a Database?
A database is an organized collection of data that can be easily accessed, managed, and updated. In a digital world, databases are essential for storing and managing large amounts of information systematically.
In MySQL, data is stored in tables, which are structured in rows and columns.
- Rows (records) represent individual entries.
- Columns (fields) represent attributes or properties of the data.
For example, a “Students” table may have columns like RollNo, Name, Class, and Marks, and each row will contain data for one student.
Features of MySQL
- Open Source and Free: MySQL is opensource, meaning its source code is freely available. Users can modify it according to their requirements.
- Relational Database Model: It organizes data in tables that can be related to each other using keys (Primary Key and Foreign Key).
- Portability: MySQL runs on various operating systems, including Windows, Linux, macOS, and UNIX.
- Scalability: It can handle small applications as well as large enterprise systems efficiently.
- Security: MySQL provides a secure environment with user privileges, password encryption, and host based verification.
- Speed and Performance: It is optimized for quick data retrieval, insertion, and transaction management.
- Connectivity: It supports multiple programming languages such as PHP, Java, Python, and C++.
- Data Integrity: MySQL ensures the accuracy and consistency of data through constraints, transactions, and normalization.
- Replication and Backup: It allows data replication and backup for fault tolerance and disaster recovery.
- Support for Transactions: Using ACID (Atomicity, Consistency, Isolation, Durability) properties, MySQL ensures safe and reliable transactions.
MySQL Architecture
The architecture of MySQL consists of several key components that work together to process SQL queries and manage data efficiently:
a. Client Layer:
The top layer that interacts with users or applications.
Clients send SQL commands (queries) to the MySQL server and receive responses.
b. SQL Layer:
Responsible for parsing, optimizing, and executing SQL queries.
It includes components like query parser, optimizer, and cache.
c. Storage Engine Layer:
The layer that manages how data is stored, retrieved, and updated.
MySQL supports multiple storage engines such as InnoDB, MyISAM, and Memory, each suited for different types of workloads.
d. File System Layer:
Responsible for physical data storage on disk, including table files, indexes, and logs.
MySQL Data Types
MySQL supports several data types to define the nature of data stored in each column:
Numeric Data Types: INT, FLOAT, DOUBLE, DECIMAL
Character Data Types: CHAR, VARCHAR, TEXT
Date and Time Data Types: DATE, TIME, DATETIME, YEAR
Boolean Data Type: BOOLEAN or TINYINT(1)
Binary Data Types: BLOB, BIT
Applications of MySQL
- Web Applications: Websites like WordPress and Joomla use MySQL as their database.
- ECommerce Systems: Platforms such as Magento and Shopify rely on MySQL for handling transactions.
- Banking and Finance: To manage customer records and transactions securely.
- Education and Research: For managing student data and academic resources.
- Data Warehousing and Analytics: MySQL can handle large datasets efficiently for analytical tasks.
Advantages of MySQL
- Easy to install and use.
- High performance and scalability.
- Excellent security features.
- Compatible with multiple programming environments.
Limitations of MySQL
Limited for extremely large enterprise systems compared to some proprietary databases.
Advanced features like stored procedures and triggers are less efficient than in Oracle or PostgreSQL.
No builtin support for full ACID transactions in older storage engines like MyISAM.
2. SQL Commands
SQL (Structured Query Language) is the standard language used to communicate with Relational Database Management Systems (RDBMS) such as MySQL, Oracle, SQL Server, and PostgreSQL. It allows users to create, manage, and manipulate databases. SQL is both declarative and powerful, meaning you describe what you want to do with the data, and the database decides how to do it efficiently.
SQL commands are broadly categorized into four types, based on their purpose:
1. DDL (Data Definition Language)
2. DML (Data Manipulation Language)
3. DCL (Data Control Language)
4. TCL (Transaction Control Language)
i. Data Definition Language (DDL)
DDL commands are used to define and modify the structure of a database and its objects, such as tables, schemas, indexes, and views. These commands affect the schema (structure) of the database rather than the data itself.
a) CREATE Command: Used to create new databases or database objects (like tables, views, etc.).
Example:
CREATE DATABASE School;
USE School;
CREATE TABLE Student (
RollNo INT PRIMARY KEY,
Name VARCHAR(50),
Age INT,
Marks INT
);
This command creates a database named School and a table Student with four columns.
b) ALTER Command: It is used to modify the structure of an existing table — such as adding, deleting, or renaming columns.
Examples:
ALTER TABLE Student ADD COLUMN Gender VARCHAR(10);
ALTER TABLE Student MODIFY COLUMN Name VARCHAR(100);
ALTER TABLE Student DROP COLUMN Marks;
c) DROP Command: It is used to permanently delete a database or table, including all its data.
Example:
DROP TABLE Student;
d) TRUNCATE Command: It is used to delete all rows from a table but keep its structure intact.
Example:
TRUNCATE TABLE Student;
ii. Data Manipulation Language (DML)
DML commands are used to manipulate data stored in tables — that is, inserting, updating, and deleting data. These operations directly affect the content of the database.
a) INSERT Command: It is used to add new records (rows) to a table.
Examples:
INSERT INTO Student VALUES (1, ‘Amit’, 16, 88);
INSERT INTO Student (RollNo, Name, Marks) VALUES (2, ‘Priya’, 92);
b) UPDATE Command: It is used to modify existing records in a table.
Examples:
UPDATE Student SET Marks = 95 WHERE RollNo = 2;
UPDATE Student SET Age = Age + 1;
c) DELETE Command: It is used to remove specific records from a table.
Examples:
DELETE FROM Student WHERE RollNo = 1;
DELETE FROM Student;
d) SELECT Command: It is used to extract data from one or more tables.
Examples:
SELECT FROM Student; all columns
SELECT Name, Marks FROM Student; specific columns
SELECT FROM Student WHERE Marks > 80;
SELECT DISTINCT Age FROM Student; remove duplicates
SQL allows several clauses to refine query results:
WHERE → Filters rows based on conditions.
ORDER BY → Sorts results in ascending (ASC) or descending (DESC) order.
GROUP BY → Groups rows that have the same values in specified columns.
HAVING → Filters results of grouped data (used with aggregate functions).
Example:
SELECT Age, COUNT()
FROM Student
GROUP BY Age
HAVING COUNT() > 1
ORDER BY Age DESC;
iii. Data Control Language (DCL)
DCL commands are used to control access and permissions to the database objects. These are crucial for database security and multiuser environments.
a) GRANT Command: It is used to provide privileges to users.
Example:
GRANT SELECT, INSERT ON School. TO ‘user1’@’localhost’;
This allows user1 to select and insert data into all tables of the School database.
b) REVOKE Command: It is used to remove privileges previously granted to users.
Example:
REVOKE INSERT ON School. FROM ‘user1’@’localhost’;
Now, user1 cannot insert data but can still read data.
iv. Transaction Control Language (TCL)
TCL commands are used to manage transactions in a database.
a) COMMIT: It saves all changes made during the current transaction permanently to the database.
Example:
UPDATE Student SET Marks = 90 WHERE RollNo = 2;
COMMIT;
b) ROLLBACK: It Undoes the changes made in the current transaction before a commit.
Example:
DELETE FROM Student WHERE Marks < 50;
ROLLBACK;
c) SAVEPOINT: It creates intermediate points within a transaction to which you can roll back later.
Example:
SAVEPOINT A;
UPDATE Student SET Marks = 75 WHERE RollNo = 3;
ROLLBACK TO A;
3. Introduction to Java
Java is one of the most popular and powerful programming languages in the world. It was developed by James Gosling and his team at Sun Microsystems in 1995, and later acquired by Oracle Corporation. Java is a highlevel, object oriented, platform independent, and secure programming language widely used for developing web applications, mobile apps, desktop software, and enterprise solutions.
Java has multiple editions for different domains:
Java SE (Standard Edition) – for general purpose desktop applications.
Java EE (Enterprise Edition) – for largescale, distributed, web based applications.
Java ME (Micro Edition) – for mobile and embedded systems.
JavaFX – for building rich internet applications with graphical interfaces.
Features of Java
1. Simple:
Java’s syntax is similar to C and C++, making it easy for programmers to learn and use.
2. ObjectOriented:
Everything in Java revolves around objects and classes. It supports concepts like inheritance, encapsulation, abstraction, and polymorphism.
3. Platform Independent:
Java programs are compiled into bytecode, which runs on the JVM. This makes Java programs portable across different operating systems like Windows, macOS, and Linux.
4. Robust and Secure:
Java provides strong memory management, exception handling, and security features such as the absence of pointers and the use of the security manager.
5. Multithreaded:
Java supports multithreading, allowing concurrent execution of two or more parts of a program, enhancing performance.
6. Portable and Distributed:
Java enables communication between computers through RMI (Remote Method Invocation) and Sockets, making it suitable for networked applications.
7. High Performance:
Java uses JustInTime (JIT) compilation to convert bytecode into native machine code at runtime, improving speed.
Java Architecture
The Java architecture is based on three main components:
1. Java Compiler: Converts source code (`.java`) into bytecode (`.class` file).
2. Java Virtual Machine (JVM): Executes bytecode on any platform.
3. Java Runtime Environment (JRE): Provides the libraries and components needed to run Java applications.
This architecture ensures that Java remains platform independent and secure.
Applications of Java
- Java is used in a wide range of domains, such as:
- Web Development (using Spring, Hibernate)
- Mobile Applications (Android development)
- Desktop GUI Applications (Swing, JavaFX)
- Scientific and Financial Systems
- Big Data and Cloud Computing
- Artificial Intelligence and Machine Learning
4. Program to Print Hello World
class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
7. Program for Different Arithmetic Operators
class Arithmetic
{
public static void main(String[] args)
{
int a = 10, b = 5;
System.out.println("Addition: " + (a + b));
System.out.println("Subtraction: " + (a b));
System.out.println("Multiplication: " + (a b));
System.out.println("Division: " + (a / b));
System.out.println("Modulus: " + (a % b));
}
}
8. Program for Changing Temperature from Fahrenheit to Celsius
class Temp
{
public static void main(String[] args)
{
double f = 98.6;
double c = (f 32) 5 / 9;
System.out.println("Celsius: " + c);
}
}
9. Program to Reverse a Number
import java.util.Scanner;
class ReverseNumber {
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = sc.nextInt();
int rev = 0;
while (num != 0)
{
int digit = num % 10;
rev = rev 10 + digit;
num /= 10;
}
System.out.println("Reversed number: " + rev);
sc.close();
}
}
10. Java Program for Fibonacci Series
class Fibonacci
{
public static void main(String[] args) {
int a=0,b=1,c;
System.out.print(a + " " + b);
for(int i=2;i<10;i++)
{
c=a+b;
System.out.print(" " + c);
a=b;
b=c;
}
}
}
11. Program to check whether a number is even or odd using if else statement.
class IfElse
{
public static void main(String[] args)
{
int n = 10;
if(n%2==0)
System.out.println("Even number");
else
System.out.println("Odd number");
}
}
12. Program to print numbers from 1 to 5 using While Loop.
class WhileLoop {
public static void main(String[] args) {
int i=1;
while(i<=5)
{
System.out.println(i);
i++;
}
}
}
13. Program to display odd numbers from 1 to 19 using do while Loop.
class DoWhile
{
public static void main(String[] args)
{
int i=1;
do
{
System.out.println(i);
i+=2;
}while(i<=19);
}
}
14. Program to print table of a number using for Loop.
import java.util.Scanner;
class Table
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number: ");
int num = sc.nextInt();
System.out.println("Multiplication Table of " + num + ":");
for(int i = 1; i <= 10; i++)
{
System.out.println(num + " x " + i + " = " + (num i));
}
sc.close();
}
}
15. Program to print day of week using switch Statement.
import java.util.Scanner;
class SwitchStatement
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a day number (17): ");
int day = sc.nextInt();
switch(day)
{
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
case 3:
System.out.println("Wednesday");
break;
case 4:
System.out.println("Thursday");
break;
case 5:
System.out.println("Friday");
break;
case 6:
System.out.println("Saturday");
break;
case 7:
System.out.println("Sunday");
break;
default:
System.out.println("Invalid day number!");
}
sc.close();
}
}
16. Java Program for Adding Field to Class and Creating Object
class Student
{
// Fields
String name;
int age;
String course;
public static void main(String[] args)
{
Student s1 = new Student();
s1.name = "Rohit Sharma";
s1.age = 20;
s1.course = "Computer Science";
System.out.println("Student Details:");
System.out.println("Name: " + s1.name);
System.out.println("Age: " + s1.age);
System.out.println("Course: " + s1.course);
}
}
17. Java Program for Array Declaration and Initialization
class Array
{
public static void main(String[] args)
{
int numbers[] = {10, 20, 30, 40, 50};
System.out.println("Array Elements:");
for (int i = 0; i < numbers.length; i++)
{
System.out.println(numbers[i]);
}
}
}
18. Program to read and display a two dimensional array.
import java.util.Scanner;
class TwoDArray
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.print("Enter number of rows: ");
int rows = sc.nextInt();
System.out.print("Enter number of columns: ");
int cols = sc.nextInt();
int[][] arr = new int[rows][cols];
System.out.println("Enter elements of the array:");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
arr[i][j] = sc.nextInt();
}
}
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < cols; j++)
{
System.out.print(arr[i][j] + " ") ;
}
System.out.println();
}
sc.close();
}
}
19. Program to Print a String.
class PrintString
{
public static void main(String[] args)
{
String str = "Java Programming";
System.out.println(str);
}
}
20. Program to Find Length of a String.
class StringLength
{
public static void main(String[] args)
{
String str = "Hello";
System.out.println("Length: " + str.length());
}
}
21. Program to Concatenate Two Strings
class Concat
{
public static void main(String[] args)
{
String a = "Hello ";
String b = "World";
System.out.println(a.concat(b));
}
}
22. Program to Convert Uppercase string value into Lowercase
class Lowercase
{
public static void main(String[] args)
{
String s = "HELLO WORLD";
System.out.println(s.toLowerCase());
}
}