Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CHAPTER 2
- A field is another term for a(n) ____.
- Select one:
- a.
- column
- A record is another term for a(n) ____.
- Select one:
- a.
- row
- A(n) ____ is the association between entities.
- Select one:
- a.
- relationship
- There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.
- Select one:
- c.
- parentheses
- Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) table?
- Select one:
- a.
- ORDER_NUM and ITEM_NUM
- ____ is the duplication of data.
- Select one:
- d.
- Redundancy
- A primary key always comprises a single column.
- Select one:
- False
- An unnormalized relation is a relation that may contain repeating groups.
- Select one:
- True
- Because there is a one-to-many relationship between sales reps and customers in the TAL Distributors database, one sales rep can be associated with zero, one, or more customers.
- Select one:
- True
- The statement "A sales rep's pay class functionally determines his or her pay rate" means that if you know the pay class, you can determine the pay rate.
- Select one:
- True
- CHAPTER 3
- A ____ file is a text file with a .sql extension that contains SQL commands.
- Select one:
- c.
- script
- For any column whose data type is CHAR, values must be enclosed in ____.
- Select one:
- a.
- single quotation marks
- In SQL, table names cannot exceed ____ characters.
- Select one:
- c.
- 30
- The ____ command defines a table's structure by listing its columns, data types, and column lengths.
- Select one:
- a.
- CREATE TABLE
- The ____ data type is used to store integers.
- Select one:
- a.
- INT
- The ____ data type stores only the actual character string.
- Select one:
- d.
- VARCHAR
- To delete an entire table, use the ____ command and then re-create the table.
- Select one:
- b.
- DROP TABLE
- To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.
- Select one:
- a.
- asterisk
- When a script file contains more than one command, each command must end with a(n) ____.
- Select one:
- a.
- semicolon
- Which of the following commands changes the value in a column?
- Select one:
- c.
- UPDATE
- Which of the following is a valid name for a table?
- Select one:
- b.
- TBL_1
- You indicate the end of a command by typing a ____.
- Select one:
- b.
- semicolon
- Dropping a table also deletes any data that you entered into the table.
- Select one:
- True
- In SQL Server, execute the sp_columns command to list all the columns in a table.
- Select one:
- True
- Table names cannot contain spaces.
- Select one:
- True
- The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.
- Select one:
- True
- The data type indicates the type of data that a column can contain.
- Select one:
- True
- To change a value in a table, use the CHANGE command.
- Select one:
- False
- To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.
- Select one:
- False
- To list all the columns in a table, use the LIST COLUMNS command.
- Select one:
- False
- CHAPTER 4
- In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.
- Select one:
- a.
- %
- In the SELECT clause, you can use the ____ symbol to indicate that you want to include all columns.
- Select one:
- a.
- *
- Preceding a condition by the ____ operator reverses the truth of the original condition.
- Select one:
- b.
- NOT
- The basic form of the SQL SELECT command is ____.
- Select one:
- a.
- SELECT-FROM-WHERE
- The ____ clause is used to restrict the groups that will be included in a query result.
- Select one:
- c.
- HAVING
- The ____ function calculates a total of the values in a column.
- Select one:
- b.
- SUM
- The ____ function determines the number of rows in a table.
- Select one:
- b.
- COUNT
- The ____ operator is inclusive, meaning that a value equal to either end would be selected.
- Select one:
- d.
- BETWEEN
- The ____ operator uses one or more wildcard characters to test for a pattern match.
- Select one:
- b.
- LIKE
- You use the ____ clause to list data in a specific order.
- Select one:
- d.
- ORDER BY
- A query is a question represented in a way that the DBMS can understand.
- Select one:
- True
- All SELECT statements require a WHERE clause.
- Select one:
- False
- An arithmetic column is a column that does not exist in the database but can be computed using data in existing columns.
- Select one:
- False
- It is possible to place one query inside another.
- Select one:
- True
- The GROUP BY clause sorts the data in a particular order.
- Select one:
- False
- The MIN function determines the minimum value in a column.
- Select one:
- True
- The WHERE clause is used to retrieve rows that satisfy some condition.
- Select one:
- True
- To specify that query results be listed in a specific order, use the SORT BY clause.
- Select one:
- False
- When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.
- Select one:
- True
- You cannot assign names to computed columns.
- Select one:
- False
- MIDTERM
- At TAL Distributors, there is a ____ relationship between sales reps and customers.
- Select one:
- c.
- one-to-many
- There is a commonly accepted shorthand representation to show the structure of a relational database: After the name of the table, all the columns in the table are listed within a set of ____.
- Select one:
- d.
- parentheses
- Which of the following is the primary key of the ORDER_LINE (ORDER_NUM, ITEM_NUM, NUM_ORDERED, QUOTED_PRICE) table?
- Select one:
- c.
- ORDER_NUM and ITEM_NUM
- ____ can occur when there is a column in a table that is dependent on only a portion of the primary key.
- Select one:
- b.
- Update anomalies
- ____ is the duplication of data.
- Select one:
- d.
- Redundancy
- A primary key always comprises a single column.
- Select one:
- False
- An unnormalized relation is a relation that may contain repeating groups.
- Select one:
- True
- Because there is a one-to-many relationship between sales reps and customers in the TAL Distributors database, one sales rep can be associated with zero, one, or more customers.
- Select one:
- True
- Each column in a table of a relational database should have a distinct name.
- Select one:
- True
- In a relational database, relationships are implemented by having common columns in two or more tables.
- Select one:
- True
- For any column whose data type is CHAR, values must be enclosed in ____.
- Select one:
- c.
- single quotation marks
- In SQL, table names cannot exceed ____ characters.
- Select one:
- b.
- 30
- The correct data type for the BALANCE column in the CUSTOMER table is ____.
- Select one:
- c.
- DECIMAL
- The ____ command defines a table's structure by listing its columns, data types, and column lengths.
- Select one:
- a.
- CREATE TABLE
- The ____ data type is used to store integers.
- Select one:
- b.
- INT
- The ____ data type stores only the actual character string.
- Select one:
- b.
- VARCHAR
- To delete an entire table, use the ____ command and then re-create the table.
- Select one:
- c.
- DROP TABLE
- To display all the rows and columns in a table, type the word SELECT, followed by a(n) ____, followed by the word FROM and then the name of the table containing the data you want to view.
- Select one:
- c.
- asterisk
- Use the ____ data type for columns that contain letters and special characters and for columns containing numbers that will not be used in calculations.
- Select one:
- c.
- CHAR
- Which of the following commands changes the value in a column?
- Select one:
- b.
- UPDATE
- Which of the following is a valid name for a table?
- Select one:
- d.
- TBL_1
- You indicate the end of a command by typing a ____.
- Select one:
- b.
- semicolon
- Dropping a table also deletes any data that you entered into the table.
- Select one:
- True
- If you added a row that should not be in a table, use a REMOVE command to remove it.
- Select one:
- False
- In SQL Server, execute the sp_columns command to list all the columns in a table.
- Select one:
- True
- Table names cannot contain spaces.
- Select one:
- True
- The data type DECIMAL(5,2) represents a number with three places to the left and two places to the right of the decimal.
- Select one:
- True
- The data type indicates the type of data that a column can contain.
- Select one:
- True
- To create a table, type the command DESCRIBE TABLE followed by the name of the table to be created and then by the names and data types of the columns that will comprise the table.
- Select one:
- False
- To list all the columns in a table, use the LIST COLUMNS command.
- Select one:
- False
- In SQL for Oracle and for SQL Server, the ____ symbol is used as a wildcard to represent any collection of characters.
- Select one:
- a.
- %
- In SQL, you use the ____ command to query a database.
- Select one:
- d.
- SELECT
- In the SELECT clause, you can use the ____ symbol to indicate that you want to include all columns.
- Select one:
- d.
- *
- Preceding a condition by the ____ operator reverses the truth of the original condition.
- Select one:
- b.
- NOT
- The basic form of the SQL SELECT command is ____.
- Select one:
- d.
- SELECT-FROM-WHERE
- The ____ clause is used to restrict the groups that will be included in a query result.
- Select one:
- b.
- HAVING
- The ____ clause lets you group data on a particular column.
- Select one:
- a.
- GROUP BY
- The ____ operator is inclusive, meaning that a value equal to either end would be selected.
- Select one:
- b.
- BETWEEN
- The ____ operator uses one or more wildcard characters to test for a pattern match.
- Select one:
- d.
- LIKE
- When you use the ____ function, you can use the asterisk (*) to represent any column.
- Select one:
- d.
- COUNT
- You use the ____ clause to list data in a specific order.
- Select one:
- d.
- ORDER BY
- A query is a question represented in a way that the DBMS can understand.
- Select one:
- True
- After the word FROM in a SELECT statement, you list any conditions (restrictions) that apply to the data you want to retrieve.
- Select one:
- False
- All SELECT statements require a WHERE clause.
- Select one:
- False
- In a nested query, the outer query is evaluated first.
- Select one:
- False
- The UNIQUE operator eliminates duplicate values in a query.
- Select one:
- False
- The WHERE clause applies to both rows and groups.
- Select one:
- False
- To sort records in descending order, follow the name of the sort key with the REVERSE operator.
- Select one:
- False
- When the OR operator connects simple conditions, the compound condition will be true whenever any one of the simple conditions is true.
- Select one:
- True
- When you connect two or more simple conditions with the AND operator, each condition must be listed on a separate line.
- Select one:
- False
- CHAPTER 5
- If you precede the subquery by the ____ operator, the condition is true only if it satisfies all values produced by the subquery.
- Select one:
- b.
- ALL
- If you precede the subquery by the ____ operator, the condition is true only if it satisfies any value (one or more) produced by the subquery.
- Select one:
- c.
- ANY
- In a ____, all rows from the table on the left (the table listed first in the query) will be included regardless of whether they match rows from the table on the right (the table listed second in the query).
- Select one:
- c.
- left outer join
- In a(n) ____ join, all rows from both tables are included regardless of whether they match rows from the other table.
- Select one:
- a.
- full outer
- To qualify a column name, precede the name of the column with the name of the table, followed by a(n) ____.
- Select one:
- b.
- period (.)
- You can precede a subquery with the ____ operator to create a condition that is true if one or more rows are obtained when the subquery is executed.
- Select one:
- d.
- EXISTS
- In a full outer join, all rows from both tables will be included regardless of whether they match rows from the other table.
- Select one:
- True
- One reason for using an alias is when you are joining a table to itself.
- Select one:
- True
- When the innermost subquery is evaluated, a permanent table is produced.
- Select one:
- False
- You can join tables by using a condition in the WHERE clause.
- Select one:
- True
- CHAPTER 6
- If you have not run the COMMIT command, executing the ____ command will reverse all updates made during the current work session.
- Select one:
- a.
- ROLLBACK
- If you specified ____ for a column when you created a table, then changing a value in a column to null is prohibited.
- Select one:
- c.
- NOT NULL
- The ____ command is permanent.
- Select one:
- c.
- COMMIT
- To delete rows from the database, use the ____ command.
- Select one:
- d.
- DELETE
- What happens if you run a DELETE command that does not contain a WHERE clause?
- Select one:
- d.
- All rows will be deleted from the table.
- Which of the following commands executes a rollback?
- Select one:
- a.
- ROLLBACK;
- Which of the following is a valid SQL command?
- Select one:
- d.
- COMMIT;
- Which of the following is a valid SQL command?
- Select one:
- a.
- DROP TABLE LEVEL1_CUSTOMER;
- You can use the ____ clause of the ALTER TABLE command to change a column that currently rejects null values so that it will accept null values.
- Select one:
- c.
- MODIFY
- You can use the ____ command to create a new table using data in an existing table.
- Select one:
- b.
- CREATE TABLE
- In some cases, you might need to change a table's structure in ways that are beyond the capabilities of your DBMS. When that happens, use the RESTRUCTURE command to redesign the table.
- Select one:
- False
- In SQL Server, execute the sp_columns command to list all the columns in a table.
- Select one:
- True
- In SQL Server, the word NULL appears in the results when a column contains a null value.
- Select one:
- True
- It is a good idea to use a SELECT command to display the data you changed to verify that the correct update was made.
- Select one:
- True
- The command, CREATE TABLE AS LEVEL1_CUSTOMER USING CUSTOMER; creates a table called LEVEL1_CUSTOMER that has the same structure as CUSTOMER.
- Select one:
- False
- The DROP TABLE command creates an empty table.
- Select one:
- False
- When necessary, include a WHERE clause into the UPDATE command to indicate the column on which the change is to take place.
- Select one:
- False
- When you add a new column to a table, the default for Oracle, SQL Server, and Access is to accept null values.
- Select one:
- True
- You can use the existing value in a column and a calculation to update a value.
- Select one:
- True
- You cannot commit and roll back data in SQL Server.
- Select one:
- False
- CHAPTER 7
- A view is updatable when it is derived from joining two base tables on the ____ of each table.
- Select one:
- d.
- primary key
- The command to delete a view is ____.
- Select one:
- a.
- DROP VIEW
- The correct command to allow user Thompson to delete rows in the CUSTOMER table would be:
- GRANT ____ ON CUSTOMER TO THOMPSON.
- Select one:
- c.
- DELETE
- The CREATE VIEW command includes the words CREATE VIEW, followed by the name of the view, the word ____, and then a query.
- Select one:
- c.
- AS
- The database administrator uses the ____ command to revoke privileges from users.
- Select one:
- b.
- REVOKE
- The general form for assigning a foreign key is ADD FOREIGN KEY, the column name(s) of the foreign key, the ____ clause, and then the table name that the foreign key must match.
- Select one:
- b.
- REFERENCES
- The main mechanism for providing access to a database is the ____ command.
- Select one:
- a.
- GRANT
- The privilege ____ can be granted to change data.
- Select one:
- a.
- UPDATE
- The privilege ____ can be granted to change the table structure.
- Select one:
- b.
- ALTER
- The privilege ____ can be granted to retrieve data.
- Select one:
- d.
- SELECT
- Which of the following commands deletes an index?
- Select one:
- b.
- DROP INDEX
- A view can join two or more tables.
- Select one:
- True
- A view cannot involve statistics.
- Select one:
- False
- An index makes certain types of retrieval more efficient.
- Select one:
- True
- If the database structure changes, the user cannot access and use the view.
- Select one:
- False
- Normally, when the database administrator grants a particular privilege to a user, the user cannot pass that privilege along to other users.
- Select one:
- True
- The DROP VIEW command removes the tables and data on which the view is based.
- Select one:
- False
- The GRANT command to indicate that a user has all privileges includes the FULL privilege.
- Select one:
- False
- Views furnish a certain amount of security; if users are accessing the database through a view, they cannot access any data that is not included in the view.
- Select one:
- True
- Views provide data validation.
- Select one:
- False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement