Practical File-Class XII
Practical File-Class XII
Practical File
Information Technology
(IT Code 802)
Session- 2025-26
Class- XII
This is to certify that ___________ _____ ,of class XII, Educole The
Girls’ School, Dhampur has completed the practical file of
Information Technology Code 802.
She has submitted the Practical File within the given time. She has
shown utmost sincerity in completing this project work.
______________ _________________
Teacher’s Signature Principal’s Signature
ACKNOWLEDGEMENT
I would like to extend my sincere and heartfelt gratitude to my
Information Technology teacher Ms. Muskan Chhabra who has
helped me in this endeavor and has always been very cooperative
without her help, cooperation, guidance and encouragement, the
project couldn’t be what it evolved to be.
}
}
OUTPUT:
enter number to be searched38700
element found at position 5
PROGRAM 13
Write a user defined function sum() which will add 3 numbers.
import java.util.Scanner;
public class addNo
{
static int sum()
{
Scanner sc= new Scanner(System.in);
System.out.print("Enter first no ");
int a=Integer.parseInt(sc.next());
System.out.print("Enter second no ");
int b=Integer.parseInt(sc.next());
System.out.print("Enter third no ");
int c=Integer.parseInt(sc.next());
int s=a+b+c;
return s; }
public static void main(String args[]){
int t=sum();
System.out.println("Total is "+t);
}}
OUTPUT:
Enter first no 6
Enter second no 7
Enter third no 8
Total is 21
PROGRAM 14
Write a user defined parameterised function sum() which will add 3
numbers.
import java.util.Scanner;
public class addNo
{ static int sum(int a,int b,int c)
{ int s=a+b+c;
return s;}
public static void main(String args[]) {
Scanner sc= new Scanner(System.in);
System.out.print("Enter first no ");
int x=Integer.parseInt(sc.next());
System.out.print("Enter second no ");
int y=Integer.parseInt(sc.next());
System.out.print("Enter third no ");
int z=Integer.parseInt(sc.next());
int t=sum(x,y,z);
System.out.println("Total is"+t); }}
OUTPUT:
Enter first no 45
Enter second no 67
Enter third no 9 89
Total is201
PROGRAM 15
Write a program that will show the examples of String methods with
output.
import java.util.Scanner;
public class firstProgram
{
public static void main(String args[])
{
String Str="Good Morning ";
System.out.println(Str.charAt(3));
System.out.println(Str.concat("World"));
System.out.println(Str.contains("oo"));
System.out.println(Str.endsWith("ing"));
System.out.println(Str.equals("good morning"));
System.out.println(Str.equalsIgnoreCase("good morning"));
System.out.println(Str.indexOf('M'));
System.out.println(Str.isEmpty());
System.out.println(Str.length());
System.out.println(Str.replace("o","e"));
System.out.println(Str.replaceAll("o","e"));
System.out.println(Str.startsWith("G"));
System.out.println(Str.substring(3,7));
System.out.println(Str.toLowerCase());
System.out.println(Str.toUpperCase());
System.out.println(Str.trim());
}
}
OUTPUT:
d
Good Morning World
true
false
false
false
5
false
13
Geed Merning
Geed Merning
true
d Mo
good morning
GOOD MORNING
Good Morning
MySQL
QUERIES
Databases
A database may be defined as a collection of
interrelated data stored together to serve multiple
applications.
Rdms:
In relational data model, the data is organized into
tables (i.e., rows and columns). These are called
relations. A row in a table represents a relationship
among a set of values.
Mysql
SQL, Structured Query Language, was developed in
1970s in an IBM Laboratory. SQL, sometimes also
referred to as SEQUEL is a 4th generation non-
procedural language.
SQl commands:
1.Show databases; It displays all the database, of the
system.
Page 42 of 57
11. Group by; The GROUP BY clause combines all
those records that have identical values in a
particular field or a group of fields.
use practical;
Page 43 of 57
insert into employee_info values(106,'AYUSH VERMA','2005-05-17','2021-12-
24','MDA GAJRAULA','9913979603','MALE','MECHANICAL','CLERK');
Page 44 of 57
insert into salary values(107,45000,00,00,00,00,00);
Page 45 of 57
2.Display the structure of the table employee_info.
➢ describe employee_info;
Page 46 of 57
5.To fetch all the Employees who are managers.
Page 47 of 57
7.To find the maximum, minimum, and average
salary of the employees.
Page 48 of 57
10.show emp_no, emp_name and salary in ascending
order of salary.
Page 49 of 57
13.add column bonus.
Page 50 of 57
16.select emp_id, left(gross_salary,3) from salary;
17. display the names, net salary, gross salary of all the
male employees with their department and
designation.
Page 51 of 57
19.display length of each name.
Page 52 of 57