Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

PRACTICAL FILE

ON
INFORMATION TECHNOLOGY
CODE : 802
CLASS :XII
SESSION : 2021-22

SUBMITTED TO:
STUDENT NAME : ...... Ms. Suneeta Jena
ROLL NO. : ........
CLASS & SECTION : ...........

SUBMITTED BY:
INDEX
Sr. No. NAME OF PRACTICAL
1 Consider the following Employee table:
Table Name: Employee

The primary key of this table is Employee_ID and Manager_ID is a foreign key that references
Employee_ID.
Write SQL commands for the following:
(a) Create the above table.
(b) Insert values as shown above.
(c) Delete the Employee having Employee_ID 1217.
(d) Update the salary of “Amyra” to 40000.
(e) Alter the table Employee so that NULL values are not allowed for Age column.
(f) Write a query to display names and salaries of those employees whose salary are
greater than 20000.
(g) Write a query to display details of employees who are not getting any bonus.
(h) Write a query to display the names of employees whose name contains “a” as the last
alphabet.
(i) Write a query to display the name and Job title of those employees whose Manager_ID is
1201.
(j) Write a query to display the name and Job title of those employees whose Manager is
“Amyra”.
(k) Write a query to display the name and Job title of those employees aged between 26
years and 30 years (both inclusive)

2 A Railway company uses machines to sell tickets. The machine details and daily sales
information are recorded in two tables:
Table Name: Machine

Table Name: Sales


The primary key of the table Machine is Machine_ID. Records in the table Sales are uniquely
identified by the fields Machine_ID and Date.
(a) Create the tables Machine and Sales.
(b) Write a query to find the number of ticket machines in each station.
(c) Write a query to find the total ticket income of the station “New Delhi” of each day.
(d) Write a query to find the total number of tickets sold by the machine (Machine_ID = 122)
till date.

3 Write a program in Java to implement the formula.


area = length * width * height

4 Write a program in Java to find the result of the following expressions.


(Assume a = 20 and b = 30)
i) a%b
ii) a /= b
iii) (a + b * 100) /10
iv) a && b
v) a++

5 Write a program in Java to print the square of every alternate number of an array.
6 Write a program in Java to create class Triangle with the data members base, height, area and
color. The members base, height, area are of type double and color is of type string. Write
getter and setter methods for base, height and color, and write method to compute_area ().
Create two object of class Triangle, compute their area, and compare their area and color. If
area and color both are same for the objects then display "Matching Triangles" otherwise
display "Non matching Triangles".
7 Write a program in Java to enable user to handle divide by zero exception.

8 Write a program in Java to retrieve data from the MySQL table book in the bookstore
database.

9 Write a program to find the frequency of each element in an array.

10 Write a Java Program to determine whether a given string is palindrome.

11 Write a Java Program to replace the spaces of a string with a specific character.

12 Write a program to the find the following:


1. Prime number checking
2.Sum of digit

13 Write a Java Program to sort the elements of an array in ascending order.


14 Write a Java program to print the following pattern
1
24
369
4 8 12 16
5 10 15 20 25
6 12 18 24 30 36
7 14 21 28 35 42 49
8 16 24 32 40 48 56 64
9 18 27 36 45 54 63 72 81
10 20 30 40 50 60 70 80 90 100
15 Write a program to create a room class, the attributes of this class is roomno, roomtype,
roomarea and ACmachine. In this class the member functions are setdata and displaydata.

16 Write a program to create a class ‘simpleobject‘. Using constructor display a message.

17 Write a program to illustrate creation of threads using runnable class.(start method start each
of the newly created thread. Inside the run method there is sleep() for suspend the thread for
500 milliseconds).

You might also like