English

Write a suitable SQL query for the following: I. To display the total number of characters in the string DatabaseSystems. II. Find the position of the first occurrence of the letter 'a' - Informatics Practices

Advertisements
Advertisements

Question

Write a suitable SQL query for the following:

  1. To display the total number of characters in the string DatabaseSystems.
  2. Find the position of the first occurrence of the letter 'a' in the Product_Name column of the Products table.
  3. Calculate the square of the Amount for each transaction in the Tran_Amount column of the Transactions table.
  4. To display the average salary from the Salaries column in the Employees table.
  5. Display the total sum of the Salary from the Salary column in the Employees table.
Code Writing
Advertisements

Solution

  1. SELECT LENGTH('DatabaseSystems');
  2. SELECT INSTR(Product_Name, 'a') FROM Products;
  3. SELECT POWER(Tran_Amount, 2) FROM Transactions;
  4. SELECT AVG(Salaries) FROM Employees;
  5. SELECT SUM(Salary) FROM Employees;
shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Board Sample Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×