a.Write the name(s) of the field that contains numericdata.b.Identify the primary key field in the database. Give reason for yourselection.c.Identify the field type of date of admissionfield.d.If you sort the database in descending order based on the total field, then what will be the first record of the students Name field in thedatabase?e.Identify the names of the field that contains textualdata.f.Write –how to find the record of the student who scored more than230
Answers
can you type like
1.
2.
3.
Like that
Answer:
ORDER BY in MySQL: DESC & ASC Query with EXAMPLE
Sorting Results
Using the SELECT command, results were returned in the same order the records were added into the database. This is the default sort order. In this section, we will be looking at how we can sort our query results. Sorting is simply re-arranging our query results in a specified way. Sorting can be performed on a single column or on more than one column. It can be done on number, strings as well as date data types.
What is ORDER BY in MySQL?
MySQL ORDER BY is used in conjunction with the SELECT query to sort data in an orderly manner. The MySQL ORDER BY clause is used to sort the query result sets in either ascending or descending order.
SELECT statement... [WHERE condition | GROUP BY `field_name(s)` HAVING condition] ORDER BY `field_name(s)` [ASC | DESC];
HERE
"SELECT statement..." is the regular select query
" | " represents alternatives
"[WHERE condition | GROUP BY `field_name(s)` HAVING condition" is the optional condition used to filter the query result sets.
"ORDER BY" performs the query result set sorting
"[ASC | DESC]" is the keyword used to sort result sets in either ascending or descending order. Note ASC is used as the default.
What are DESC and ASC Keywords?
ORDER BY in MySQL: DESC & ASCASC is the short form for ascending
ORDER BY in MySQL: DESC & ASCMySQL DESC is the short form for descending
It is used to sort the query results in a top to bottom style.
It is used to sort the query results in a bottom to top style
When working on date data types, the earliest date is shown on top of the list.
. When working on date types, the latest date is shown on top of the list.
When working with numeric data types, the lowest values are shown on top of the list.
When working with numeric data types, the highest values are shown at top of the query result set.
When working with string data types, the query result set is sorted from those starting with the letter A going up to the letter Z.
When working with string data types, the query result set is sorted from those starting with the letter Z going down to the letter A.