Keys, Operators Flashcards
Primary Key
a unique identifier for each record (or row) in a database table. It’s a special column (or a set of columns) that has a unique value for every entry, ensuring that each row can be distinguished from the others.
Simple Primary Key
a primary key that consists of only one column, which uniquely identifies each row in a table.
Composite Primary Key
a primary key made up of more than one column. Together, these columns create a unique identifier for each row in a table.
Foreign Key Constraint
a safety check that makes sure links between tables are accurate and valid, preventing errors in data relationships.
Foreign Key Constraint
a safety check that makes sure links between tables are accurate and valid, preventing errors in data relationships.
Between Operator
selects values within a given range. The values can be numbers, text, or dates.
Like operator
Used in a WHERE clause to search for a specified pattern in a column; % and _
ORDER BY
is used to sort the result-set in ascending or descending order.
JOINS
a way to combine rows from two or more tables based on a related column between them. It allows you to pull together data that’s spread across different tables into one combined result.
INNER JOIN
combines rows from two tables where there is a matching value in a specific column in both tables. It only shows results where there’s a match in both tables.
FULL JOIN
brings together everything from both tables, showing all matches and including any rows that don’t match.
LEFT join
includes everything from the left table and only matching data from the right table, with empty spots if there’s no match.
RIGHT join
includes everything from the right table and only matching data from the left table, with empty spots if there’s no match.
Equijoin
compares columns of two table with the = operator
non-equijoin
compares columns with < and >