Practical File 2024-25
Practical File 2024-25
INFORMATION TECHNOLOGY
(802)
PRACTICAL FILE (SESSION:2024-25)
SUBMITTED BY:
ARUN
CLASS: XII A
ROLL NO:
ACKNOWLEDGEMENT
I wish to express my deep sense of gratitude and indebtedness to our
learned teacher M s .ARCHANA ARUN DR.APJ ABDUL KALAM
C.B.SR.SEC.SCHOOL] for her invaluable help, advice and guidance in
the preparation of this project.
CERTIFICATE
This is to certify that Md.SAMIR ANSARI of Class XII,
Dr.A.P.J.ABDUL KALAM C.B.Sr.Sec.SCHOOL has completed
the Term II - PRACTICAL FILE during the academic year [2024-
25] towards partial fulfillment of credit for the Information
Technology (802) practical evaluation of CBSE and submitted
satisfactory report, as compiled in the following pages, under my
supervision.
1. MYSQL QUERIES
1 Create a student table with the student id, name, and marks as
attributes where the student id is the primary key.
2 Insert the details of a new student in the above table
3 Delete the details of a student in the above table
4 Use the select command to get the details of the students with marks
more than 80
5 Find the min, max, sum, and average of the marks in a student
marks table
6 Find the total number of customers from each country in the table
(customer ID, customer Name, country) using group by.
7 Write a SQL query to order the (student ID, marks) table in
descending order of the marks
Write a SQL query to display the marks without decimal places,
8 display the reminder after diving marks by 3 and
display the square of marks
Write a SQL query to display names into capital letters, small
9 letters, display firstt 3 letters of name, display last 3 letters of name,
display the position the letter A in name
10 Remove extra spaces from left, right and both sides from the text - "
Informatics Practices Class XII "
2. JAVA PROGRAM
1 Write a program to accept integer number from user and print the
number.
2 Write a program to accept two numbers from the user and find the
sum of numbers.
3 Write a program to swap the numbers without using 3rd variable.
7 Write a program to accept three numbers from the user and find
the largest number.
Write a program to check leap year.
8
Write a program the check whether a number is positive or negative.
9
Table data:
3. Delete the details of a student in the above
table. Ans.:
delete from student where studentid=5;
4. Use the select command to get the details of the students with marks more
than 80.
Ans.:
select * from student where marks>80;
5. Find the min, max, sum, and average of the marks in a student marks table.
Ans.:
select max(marks), min(marks), sum(marks) , avg(marks)
from student;
6. Find the total number of customers from each country in the table (customer ID,
customer Name, country) using group by.
Ans.:
select country, count(customer_id) from customer group by
country;
7. Write a SQL query to order the (student ID, marks) table in descending order
of the marks.
Ans.:
select * from student order by marks desc;
8. Write a SQL query to display the marks without decimal places, display
the reminder after diving marks by 3 and display the square of marks.
Ans.:
select round(marks,0),mod(marks,3),pow(marks,2) from
student;
9. Write a SQL query to display names into capital letters, small letters, display frist
3 letters of name, display last 3 letters of name, display the position the letter A in
name
Ans.:
select ucase(name), lcase(name), left(name,3),right(name,3),
instr(name,'a') from student;
10. Remove extra spaces from left, right and both sidesfrom the text - "
Informatics Practices Class XII "
Ans.:
select ltrim(" Informatics Practices Class XII ") "Left
Spaces", rtim(" Informatics Practices Class XII ") "Right
Output -
Enter a number: 20
You entered: 20
2. Write a program to accept two numbers from the user and find the sum of
numbers.
import java.util.Scanner;
sum = n1 + n2;
System.out.println("The sum is: " + sum);
}
}
Output -
Enter two numbers
22 44
The sum is: 66
3. Write a program to swap the numbers without using 3rd variable.
import java.util.Scanner;
System.out.println("Result");
System.out.println("First number = " + n1);
System.out.println("Second number = " + n2);
}
}
Output -
First number = 51
Second number = 48
Result
First number = 48
Second number = 51
4. Write a program to accept number from the user and check whether number
is even or odd.
import java.util.Scanner;
5. Write a program to accept number from the user and check whether an
alphabet is vowel or consonant.
import java.util.Scanner;
}
}
Output -
Enter a character: a
a is vowel
Output -
Enter the number: 5
Factorial of the number: 120
7. Write a program to accept three numbers from the user and find the largest
number.
import java.util.Scanner;
else
System.out.println(n3 + " is the largest number");
}
}
Output -
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0)
leap = true;
else
leap = false;
}
else
leap = true;
}
else
leap = false;
if (leap)
System.out.println(year + " is a leap year.");
else
System.out.println(year + " is not a leap year");
}
}
Output -
2022 is not a leap year
9. Write a program the check whether a number is positive or negative.
import java.util.Scanner;
double n1 = 18;
else
System.out.println(number + " is 0");
}
}
Output -
18 is a positive number
char c = 'a';
if( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
System.out.println(c + " is an alphabet");
else
System.out.println(c + " is not an alphabet");
}
}
Output -
a is an alphabet
11. Write a program to print the Fibonacci series using for Loop.
import java.util.Scanner;
Output
Fibonacci Series till 10 terms:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34
import java.util.Scanner;
String str3=str1.concat(str2);
System.out.println(str3);
}
}
Output -
Information Technology