DATABASE FUNDAMENTALS
WHAT IS DATABASE MANAGEMENT
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
6;
|
|
7;
|
|
8;
|
|
9;
|
Detailed explanation-1: -A table in computer programming is a data structure used to organize information, just as it is on paper. There are many different types of computer-related tables that work in a number of different ways.
Detailed explanation-2: -SELECT * FROM ( SELECT * FROM yourTableName ORDER BY id DESC LIMIT 10 )Var1 ORDER BY id ASC; Let us now implement the above query. mysql> SELECT * FROM (-> SELECT * FROM Last10RecordsDemo ORDER BY id DESC LIMIT 10-> )Var1->-> ORDER BY id ASC; The following is the output that displays the last 10 records.
Detailed explanation-3: -Use the COUNT aggregate function to count the number of rows in a table. This function takes the name of the column as its argument (e.g., id ) and returns the number of rows for this particular column in the table (e.g., 5).
Detailed explanation-4: -1 Answer. ORDER BY id ASC; In the above query, we used subquery with the TOP clause that returns the table with the last 5 records sorted by ID in descending order. Again, we used to order by clause to sort the result-set of the subquery in ascending order by the ID column.