Beginner SQL Commands Flashcards
SELECT
is the clause we use every time we want to query information from a DB.
AS
renames a column or table
DISTINCT
return unique values
WHERE
is a popular command that lets you filter the results of the query based on conditions that you specify
LIKE AND BETWEEN
Special operators
AND & OR
combines multiple conditions
ORDER BY
Sorts the results
LIMIT
Specifies the maximum number of rows that query will return
CASE
creates different outputs
What are aggregates?
Calculations performed on multiple rows of a table.
COUNT()
Returns the total count of whatever the argument was in
SUM()
Returns the sum of whatever argument was added
MAX()/MIN()
Returns the maximum or minimum value in the column that you specified
AVG()
Returns the avg of the column
ROUND()
ROUND(Column Name, number of decimal places)