This time all is MySQL's question, very foundation, enjoy it~
1. Select Id,name from Test1; and select id name from Test1; What is the difference between these two statements?
The first statement appears with two columns, the second has only one column, the contents of the column are the contents of the ID, but the name of the column is name, which means that the second sentence is actually "select ID as name from Test1".
2. What commands are required if you want to migrate username that meet age greater than or equal to 30 in the Test1 table to the username column in the Test2 table?
3. List the id,name,age that satisfies the price in a table is greater than the average price of all goods in a table.
Select Id,name,age from a WHERE > (SELECT AVG. From a)
"Comments" can actually be calculated first AVG (price), and then directly greater than that value is good, but to note that select, the result of a select is a number.
If you need to round up the average and keep two digits after the decimal point, then Round (AVG., 2)
4, Test1 table has a name called "Brand" column, now need to do a test2, specifically put these "brand", and realize the two tables of the multi-table connection.
This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1745859
Linux operations engineer face test Nineth set