What version of MySQL are you using?
Answer: Version 5.5.24
Answer: Version 5.5.24
To make a new database use the command CREATE DATABASE database_name;.
To make a new table in a database use the command CREATE TABLE tablename (column 1name description, column2name description,...);
The USE command.
The INSERT command can be used in different methods either naming the columns to be populated or by including values for every column.
The command UPDATE may also be used to update a columns value.
String values, date and time values must be quoted.
Numeric values shouldn't be quoted. Functions cannot be quoted and NULL must not be quoted.
The asterisk (*) means you want to retrieve every column.
To restrict which columns are returned by the query you must specify the columns to be returned separated by a comma.
The NOW() returns the current Date and time on the server.
By using the conditionals with the SQL term WHERE.
LIKE and NOT LIKE deal primarily with strings and allow for a more flexible condition.
Equality comparisons are faster because LIKE and NOT LIKE cannot take advantage of indexes.
The two wildcard characters are underscore (_) and %.
By using the ORDER BY clause.
The default sorting method is a meaningless order.(When using the ORDER BY clause the default order is ascending.)
To inverse the sort you can specify a descending order with DESC.
SELECT column1, column2 FROM tablename ORDER BY column2, column1;
The LIMIT clause states how many records you want returned.
LIMIT x will return X amount of records. LIMIT x, y will return y number of records starting at x.
The SQL command used to change the values already stored in a table is SET.
You can change multiple columns at once by separating them with commas.
You can restrict which rows the changes are applied to using the conditional WHERE.
Use the SQL command DELETE.
You restrict to which rows the DELETE is applied using a conditional WHERE and for extra safety use a LIMIT clause. Once information is deleted it cannot be retrieved unless you have backed up your database!
An SQL alias isa symbolic renaming of an item used in a query normally applied to tables, columns, or function calls.
An alias is created by adding the term AS aliasname after the item to be renamed.
An alias is useful because it will be used as a new title for the returned data and can also be used in other functions further down the SQL command.