Basic SQL Definitions Flashcards
Learn the definitions of basic SQL commands. (28 cards)
This lets you add columns to a table in a database.
ALTER TABLE
This is an operator that combines two conditions. Both conditions must be true for the row to be included in the result set.
AND
This is a keyword in SQL that allows you to rename a column or table using an alias.
AS
This is an aggregate function that returns the average value for a numeric column.
AVG()
This operator is used to filter the result set within a certain range. The values can be numbers, text or dates
BETWEEN
These statements are used to create different outputs (usually in the SELECT statement). It is SQL’s way of handling if-then logic.
CASE
This is a function that takes the name of a column as an argument and counts the number of rows where the column is not NULL.
COUNT()
This creates a new table in the database. It allows you to specify the name of the table and the name of each column in the table.
CREATE TABLE
These statements are used to remove rows from a table.
DELETE
This is a clause in SQL that is only used with aggregate functions. It is used in collaboration with the SELECT statement to arrange identical data into groups.
GROUP BY
This was added to SQL because the WHERE keyword could not be used with aggregate functions.
HAVING
This will combine rows from different tables if the join condition is true.
INNER JOIN
These statements are used to add a new row to a table.
INSERT
These are operators used with the WHERE clause to test for empty values.
IS NULL and IS NOT NULL
This is a special operator used with the WHERE clause to search for a specific pattern in a column.
LIKE
This is a clause that lets you specify the maximum number of rows the result set will have.
LIMIT
This is a function that takes the name of a column as an argument and returns the largest value in that column.
MAX()
This is a function that takes the name of a column as an argument and returns the smallest value in that column.
MIN()
This is an operator that filters the result set to only include rows where either condition is true.
OR
This is a clause that indicates you want to sort the result set by a particular column either alphabetically or numerically.
ORDER BY
This will combine rows from different tables even if the join condition is not met. Every row in the left table is returned in the result set, and if the join condition is not met, then NULL values are used to fill in the columns from the right table.
OUTER JOIN
This is a function that takes a column name and an integer as an argument. It rounds the values in the column to the number of decimal places specified by the integer.
ROUND()
These statements are used to fetch data from a database. Every query will begin with this command.
SELECT
This specifies that the statement is going to be a query that returns unique values in the specified column(s).
SELECT DISTINCT