Skip to content
Question

Q.(a) Write suitable SQL query for the following : I. To display only the date part from the date/time expression '2026-01-01 10:10:10' II. To convert all customer names from the Cust_Name column to lowercase in the Customer table. III. To extract the first 4 characters from the City_Name column in Location table. IV. To display the name of the city from the CITY column in EVENT table, after removing leading spaces. V. To find the average salary from Salary column in Employees table.

(OR)
(b) Write suitable SQL query for the following : I. To display the value of 17^2 . II. To display the day part of the dates in the Hire_Date column of the Employee table. III. To display the maximum value of the Bill_Amount column in the Bill table. IV. To remove leading and trailing spaces from the Location column in the Branch table. V. To display total salary from tot_sal column in Employees table.
CBSECBSE Class XII Board 2026Subjective· 5mImportance★★★★★
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Part (a): DATE(), LOWER()/LCASE(), LEFT(), LTRIM() and AVG() for the five tasks.

Part (b): POWER() (=289), DAY(), MAX(), TRIM() and SUM() for the five tasks.

Part (a)

I. Date part of a datetime — DATE() drops the time portion.

SELECT DATE('2026-01-01 10:10:10');
2026-01-01

II. Names in lowercase — LOWER() (synonym LCASE()).

SELECT LOWER(Cust_Name) FROM Customer;

III. First 4 characters — LEFT(str, n).

SELECT LEFT(City_Name, 4) FROM Location;

IV. Remove leading spaces — LTRIM() strips only the leading spaces.

SELECT LTRIM(CITY) FROM EVENT;

V. Average salary — aggregate AVG() (ignores NULLs).

SELECT AVG(Salary) FROM Employees; …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.