SELECT DECK 1 Flashcards
What is the shorthand form of the DESCRIBE command?
DESC
What is the name of the generic all-purpose table belonging to the SYS schema?
DUAL
Do blank spaces count as NULL?
No. NULL is only an absence of data.
What three relational concepts are present in the SELECT statement?
PROJECT, SELECTION, and JOINING.
PROJECTION refers to what?
PROJECTION refers to the restriction of columns selected from a table.
SELECTION refers to what?
SELECTION refers to the restriction of rows selected from a table.
The relational concept JOIN refers to what?
JOIN refers to the interaction of tables with each other in a query.
What are the two mandatory clauses in an SQL query?
The SELECT clause and the FROM clause.
What is an ALIAS?
An alternate name for referencing a column or expression.
How do you eliminate duplicate results from a query?
Include the DISTINCT keyword.
In what clause is the DISTINCT keyword used?
In the SELECT clause.
In Oracle, how do you specify which terms are affected by DISTINCT?
DISTINCT refers to the values listed after it and before the FROM clause.
What operations may be used on DATE or TIMESTAMP values?
Addition and subtraction only.
The process of modeling data into relational tables is known as…?
Normalization.
In Normalization, what is the First Normal Form?
Removal of repeating groups
In Normalization, what is the Second Normal Form?
Removal of columns that are not dependent on the primary key.
In Normalization, what is the Third Normal Form?
Removal of all columns that are interdependent.
In standard notation for text description of a table, what symbol is used for primary key columns?
A hash symbol (#)
In standard notation for text description of a table, what symbol is used for foreign key columns?
A backslash ()
In standard notation for text description of a table, what symbol is used for mandatory (NOT NULL) columns?
An asterisk (*)
In standard notation for text description of a table, what symbol is used for optional columns?
A lower-case letter “O” (o)
How many Normal Forms exist for Normalization?
At least five, but only the first three are normally used.
What is an Entity-Relationship diagram?
A graphical representation of the connections between tables.
Are SQL commands case-sensitive?
No.
Is a statement terminator required?
Not always, but it’s a good idea to include one anyway.
What is the definition of a primary key?
It’s an attribute (or attributes) that uniquely identify a record.
What is the definition of a foreign key?
It’s a column (or concat of several columns) that uniquely identify a related row in another rtable.
A foreign key in one table will match . . . in another table.
a primary key
The basis of the many-to-one relationship is . . .
the foreign key.
How is an ALIAS created?
Either list it immediately after the referenced column, or use the AS keyword.
What format is returned for an unquoted alias?
Unquoted aliases are upper case.
To specify case or use spaces in an ALIAS, you must . . .
surround the alias with double quotes.
What is the concat operator?
The double-pipe ( || ).
How do you specify a char literal?
With single quote marks.
When are single quote marks used?
To specify a char literal.
How do you specify a single quote in a literal string?
Use a double quote, as in ‘That is Dippy’’s calculator’
What is a literal quote?
a lower-case q, followed by a single quote, followed by the char you want to use to indicate a quote mark, as in SELECT q’X
Do any rational people use literal quotes?
Of course not. But you might run into them sometime, so you should know what they are.
NULL refers to . . .
an absence of data.
Any arithmetic calculation with a NULL value returns . . .
NULL.
Division by zero results in an error. Division by NULL results in
NULL.
When a NULL value is encountered by the concat operator . . .
it is ignored.
The WHERE clause in a SELECT statement is sometimes referred to as . . .
the predicate.