Midterm Flashcards
Definition: A logical collection of database objects
Schema
What keyword eliminated duplicates?
DISTINCT
What is the maximum number of columns you can ORDER BY?
246
By default, ORDER BY is ________
Ascending
What keyword is used to create an alias?
AS
T/F: SQL is not case sensitive.
TRUE
What is the default format for dates?
YYYY-MM-DDTHH:MM:SS:FF
What function returns the current date timestamp?
GetDate()
What keyword is used to find data from one date to another?
BETWEEN
If you want to avoid using multiple OR statements, what keyword can be use?
IN
ex. WHERE province IN (‘ON’, ‘BC’)
What operator is “not equals”
<> OR !=
Which keyword is used when specifying a pattern?
LIKE
When using LIKE, what does the % mean?
Any number of characters
How do you test for NULL?
The keyword IS
ex. IS NULL
ex. IS NOT NULL
What order are logical operators tested in?
NOT, AND, OR
What is returned if you omit an INNER JOIN or an EQUI-JOIN?
Cartesian Product
ex. FROM products, customers
Why is it bad to use an equality join?
Ambiguity leads to weird results
What keyword can be used to find the cartesian product?
CROSS JOIN