0% found this document useful (0 votes)
101 views55 pages

Practical File 2024-2025

Uploaded by

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

Practical File 2024-2025

Uploaded by

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

Delhi Public School, Jodhpur

Informatics Practices [065] Practical


File

Class XII (2024-2025)

Submitted by: Submitted to: Mrs Shilpa bafna

Name:
Class:

Roll No:
INDEX

S.No Exercise Signature


PRACTICAL FILE

STRUCTURED QUERY LANGUAGE


Revision Tour
Create Database/Table / Insert Into
Q1Create the above tables in database named Company and insert tuples in them.

Employee table

insert into employee values(1,'mukul',30000,'west',28,'28/12/2004','15/04/2020','a',10),


(2,'kritika',35000,'center',30,'30,15/11/2006','16/06/2021','a',10),
(3,'naveen',32000,'west',40,'12/02/2010','20/01/2019',null,20),
(4,'uday',38000,'north',38,'16/03/2009','11/03/2019','c',30),
(5,'nupur',32000,'east',26,'15/04/12','18/07/2020',null,20),
(6,'moksh',37000,'south',28,'20/05/2006','25/05/2018','b',10),
(7,'shelly',36000,'north',26,'17/09/2006','25/01/2018','a',30)

Q2. Display the details of all the employees.


Department table

insert into department values(10,'sales',25000,35000,1),(20,'finance',30000,50000,5),


(30,'admin',25000,40000,7);

Q3. Display the Salary, Zone, and Grade of all the employees.
Q4 Display the records of all the employees along with their annual salaries.
The Salary column of the table contains monthly salaries of the employees.

Q5 Display the records of all the employees along with their annual salaries.
The Salary column of the table contains monthly salaries of the employees. The
new column should be given the name “Annual Salary”.
Conditional Select using Where Clause
Q6. Display the details of all the employees who are below 30 years of age.
Q7 Display the names of all the employees working in North zone.

Q8 Display the salaries of all the employees of department 10.


Using NULL
Q9 Display the details of all the employees whose Grade is NULL.
.

Q10Display the details of all the employees whose Grade is not NULL.

Using DISTINCT Clause


Q11Display the names of various zones from the table Employee. A zone name
should appear only once.

Q12 Display the various department numbers from the table Employee. A
.department number should be displayed only once.

Using Logical Operators (NOT, AND, OR)


Q13 Display the details of all the employees of department 10 who are above 30
. years of age.

Q14 Display the details of all the employees who are getting a salary of more than
. 35000 in the department 30.

Q15. Display the names and salaries of all the employees who are working neither in
West zone nor in Centre zone.
Q16 Display the names of all the employees who are working in department 20 or
. 30.

Q17. Display the details of all the employees whose salary is between 32000 and
38000.
Q18. Display the details of all the employees whose grade is between ‘A’ and ‘C’.

Using IN Operator
Q19. Display the names of all the employees who are working in department 20 or
30. (Using IN operator)

Q20. Display the names and salaries of all the employees who are working neither in
West zone nor in Centre zone. (Using IN operator)
Using BETWEEN Operator
Q21. Display the details of all the employees whose salary is between 32000
and 38000. (Using BETWEEN operator)

Q22. Display the details of all the employees whose grade is between ‘A’ and
‘C’. (Using BETWEEN operator)

Using LIKE Operator


Q23. Display the name, salary, and age of all the employees whose names start with
‘M’.

Q24. Display the name, salary, and age of all the employees whose names end with
‘a’.
Q25. Display the name, salary, and age of all the employees whose names contain
‘a’

Q26. Display the name, salary, and age of all the employees whose names do not
contain ‘a’

Q27. Display the details of all the employees whose names contain ‘a’ as the second
character.

Using ORDER BY clause


Q28. Display the details of all the employees in the ascending order of their salaries.
Q29. Display the details of all the employees in the descending order of their
names.

Q30. Display the details of all the employees in the ascending order of their grades
and within grades in the descending order of their salaries.

Using relational operator

Q display details of those who have salary more than 35000.


Q display details of those who have age less than 30.

Q display details of those who have salary more than or equal to 30000 where
dept is 10

Q display name, zone and age of those who have age less than or equal to 28

Q display name, doj, salary of those whose salary is not 32000.


Using UPDATE, DELETE, ALTER TABLE
Q Put the grade B for all those whose grade is NULL.
ANS update employee set grade='b' where grade is null;

Q Increase the salary of all the employees above 30 years of age by 10%.
update employee set salary=salary+(salary*10/100) where age<30;

Q Delete the records of all the employees whose grade is C and salary is below
30000.
Q Delete the records of all the employees of department 10 who are above 40
years of age.
delete from employee where dept=10 and age<40.

Q Add another column Hire Date of type Date in the Employee table.
alter table employee add hire date date.

DROP TABLE
Q Drop the tables Employee and department.
Drop table employee;

Drop table department;

My SQL functions
Text/string functions
1) CONCAT
2) LOWER/LCASE

3) SUBSTR/MID
4) UCASE/UPPER

5) LTRIM

7) TRIM
8) INSTR

9) LENGTH

Numeric function
1) mod
2) POWER/POW

3) ROUND
Date/Time function
1) CURDATE () /CURRENT_DATE()

2 )MONTH()
3 )YEAR()

4 )DAY()
5) DATE ()

6) NOW ()
AGGREGATE FUNCTION
1) AVERAGE

2) COUNT

3) MAX

4) MIN

5) SUM
GROUPING BY+ HAVING BY
JOINT TABLE
Cross joint
Equi joint
Natural joint

Conditions
PYTHON
SERIES
A) CREATION OF SERIES
1) EMPTY SERIES

2) scalar value

3) list
4) Dictionary

5) numpy array

B) SERIES FUNCTION
1) head and tail function
2) sort index and sort values

3) count and length function

C) INDEXING AND SLICING OF SERIES


D) SERIES ATTRIBUTES
1) INDEX

2) INDEX NAME
3) VALUES

4) DTYPE

5) SHAPE

6) NBYTES

7) NDIM

8) SIZE
9) ITEMSIZE

10) HASNANS

11) EMPTY

12) NAME

E) VECTOR OPERATIONS ON SERIES


DATAFRAME
A) CREATION OF DATAFRAME
1) List
2) Dictionary

3) Series

4) Dictionary of list
5) List of dictionaries

B) DATAFRAME FUNCION
1) HEAD

2) TAIL

C) DATAFRAME ATTRIBUTES
1)INDEX
3) COLUMN

3)AXES

4)DTYPE

5)SIZE
6) SHAPE

7) VALUES

8) EMPTY
9) NDIM

10) T

D) ASSESING, INDEXING AND SLICING OF DATAFRAME


1) ASSISING A COLUMN
2) accessing multiple columns

3) accessing a subset from row/column


4) SELECTING/ACCESSING INDIVIDUAL VALUE
5) SELECTING ROW/COLUMN BASED ON BOOLEAN

E) deleting/renaming rows/columns
GRAPHS
1) LINE GRAPH

2)MULTILINE GRAPH
3)BAR GRAPH
4) MULTIPLE BAR GRAPH

5) HORIZONTAL BARH GRAPH


6) HISTOGRAM

You might also like