MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What is the result of the following code:SELECT top 10 * FROM CARS
A
all rows from the CARS table
B
the last 10 rows from the CARS table
C
error because the code is not sufficient
D
the first 10 rows from the CARS table
Explanation: 

Detailed explanation-1: -SELECT TOP 1 Means Selecting the very 1st record in the result set. SELECT 1 Means return 1 as the result set.

Detailed explanation-2: -Example-Using TOP PERCENT keyword For example: SELECT TOP(10) PERCENT contact id, last name, first name FROM contacts WHERE last name = ‘Anderson’ ORDER BY contact id; This SQL SELECT TOP example would select the first 10% of the records from the full result set.

Detailed explanation-3: -To select first 10 elements from a database using SQL ORDER BY clause with LIMIT 10. Insert some records in the table using insert command. Display all records from the table using select statement. Here is the alternate query to select first 10 elements.

There is 1 question to complete.