Ch. 1 Flashcards
Which of the following Oracle tools can be used to execute SQL statements against a database?
- SQL Developer
- SQL*Plus command line
- SQL Language Reference Manual
- SQL Live
- SQL Developer
- SQL*Plus command line
- SQL Live
The relational model consists of which of the following. Choose all that are true:
- Primary and foreign keys
- Collection of tables
- Data integrity for accuracy and consistency
- Set of operators to act on the relations, called the relational algebra
All are true
What are a primary key’s identifying characteristics? (select all that apply)
- it uniquely identifies each row
- it consists of only one column
- it cannot be null
- it must be numeric
- it uniquely identifies each row
- it cannot be null
Which of the following is not required to form a syntactically correct SELECT statement?
- SELECT
- a valid table name
- FROM
- a valid column name
- a valid column name
Which of the following are not part of SQL? select all that apply
- if..then..else selection
- COMMIT
- ROLLBACK
- DO..WHILE loop
- FOR..NEXT loop
- if..then..else selection
- DO..WHILE loop
- FOR..NEXT loop
Which component(s) of the following query is/are a literal (select all that apply):
SELECT order_id || ‘-‘ || line_item_id || ‘ ‘ || quantity “Purchase”
FROM line_item;
- “Purchase”
- ‘ ‘
-‘-‘
- ||
- ’ ‘
- ’-‘
The SHIPS table has two columns: SHIP_ID and SHIP_NAME
Which of the following SELECT statements will produce a syntax error? (Choose two.)
- SELECT ship_id, ship_id FROM SHIPS;
- SELECT FROM ships;
- SELECT (ship_id, ship_name) FROM ships;
- SELECT 1 + 2 FROM ships;
- SELECT FROM ships;
- SELECT (ship_id, ship_name) FROM ships;
Which of the following are valid datatypes in Oracle SQL? select all that apply
- VARCHAR2
- CHAR
- VARCHAR2(50)
- CHAR(12)
- CHAR
- VARCHAR2(50)
- CHAR(12)
Which of the following are string literals? select all that apply
- ‘Hogwarts School of Witchcraft and Wizardry’
- ‘975 *==+’
- NULL
- Harry Potter
- ‘Hogwarts School of Witchcraft and Wizardry’
- ‘975 *==+’
SQL is case sensitive, so you must capitalize all keywords, such as SELECT and FROM.
- True
- False
False
What is the dummy table called in Oracle
DUAL
A table consists of ..
- Rows and columns, primary key, and possibly foreign keys
- Names and statements
- many-to-many relationship
- relationships such as one-to-many
- Rows and columns, primary key, and possibly foreign keys
For the datatype NUMBER(5,2) which of the following numbers would NOT work?
- 3344.56
- 176
- 95.78
- 8.7
- 3344.56
Which of the folllowing would you use to concatenate two strings together?
- &
- |
- ||
- +
- ||
What keyword is used to eliminate duplicate rows in query’s output?
- UNIQUE
- DISTINCT
- DIFFERENT
- DUPLICATE
- DISTINCT