1/13
Review Deck
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
SQL
Structured Query Language: A declarative language used to talk to Relational Databases.
Declarative Language
You describe WHAT you want (e.g., "Get milk"), not HOW to get it (e.g., "Walk to store").
Order of Execution (Mental Model)
FROM (Find Table) -> 2. WHERE (Filter Rows) -> 3. SELECT (Return Columns).
The "Quote" Rule
Numbers are naked (e.g., 50). Text gets dressed in single quotes (e.g., 'Kevin').
SELECT *
Select ALL columns from a table.
WHERE clause
Used to filter rows based on specific conditions.
OR Operator
Logic that EXPANDS results (returns rows matching Condition A OR Condition B).
AND Operator
Logic that RESTRICTS results (returns rows matching BOTH Condition A AND Condition B).
LIKE Operator
Used for pattern matching text (e.g., finding names that start with "B").
% Wildcard
Represents "Zero, One, or Many" characters (e.g., 'B%' finds Bob, Banana, B).
_ Wildcard
Represents "Exactly One" character.
IS NULL
The correct way to check for empty/unknown values (you cannot use = NULL).
ORDER BY default
Ascending (ASC) - A to Z, or Low to High.
DISTINCT
Keyword used to remove duplicate rows from the result set.