This question has been answered
Question

***I did not receive full credit for this question when I submitted

my query. Can you tell me how to correct this so I will know next time.***


***Question Below***


Using the "world_x" database I installed in MySQL, list the languages spoken in each country. Order my results by the most popular language. Submit my query and query results in a Word file.


***This is my answer to the question above***


SELECT Name,language
FROM countrylanguage,country
WHERE Code = countrycode
ORDER BY percentage
DESC;


***This is my teacher's response below.. Can someone help me correct my answer to the question per my teachers response***




Hi,
Nice work but the query needs some work. BY will tell the MySQL server to sort the rows by a column. Define in which direction to sort, as the order of the returned rows may not yet be meaningful. Rows can be returned in ascending or descending order.
Then you query your MySQL database, you can sort the results by any field in an ascending or descending order by just adding 'ORDER BY' at the end of your query. You would use ORDER BY field_name ASC for an ascending sort, or ORDER BY field_name DESC for a descending sort.

Answered by Expert Tutors
The student who asked this found it Helpful
Overall rating 100%
***I did not receive full credit for this question when I submitted my query. Can you tell me how to correct this so I will know next time.***...
Get unstuck

252,291 students got unstuck by Course
Hero in the last week

step by step solutions

Our Expert Tutors provide step by step solutions to help you excel in your courses