SELECT POWER(15, 2);
SELECT ROUND(456.789, 0);
SELECT INSTR('mycommercial.com', 'com');
SELECT DAYNAME('2024-11-07');
SELECT NOW();
Ashutosh, who is a manager, has created a database to manage employee records. The database includes a table named EMPLOYEE whose attribute names are mentioned below:
EID : Stores the unique ID for each employee.
EMP_NAME : Stores the name of the employee.
DEPT : Stores the department of the employee.
SALARY : Stores the salary of the employee.
JOIN_DATE : Stores the employee’s joining date.
Write the output of the following SQL Queries:
(i) SELECT SUBSTRING(EMP_NAME, 1, 5) FROM EMPLOYEE WHERE DEPT = 'ENGINEERING';
(ii) SELECT EMP_NAME FROM EMPLOYEE WHERE MONTH(JOIN_DATE) = 8;
(iii) SELECT EMP_NAME FROM EMPLOYEE WHERE SALARY>60000;
(iv) SELECT COUNT(DEPT) FROM EMPLOYEE;
An educational institution is maintaining a database for storing the details of courses being offered. The database includes a table COURSE with the following attributes:
C_ID : Stores the unique ID for each course.
C_NAME : Stores the course’s name.
INSTRUCTOR : Stores the name of the course instructor.
DURATION : Stores the duration of the course in hours.
Write SQL queries for the following:
(i) To add a new record with following specifications:
C_ID : C106
C_NAME : Introduction to AI
INSTRUCTOR : Ms. Preeti
DURATION : 55
(ii) To display the longest duration among all courses.
(iii) To count total number of courses run by the institution.
(iv) To display the instructors’ name in lower case.
Consider the following tables:
Write SQL queries for the following:
(i) To delete those records from table SALES whose UnitsSold is less than 80.
(ii) To display names of all products whose category is not known.
(iii) To display the product names along with their corresponding units sold.
Given the following tables:
Write SQL queries for the following:
(i) To display the number of students from each city.
(ii) To find the average age of all students.
(iii) To list the names of students and their grades.
(i) Write the SQL statement to create a table, Customer with the following specifications:
(ii) Write the SQL query to display all records in descending order of LName from the Table Customer.


Rishika and Shivika were partners in a firm sharing profits and losses in the ratio of 3 : 2. Their Balance Sheet as at 31st March, 2024 stood as follows:
Balance Sheet of Rishika and Shivika as at 31st March, 2024
| Liabilities | Amount (₹) | Assets | Amount (₹) |
|---|---|---|---|
| Capitals: | Equipment | 45,00,000 | |
| Rishika – ₹30,00,000 Shivika – ₹20,00,000 | 50,00,000 | Investments | 5,00,000 |
| Shivika’s Husband’s Loan | 5,00,000 | Debtors | 35,00,000 |
| Creditors | 40,00,000 | Stock | 8,00,000 |
| Cash at Bank | 2,00,000 | ||
| Total | 95,00,000 | Total | 95,00,000 |
The firm was dissolved on the above date and the following transactions took place:
(i) Equipements were given to creditors in full settlement of their account.
(ii) Investments were sold at a profit of 20% on its book value.
(iii) Full amount was collected from debtors.
(iv) Stock was taken over by Rishika at 50% discount.
(v) Actual expenses of realisation amounted to ₹ 2,00,000 which were paid by the firm. Prepare Realisation Account.