Alias definition tables and fields
In the query may be an alias for the tables and fields, this alias can be substituted for the specified table and field. Table alias for the field and can make queries easier. And it can display the query results in a more reasonable manner.
Table alias
When the name of a particularly long table, the table name in the query directly inconvenient. A case can take appropriate alias table.
example:
SELECT * from info i where i.age=33;
search result:
Alias for the field
When the query data, MySQL will show the term of each output column. By default, the column name is displayed in the column name defined when creating tables. We can also take an alias for the column.
example:
SELECT score as s ,age as a from info;
SELECT score s, age a from info; #as may be omitted