SQL Flashcards
Week 2.3 (20 cards)
advantages of using a database
- centralised
- less redundancy
- concurrent access
SELECT
FROM
WHERE
LIKE
‘X%’
‘%X’
‘%X%’
ORDER BY
ASC DESC
LIMIT
how many rows to display
GROUP BY
combines all rows where the specified column is the same
AVG(x)
calculates the average of x
HAVING
exclude certain rows from the aggregate
MIN()
finds the smallest value
MAX()
finds the largest valur
SUM()
calculates the sum of all values
COUNT()
the number of rows in the set
AS
renames an aggregate column
JOIN
used to gather data from more than one table
INNER JOIN
only shows rows where an id matching the input was found. the intersection of the 2 tables
FULL OUTER JOIN
this will display every row of both tables whether a match was found or not
LEFT JOIN
display all rows from the first table & all rows with a match from the second table
RIGHT JOIN
displays all rows from the 2nd table & all matching rows from the first