Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
3.0k views
in Programming by (95.2k points)
closed by
 With SQL, how can you return the number of records in the "persons" table? 
1. SELECT COUNT () FROM persons
2. SELECT COLUMN (*) FROM persons 
3. SELECT COLUMN () FROM persons  
4. SELECT COUNT (*) FROM persons 

1 Answer

0 votes
by (95.4k points)
selected by
 
Best answer
Correct Answer - Option 4 : SELECT COUNT (*) FROM persons 

Concept:

SQL stands for the structured query language. It is used to perform operations like creating, inserting, deleting and modifying the data in the database.

Explanation:

SQL count function:

It is used to count the number of records in the selected table. It is used with the SELECT statement.

Syntax: SELECT count(*) FROM table_name

Here  table_name is given as persons.

So, the number of records in the "persons" table can find out as :

SELECT count(*) FROM persons;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...