SQL queries Flashcards
(17 cards)
SELECT
The SELECT statement is used to select data from a database.
WHERE
The WHERE clause is used to filter records that match a certain
condition
ORDER BY
The ORDER BY keyword is used to sort the result-set in
ascending (ASC) or descending (DESC) order.
IN
The IN operator allows you to specify multiple values in a WHERE
clause, shorthand for multiple OR conditions.
COUNT
number of rows returned based on your query
MIN/MAX
minimum/maximum value of column
AVG
average value of a column
GROUP BY
The GROUP BY statement groups rows that have the
same values into summary rows, usually used with aggregate
functions (count, min/max, avg)
HAVING
Same as WHERE, but used for aggregate functions
INNER JOIN
selects records that have matching values in different tables.
SUBQUERIES
A subquery is a query nested within another query
CREATE
Used to create a new table in a
database
DROP
Used to drop (delete) a table
from a database
ALTER
Used to add/delete/modify columns
in an existing table
INSERT
INSERT INTO is used to add a
new record to a table
UPDATE
UPDATE modifies an existing
record in a table
DELETE
DELETE will delete existing
records in a table