Chapter 1 and 2 Databases and SQL
A table is which of the following? (Choose all that apply.) A. A schema object B. A nonschema object C. A role D. All of the above
A
When transforming an ERD into a relational database, you often use an entity to build a database's: A. Table B. Column C. Attribute D. Relationship
A
Which of the following are valid CREATE TABLE statements? (Choose three.) A. CREATE TABLE $ORDERS (ID NUMBER, NAME VARCHAR2(30)); B. CREATE TABLE CUSTOMER_HISTORY (ID NUMBER, NAME VARCHAR2(30)); C. CREATE TABLE "Boat Inventory" (ID NUMBER, NAME VARCHAR2(30)); D. CREATE TABLE workSchedule (ID NUMBER, NAME VARCHAR2(30));
B, C, D
What can you use to submit SQL statements for execution? (Choose all that apply) A. PHP B. Java C. SQL Developer D. SQL*Plus
A, B, C, D
Which of the following options can be used with the reserved word CREATE to form the beginning of a complete SQL statement? (Choose three.) A. TABLE B. VIEW C. CONSTRAINT D. SEQUENCE
A, B, D
A CONSTRAINT is assigned to which of the following? (Choose all that apply.) A. TABLE B. SYNONYM C. SEQUENCE D. INDEX
A
Which of the following is true about ROLES? A. Roles are schema objects but only when created from within a user account. B. Roles are in the same namespace as CONSTRAINTS. C. Roles are in the same namespace as TABLES. D. Roles are in the same namespace as USERS.
D
The DESC command can be used to do which of the following? A. Show a table's columns and the data types of those columns B. Show a brief paragraph describing what the table does C. Show a table's name and who created it D. Show the data that is contained within a table
A
Which of the following can be used to remove data from a table? (Choose two.) A. DELETE B. UPDATE C. MODIFY D. ALTER
A, B
What can DDL be used for? (Choose three.) A. Add comments to a database table B. Add columns to a database table C. Add data to a database table D. Add privileges for a user to a database table
A, B, C
Which of the following are schema objects? A. SEQUENCE B. PASSWORD C. INDEX D. ROLE
A, C
The difference between dropping a column from a table with DROP and setting a column to be UNUSED is: A. An UNUSED column can be recovered. B. The UNUSED column and its data are retained within the table's storage allocation and counts against the total limit on the number of columns the table is allowed to have. C. A column that is dropped with DROP no longer appears within the table's description as shown with the DESC or DESCRIBE statement, whereas a column that is set to UNUSED still appears in the table's structure as shown in the output of the DESC statement. D. Nothing
B
Which of the following SQL statements creates a table that will reject attempts to INSERT a row with NULL values entered into the POSITION_ID column? A. CREATE TABLE POSITIONS (POSITION_ID NUMBER(3), CONSTRAINT POSITION_CON UNIQUE (POSITION_ID)); B. CREATE TABLE POSITIONS (POSITION_ID NUMBER(3), CONSTRAINT POSITION_CON PRIMARY KEY (POSITION_ID)); C. CREATE TABLE POSITIONS (POSITION_ID NUMBER(3), CONSTRAINT POSITION_CON REQUIRED (POSITION_ID)); D. None of the above.
B
Which of the following is NOT a capability of the SELECT statement? A. It can transform queried data and display the results B. It can remove data from a table C. It can join data from multiple tables D. It can aggregate database data
B
Which one of the following is a DML statement? A. ADD B. ALTER C. UPDATE D. MODIFY
C
You have a single database, with only one schema. The following four objects exist in the database: - A TABLE named PRODUCT_CATALOG - A TABLE named ADS - A USER named PRODUCT_CATALOG - A VIEW named CONFERENCE_SCHEDULE How many of the four objects are owned by the schema? A. 0 B. 2 C. 3 D. 4
C
What can a SELECT statement be used to query? (Choose the best answer.) A. Only one report B. Only one table C. One or more reports D. One or more tables
D
Review the following SQL statement: CREATE TABLE personnel (personnel_ID NUMBER(6), division_ID NUMBER(6), CONSTRAINT personnel_ID_PK PRIMARY KEY (personnel_ID), CONSTRAINT division_ID_PK PRIMARY KEY (division_ID)); Assume there is no table already called PERSONNEL in the database. What will be the result of an attempt to execute the preceding SQL statement? A. The statement will fail because you cannot create two primary key constraints on the table. B. The statement will successfully create the table and the first primary key but not the second. C. The statement will successfully create a single table and one composite primary key consisting of two columns. D. The statement will successfully create the table and two primary keys.
A
Which of the following is true of SQL? A. It is most commonly used language for interacting with a database. B. It is the only language you can use to create a database. C. It is the only language you can use to interact with a database. D. None of the above.
A
The following SQL statements create a table with a column named A, then add a row to that table, then query the table: CREATE TABLE NUMBER_TEST (A NUMBER(5,3)); INSERT INTO NUMBER_TEST (A) VALUES (3.1415); SELECT A FROM NUMBER TEST; What is the displayed output of the SELECT statement? A. 3.1415 B. 3.142 C. 3.141 D. None of the above.
B
The unique identifier of a row in a database table is a(n): A. ID B. Primary key C. Primary column D. Column
B
What is one of the purposes of DDL? (Choose the best answer.) A. Query data from a given table B. Issue privileges to users C. Remove existing data from a database table D. None of the above
B
You attempt to execute the following SQL statement: CREATE TABLE VENDORS (VENDOR_ID NUMBER, VENDOR_NAME VARCHAR2, CATEGORY CHAR); Which one of the following is true? A. The execution fails because there is no precision indicated for NUMBER. B. The execution fails because there is no precision indicated for VARCHAR2. C. The execution fails because there is no precision indicated for CHAR. D. The execution succeeds, and the table is created.
B
Review the following SQL statement: CREATE TABLE shipping_Order (order_ID NUMBER, order_YEAR CHAR(2), customer_ID NUMBER, CONSTRAINT shipping_Order PRIMARY KEY (order_ID, order_Year)); Assume there is no table already called SHIPPING_ORDER in the database. What will be the result of an attempt to execute the preceding SQL statement? A. The statement will fail because the data type for ORDER_YEAR is CHAR, and CHAR data types aren't allowed in PRIMARY KEY constraint. B. The statement will fail because there is no precision for the ORDER_ID column's data type. C. The table will be created, but the primary key constraint will not be created because the name does not include the _PK suffix. D. The statement will succeed: the table will be created, and the primary key will also be created.
D
The purpose of the CREATE DICTIONARY statement is to create a named object in the database: A. That lists names of user accounts that have external privileges B. That contains lookup reference material for queries C. That identifies that root directory of the Oracle server installation D. That points to a dictionary you choose somewhere within the Oracle server's file system.
D
You are logged in to user FINANCE. It is currently the only schema in the entire database. The following exist in the database: - A VIEW named VENDORS - A CONSTRAINT named VENDORS - An INDEX named CUSTOM#ADDRESS You attempt to execute the following SQL statement: CREATE TABLE CUSTOM#ADDRESS (ID NUMBER, NAME VARCHAR2(30)); Which one of the following is true? A. The question is flawed because you cannot have an INDEX named CUSTOM#ADDRESS. B. The question is flawed because you cannot have a VIEW and a CONSTRAINT with identical names in the same schema. C. The SQL statement will fail to execute and result an error message because you cannot create a TABLE name with the # character. D. The SQL statement will fail to execute and result in error message because you cannot create a TABLE that has the same name as an INDEX in the same schema. E. The SQL statement will execute, and the TABLE will be created.
E