Informatics Practices
What SQL statement do we use to find the total number of records present in the table Product?
- SELECT * FROM PRODUCT;
- SELECT COUNT(*) FROM PRODUCT;
- SELECT FIND(*) FROM PRODUCT;
- SELECT SUM() FROM PRODUCT;
SQL Queries
2 Likes
Answer
SELECT COUNT(*) FROM PRODUCT;
Reason — The SQL statement SELECT COUNT(*) FROM PRODUCT; is used to retrieve the total number of records or rows present in the "PRODUCT" table. The COUNT(*) function counts all rows along with the NULL values in a specified table, and the SELECT keyword is used to fetch data from the database.
Answered By
2 Likes
Related Questions
If column "Marks" contains the data set {25, 35, 25, 35, 38}, what will be the output after the execution of the given query?
SELECT DISTINCT(MARKS) FROM STUDENTS;- 25, 35, 25, 35, 38
- 25, 25, 35, 35, 38
- 25, 35, 38
- 25, 25, 35, 35
If column "Salary" contains the data set {10000,15000,25000,10000,15000}, what will be the output after the execution of the given query?
SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;- 75000
- 25000
- 10000
- 50000
What SQL statement do we use to display the record of all students whose last name contains 5 letters ending with "A"?
- SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _A';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '_ _ _ _';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '????A';
- SELECT * FROM STUDENTS WHERE LNAME LIKE '*A';
Which one of the following is not an aggregate function ?
- ROUND()
- SUM()
- COUNT()
- AVG()