Advertisements
Advertisements
Question
Write a suitable SQL query for the following:
- To display the total number of characters in the string
DatabaseSystems. - Find the position of the first occurrence of the letter 'a' in the
Product_Namecolumn of theProductstable. - Calculate the square of the Amount for each transaction in the
Tran_Amountcolumn of theTransactionstable. - To display the average salary from the
Salariescolumn in theEmployeestable. - Display the total sum of the
Salaryfrom the Salary column in theEmployeestable.
Code Writing
Advertisements
Solution
-
SELECT LENGTH('DatabaseSystems'); -
SELECT INSTR(Product_Name, 'a') FROM Products; -
SELECT POWER(Tran_Amount, 2) FROM Transactions; -
SELECT AVG(Salaries) FROM Employees; -
SELECT SUM(Salary) FROM Employees;
shaalaa.com
Is there an error in this question or solution?
