SQL Flashcards
Structured Query Language
Simple programming language with less than 100 words syntax which is used to manipulate data stored in a database. It gets its name from the specific order in which queries and subqueries are given and executed.
INSERT
Adding table rows. Can violate key constraints, including:
Primary key entered that already exists
Primary key is null
Foreign key entered that does not correspond to a primary key in another table
COMMIT
Saving table changes
SELECT
Listing table rows
UPDATE
Updating table rows, modify data in table using UPDATE SET WHERE
Changes specific data within a table/database (cr: ALTER)
ROLLBACK
Restoring table contents to state prior to changes (since last COMMIT)
DELETE
Deleting table rows
INSERT + SELECT
Inserting table rows with a select subquery, copying rows from one table into another
NULL
Used with INSERT when a cell value is missing
FROM
applies query to specific table within database
WHERE
used to apply conditional restrictions
=
equal to
>
greater than
less than
> =
greater than or equal to
<=
less than or equal to
<> or !=
not equal to
SELECT
FROM
WHERE
Select with: equality comparisons, not equal to, restriction, comparison on characters, date comparison, statement with a computed column, statement with computed column and an alias,
Arithmetic Operators: The Rule of Precedence(which operator goes first ?)
Perform operations within parentheses
Perform power operations
Perform multiplications and divisions
Perform additions and subtractions
OR/AND/NOT
Logical operator. Used in conditional expressions
BETWEEN
special operator. checks whether an attribute value is within a range
IS NULL
special operator. checks whether an attribute value is null