0% found this document useful (0 votes)
27 views30 pages

Xii Sample Practical File 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views30 pages

Xii Sample Practical File 2024

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

SRI GURU HARKRISHAN SR.

SECONDARY PUBLIC SCHOOL


SECTOR 40-C, CHANDIGARH
AFFILIATED TO CBSE
(CHIEF KHALSA DIWAN CHARITABLE SOCIETY) SECTOR 40-C, CHANDIGARH

PRACTICAL RECORD FILE


ON
INFORMATION TECHNOLOGY
Subject Code 802
Session (2023-24)

Submitted By : ________________________
Class & Section : _____________
Stream : _____________
Roll No : _____________

Submitted to: Mrs. Jagjeet Kaur Sran,


HOD, IT Dept.
ACKNOWLEDGEMENT

I wish to express my deep sense of gratitude and indebtedness to our


learned Teacher Mrs. Jagjeet Kaur Sran, HOD, IT Department, of Sri Guru
Harkrishan Sr. Secondary Public School, Sector 40-C, Chandigarh for his
invaluable help, advice and guidance in the preparation of this practical
file.
I am also greatly indebted to our principal Mrs. Charanpreet Kaur and
school authorities for providing me with the facilities and requisite IT Lab
conditions for making this practical file.

_______________________
Name of Student
CERTIFICATE

This is to certify that_________________________________________, student of Class


___________________, Sri Guru Harkrishan Sr. Sec. Public School, Sector 40-C, Chandigarh,
has completed the Practical File during the academic year 2023-24, for the
Information Technology (802) practical evaluation of CBSE and submitted
satisfactory reports, as compiled in the following pages, under my supervision.

Teacher’s Signature
S. NO TOPICS Page Nos.

2
S. NO MYSQL QUERIES DATE SIGN

Write SQL query to Create new database.


1
Write SQL query to display the list of
2 databases.

Write SQL query to select a particular database to


3 work with.

Write SQL query to create the table Employee.


4
Write SQL query to insert any four records in the
5 Employee table.

Write SQL query to display all the records of all


6 Female Employees.

Write SQL query to display/view the structure of


7 selected table

Write SQL query to display the detail of


8 Employee who joined in year 2015.

Write SQL query to display name of employees


9. inupper case who joined on “Wednesday”.

Write SQL query to display first 4 alphabets


10. of Employee Name and last 3 characters of
Department of all Employees.
Write SQL query to display the salary
11.
Department wise using GROUP BY clause
S. NO MYSQL QUERIES DATE SIGN

Write SQL query to sort the records in


12. descending order using ORDER BY clause.

Write SQL query to retrieve data from multiple


13. tables using INNER JOIN clause

Write SQL query to display total salary of all the


14. Employees.

Write SQL query to display the average salary of


15. Employees.

Write SQL query to display the maximum and


16. minimum Salary of Employees.

Write SQL query to display the total number of


17. male Employees in the table.

Write SQL query to removes the complete data


18.
without removing its structure of the table.
QUERY - 1

Write SQL query to Create Database

SOLUTION

CREATE DATABASE employeedb;

OUTPUT:
QUERY - 2

Write SQL query to Show databases

SOLUTION

mysql> SHOW DATABASES;

OUTPUT:
QUERY - 3

Write SQL query to select a particular database to work


with.

SOLUTION

USE customers;

OUTPUT:
QUERY - 4

Create the following table: Employee


Field Name Datatype Constraint
Empid Integer Primary Key
Name Varchar (20) Not Null
Department Varchar (20) Not Null
Salary Integer
Gender Varchar (1)
DOJ Date

SOLUTION

CREATE TABLE Employee (


Empid Integer Primary Key,
Name Varchar(20) Not Null,
Department Varchar(20) NOT NULL,
Salary Integer,
Gender Varchar(1)
);
QUERY - 5

Insert the following records in the table created above:


Empid Name Department Salary Gender DOJ
1001 Aman Sales 40000 M 2010-11-21
1002 Suman Accounting 35000 F 2009-09-25
1003 Ravi Sales 45000 M 2015-05-02
1004 Sakshi Accounting 35000 F 2016-06-15

SOLUTION

INSERT INTO Employee VALUES (1001, 'Aman', 'Sales ',40000,'M', '2010-11-21');


INSERT INTO Employee VALUES (1002, 'Suman', 'Accounting', 35000, 'F', '2009-09-25');
INSERT INTO Employee VALUES (1003, 'Ravi', 'Sales', 45000, 'M', '2015-05-02');
INSERT INTO Employee VALUES (1004, 'Sakshi', 'Accounting', 35000, 'F', '2016-06-15');

