SQL Questions and Answers – SQL Select Top Clause

This set of SQL Multiple Choice Questions & Answers (MCQs) focuses on “SQL Select Top Clause”.

1. Which clause is used in SQL to fetch limited number of records from a table?
a) Select
b) Select limit
c) Select top
d) Top
View Answer

Answer: c
Explanation: The SELECT TOP clause is useful on large tables with thousands of records. Using this clause, we can fetch limited number of rows from a database table.

2. Mysql supports which of the following clause to select a limited number of rows from a table?
a) Select
b) Select top
c) Top
d) Limit
View Answer

Answer: d
Explanation: Not all the database systems supports SELECT TOP clause. It can be used in SQL. Mysql supports the LIMIT clause to fetch a limited number of records from the database table.

3. Which clause is used by ORACLE to fetch limited number of rows from a database?
a) Select top
b) Limit
c) Rownum
d) Top
View Answer

Answer: c
Explanation: SELECT TOP clause is used in SQL to fetch limited records from a table. MYSQL supports LIMIT clause and ORACLE uses ROWNUM clause to select limited number of rows from a database table.
advertisement
advertisement

4. ROWNUM clause is used with which of the following clause?
a) Select
b) From
c) Where
d) Select top
View Answer

Answer: c
Explanation: ROWNUM clause is used in WHERE clause of a SELECT statement. Syntax for using ROWNUM clause:

SELECT column_list FROM TABLE_NAME WHERE ROWNUM<=VALUE;

5. SELECT TOP clause is used in the place of __________
a) Select
b) From
c) Where
d) Values
View Answer

Answer: a
Explanation: SELECT TOP clause is used to fetch a limited number of records from a database. It is used in the place of SELECT clause in a SELECT statement. Its syntax is as follow:

SELECT top VALUE | percent column_list FROM TABLE_NAME WHERE condition(s);

6. Select top retrieves records from original database table not from the result table.
a) True
b) False
View Answer

Answer: b
Explanation: Select top clause is used to select records from the result table not from the original database table. Result table contains the records of database table which satisfies the conditions provided in the where clause of select statement.
advertisement

7. Which clause is used with SELECT TOP statement to retrieve given percentage of record from a table of the database?
a) %
b) Percentage
c) Percent
d) %%
View Answer

Answer: c
Explanation: Percent clause is used with SELECT TOP to select given percentage of records from the result table. Syntax for such statement is:

advertisement
SELECT top NUMBER Percent column_list FROM TABLE_NAME WHERE condition(s);

8. Which of the following query retrieves top 30 percent records with all attributes of a table named student?
a) Select top 30 percentage * from student;
b) Select top percent 30 * from student;
c) Select 30 percent * from student;
d) Select top 30 percent * from student;
View Answer

Answer: d
Explanation: Select top clause should be used to retrieve top records of a table. Syntax for using percent with select clause is:

SELECT top VALUE Percent column_list FROM TABLE_NAME WHERE condition(s);

9. The TOP clause of SELECT TOP statement specifies _____________
a) Number of fields to be returned
b) Number of columns to be returned
c) Number of rows to be returned
d) Number of tables to be returned
View Answer

Answer: c
Explanation: The SQL SELECT TOP Statement is used to select top records of a table. The top clause specifies the number of rows that are to be returned.

10. Where the number or percentage of rows is specified in a SELECT TOP statement?
a) After top keyword
b) Before top keyword
c) After percent keyword
d) Before percent keyword
View Answer

Answer: a
Explanation: In a SELECT TOP statement, number or percentage of rows is specified after the TOP keyword. Syntax of SELECT TOP statement:

SELECT top VALUE | percent column_list FROM TABLE_NAME WHERE condition(s);

Sanfoundry Global Education & Learning Series – SQL.

To practice all areas of SQL, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.