SQL Command Syntax

SQL command syntax

7 cards   |   Total Attempts: 182
  

Cards In This Set

Front Back
Retrieve all the data (all columns) from a table.
SELECT * FROM Tablename
Retrieve the data in two or more columns of a table.
SELECT ColumnName1, ColumnName2, …
FROM Table1
Retrieve all of the columns in a table sorted by the data in a particular column.
SELECT * FROM Tablename
ORDER BY ColumnName
Retrieve all of the columns in a table sorted by the data in two or more columns.
SELECT * FROM Tablename
ORDER BY Column1, Column2
Retrieve all of the columns in a table sorted by a column containing text data in ascending alphabetical order.
SELECT * FROM Tablename
ORDER BY ColumnName ASC
Retrieve all of the columns in a table sorted by a column containing numbers in descending numerical order.
SELECT * FROM Tablename
ORDER BY ColumnName DESC
Retrieve all of the columns in a table sorted by a column specified by relative column position 2 and 3
SELECT * FROM Tablename
ORDER BY 2, 3