OUTPUT:

Empid Name Department Salary Gender DOJ


1001 Aman Sales 40000 M 2010-11-21
1002 Suman Accounting 35000 F 2009-09-25
1003 Ravi Sales 45000 M 2015-05-02

1004 Sakshi Accounting 35000 F 2016-06-15


QUERY - 6

Display all the records of Female Employees.

SOLUTION

SELECT * FROM Employee WHERE Gender = ‘F’;

Output:
Empid Name Department Salary Gender
2 Suman Accounting 35000 F
4 Sakshi Accounting 35000 F
QUERY - 7

Display/View the structure of the table - Employee.

SOLUTION

DESCRIBE Employees;

Output:

Field Name Datatype Constraint


Empid Integer Primary Key
Name Varchar (20) Not Null
Department Varchar (20) Not Null
Salary Integer
Gender Varchar (1)
DOJ Date
QUERY - 8

Display the detail of Employees who joined in year 2015.

SOLUTION

SELECT * FROM Employee WHERE year (DOJ)=2015;


Output:
Empid Name Department Salary Gender DOJ
3 Ravi Sales 45000 M 2015-05-02
QUERY - 9

Write SQL query to display name of employees in upper


case who joined on “Wednesday”.

SOLUTION

SELECT upper(Name) FROM Employee


WHERE dayname(DOJ) = "Wednesday";
Output:
upper(Name)
SAKSHI
QUERY - 10

Write SQL query to display first 4 characters of


Employee Name and last 3 characters of Department of
all Employees.

SOLUTION

SELECT left(Name,4), right(Department,3)


FROM Employee;

Output:
left(Name,4) right(Department,3)
Aman les
Suma ing
Ravi les
Saks ing
QUERY - 11

Write SQL query to display the salary Department wise


using MYSQL GROUP BY clause.

SOLUTION

SELECT sum(Salary), Department FROM Employee


GROUP BY Department;

Output:
sum(Salary) Department
85000 Sales
70000 Accounting
QUERY - 12

Write SQL query to sort the records in descending order


using MYSQL ORDER BY Clause.

SOLUTION

SELECT *
FROM officers
WHERE address = 'Lucknow'
ORDER BY officer_name DESC;

OUTPUT:
QUERY - 13
Write SQL query to retrieve data from multiple tables. It by fetch
records from two or more tables using MySQL INNER JOIN command.
Considering two tables "officers" and "students", having the following
data.

SOLUTION

SELECT officers.officer_name, officers.address, students.course_name


FROM officers
INNER JOIN students
ON officers.officer_id = students.student_id;

OUTPUT:
QUERY - 14

Display total salary of all the Employees.

SOLUTION

SELECT sum(Salary) FROM Employee;

Output:
sum(Salary)
155000
QUERY - 15

Display the average salary of Employees.

SOLUTION

SELECT avg(Salary) FROM Employee;

Output:
avg(Salary)
38750.00
QUERY - 16

Display the maximum and minimum Salary of


Employees

SOLUTION

SELECT max(Salary), min(Salary) FROM Employee;


Output:

max(Salary) min(Salary)
45000 35000
QUERY - 17

Display total number of male Employees.

SOLUTION

SELECT count (*) FORM Employee WHERE Gender = 'M';


Output:
count(*)
2
QUERY - 18
Write SQL query to removes the complete data without
removing its structure of the following given table using
TRUNCATE command.

SOLUTION

mysql> TRUNCATE TABLE customer;

OUTPUT:

SELECT command gives the following output that shows none of the
records present in the table:
S. NO JAVA PROGRAMS DATE SIGN

Write a JAVA program to check whether the


1 number is palindrome or not.

9.

10.

11.
S. NO JAVA PROGRAMS DATE SIGN

12.
13.

14.

15.

16.
17.

18.
JAVA Program No.- 1
Write a JAVA program to check whether the number is palindrome
or not.

Source Code :
class PalindromeNum{
public static void main(String args[]){
int r,sum=0,temp;
int n=454;//It is the number variable to be checked for palindrome
temp=n;
while(n>0){
r=n%10; //getting remainder
sum=(sum*10)+r;
n=n/10;
}
if(temp==sum)
System.out.println("palindrome number ");
else
System.out.println("not palindrome");
}
}

OUTPUT :

palindrome number
JAVA Program No.- 2

You might also like