Dav Sr Sec Public School, Barmana
Informatics Practices
Class-XII
Assignment
3/9/2025
1) What is the purpose of order by clause in SQL? Explain with the help of suitable example.
2) Explain the following SQL functions with suitable examples.
a) Round( )
b) UCASE( )
c) POWER( )
d) MID( )
e) TRIM( )
3) What is the purpose of GROUP BY clause in sql? Explain with the help of suitable example.
4) The HR department of TechNova Ltd. Maintains a table named Employee that stores
information about employees’ names, salaries, and departments. Here’s a sample of the
table: Emp_ID Name Salary Department E101 rohit sharma 45200.75 Sales E102 Ananya
Das 37800.50 HR E103 MEENA JOSHI 62000.00 Finance E104 sushil ehra 50000.25 IT E105
Divya Nair 47000.00 HR Help her to write query for:
i) Write an SQL query to display all employee names in uppercase.
ii) Display the last 4 characters of the employee names
iii) Write a query to round the salaries to the nearest 100.
Display employee names without leading and trailing spaces.
5) What will happen if we use ORDER BY with a column that contains NULL values?
A) NULL values will be sorted first
B) NULL values will be sorted last
C) NULL values will cause an error
D) NULL values will be excluded from the result
6) What is the result of this query?
SELECT name, department, salary FROM employees ORDER BY department ASC, salary
DESC;
A) Results are sorted by salary in descending order, then by department
B) Results are sorted by department in ascending order, then by salary in descending order
C) Results are sorted by department in descending order, then by salary in ascending order
D) Results are sorted by salary in ascending order, then by department