Selasa, 21 Juni 2016
Database Programming with SQL-Section 13 Quiz
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
1. A column that will be used to store binary data up to 4 Gigabytes in size should be defined as which datatype? Mark for Review
(1) Points
BLOB (*)
LONG
NUMBER
LONGRAW
Correct Correct
2. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
(1) Points
DATE
VARCHAR2
CHAR
NUMBER (*)
Incorrect Incorrect. Refer to Section 13 Lesson 2.
3. The ELEMENTS column is defined as:
NUMBER(6,4)
How many digits to the right of the decimal point are allowed for the ELEMENTS column?
Mark for Review
(1) Points
Four (*)
Zero
Six
Two
Correct Correct
4. Evaluate this CREATE TABLE statement:
CREATE TABLE sales
( sales_id NUMBER(9),
customer_id NUMBER(9),
employee_id NUMBER(9),
description VARCHAR2(30),
sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
sale_amount NUMBER(7,2));
Which business requirement will this statement accomplish?
Mark for Review
(1) Points
All employee identification values are only 6 digits so the column should be variable in length.
Today's date should be used if no value is provided for the sale date. (*)
Sales identification values could be either numbers or characters, or a combination of both.
Description values can range from 0 to 30 characters so the column should be fixed in length.
Correct Correct
5. Which of the following are valid Oracle datatypes? Mark for Review
(1) Points
DATE, TIMESTAMP WITH LOCAL TIME ZONE, BLOB (*)
DATE, BLOB, LOB, VARCHAR2
SYSDATE, TIMESTAMP, DATE, LOCAL TIME ZONE
TIMESTAMP, LOB, VARCHAR2, NUMBER
Correct Correct
Page 1 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
6. Your supervisor has asked you to modify the AMOUNT column in the ORDERS table. He wants the column to be configured to accept a default value of 250. The table contains data that you need to keep. Which statement should you issue to accomplish this task? Mark for Review
(1) Points
ALTER TABLE orders
MODIFY (amount DEFAULT 250);
(*)
DELETE TABLE orders;
CREATE TABLE orders
(orderno varchar2(5) CONSTRAINT pk_orders_01 PRIMARY KEY,
customerid varchar2(5) REFERENCES customers (customerid),
orderdate date,
amount DEFAULT 250)
ALTER TABLE orders
CHANGE DATATYPE amount TO DEFAULT 250;
DROP TABLE orders;
CREATE TABLE orders
(orderno varchar2(5) CONSTRAINT pk_orders_01 PRIMARY KEY,
customerid varchar2(5) REFERENCES customers (customerid),
orderdate date,
amount DEFAULT 250);
Correct Correct
7. You can use DROP COLUMN to drop all columns in a table, leaving a table structure with no columns. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
8. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
9. Evaluate the structure of the EMPLOYEE table:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
The EMPLOYEE_ID column currently contains 500 employee identification numbers. Business requirements have changed and you need to allow users to include text characters in the identification values. Which statement should you use to change this column's data type?
Mark for Review
(1) Points
You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not empty. (*)
ALTER TABLE employee
REPLACE (employee_id VARCHAR2(9));
ALTER employee TABLE
MODIFY COLUMN (employee_id VARCHAR2(15));
ALTER TABLE employee
MODIFY (employee_id VARCHAR2(9));
Incorrect Incorrect. Refer to Section 13 Lesson 3.
10. Comments on tables and columns can be stored for documentation by: Mark for Review
(1) Points
Using the COMMENT ON TABLE or COMMENT on COLUMN (*)
Using an UPDATE statement on the USER_COMMENTS table
Embedding /* comment */ within the definition of the table.
Using the ALTER TABLE CREATE COMMENT syntax
Correct Correct
Previous Page 2 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
11. DCL, which is the acronym for Data Control Language, allows: Mark for Review
(1) Points
The ALTER command to be used.
The CONROL TRANSACTION statement can be used.
The TRUNCATE command to be used.
A Database Administrator the ability to grant privileges to users. (*)
Correct Correct
12. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
(1) Points
True (*)
False
Correct Correct
13. You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue? Mark for Review
(1) Points
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, emp_id number(10) REFERENCES employees (emp_id));
(*)
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, t.emp_id = e.emp_id);
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, JOIN emp_id number(10) ON employees (emp_id));
CREATE TABLE travel
(destination_id primary key, departure_date date, return_date date, emp_id REFERENCES employees (emp_id));
Correct Correct
14. Which statement about table and column names is true? Mark for Review
(1) Points
If any character other than letters or numbers is used in a table or column name, the name must be enclosed in double quotation marks.
Table and column names cannot include special characters.
Table and column names can begin with a letter or a number.
Table and column names must begin with a letter. (*)
Incorrect Incorrect. Refer to Section 13 Lesson 1.
15. Evaluate this CREATE TABLE statement:
1. CREATE TABLE customer#1 (
2. cust_1 NUMBER(9),
3. sales$ NUMBER(9),
4. 2date DATE DEFAULT SYSDATE);
Which line of this statement will cause an error?
Mark for Review
(1) Points
1
4 (*)
3
2
Incorrect Incorrect. Refer to Section 13 Lesson 1.
Previous Page 3 of 3 Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
1. To completely get rid of a table, its contents, its structure, AND release the storage space the keyword is: Mark for Review
(1) Points
DELETE
TRUNCATE
KILL
DROP (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
2. Which statement about a column is NOT true? Mark for Review
(1) Points
You can modify the data type of a column if the column contains non-null data. (*)
You can increase the width of a CHAR column.
You can convert a DATE data type column to a VARCHAR2 column.
You can convert a CHAR data type column to the VARCHAR2 data type.
Correct Correct
3. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
4. The TEAMS table contains these columns:
TEAM_ID NUMBER(4) Primary Key
TEAM_NAME VARCHAR2(20)
MGR_ID NUMBER(9)
The TEAMS table is currently empty. You need to allow users to include text characters in the manager identification values. Which statement should you use to implement this?
Mark for Review
(1) Points
ALTER teams
MODIFY (mgr_id VARCHAR2(15));
ALTER TABLE teams
REPLACE (mgr_id VARCHAR2(15));
ALTER TABLE teams
MODIFY (mgr_id VARCHAR2(15));
(*)
ALTER teams TABLE
MODIFY COLUMN (mgr_id VARCHAR2(15));
You CANNOT modify the data type of the MGR_ID column.
Incorrect Incorrect. Refer to Section 13 Lesson 3.
5. Evaluate the structure of the EMPLOYEE table:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
Which statement should you use to increase the LAST_NAME column length to 35 if the column currently contains 200 records?
Mark for Review
(1) Points
You CANNOT increase the width of the LAST_NAME column.
ALTER TABLE employee
RENAME last_name VARCHAR2(35);
ALTER employee TABLE
ALTER COLUMN (last_name VARCHAR2(35));
ALTER TABLE employee
MODIFY (last_name VARCHAR2(35));
(*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
Page 1 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
6. Which statement about table and column names is true? Mark for Review
(1) Points
Table and column names cannot include special characters.
Table and column names must begin with a letter. (*)
Table and column names can begin with a letter or a number.
If any character other than letters or numbers is used in a table or column name, the name must be enclosed in double quotation marks.
Correct Correct
7. Given this employee table:
(employee_id NUMBER(10) NOT NULL,
first_name VARCHAR2(25) NOT NULL,
last_name VARCHAR2(30) NOT NULL,
hire_date DATE DEFAULT sysdate)
What will be the result in the hire_date column following this insert statement:
INSERT INTO employees VALUES (10, 'Natacha', 'Hansen', DEFAULT);
Mark for Review
(1) Points
The character string SYSDATE.
Statement will work and the hire_date column will have the value of the date when the statement was run. (*)
The column for hire_date will be null.
Statement will fail, as you must list the columns into which you are inserting.
Incorrect Incorrect. Refer to Section 13 Lesson 1.
8. You want to create a database table that will contain information regarding products that your company released during 2001. Which name can you assign to the table that you create? Mark for Review
(1) Points
PRODUCTS--2001
PRODUCTS_2001 (*)
2001_PRODUCTS
PRODUCTS_(2001)
Incorrect Incorrect. Refer to Section 13 Lesson 1.
9. Which of the following SQL statements will create a table called Birthdays with three columns for storing employee number, name and date of birth? Mark for Review
(1) Points
CREATE table BIRTHDAYS (EMPNO, EMPNAME, BIRTHDATE);
CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Birthdate DATE); (*)
CREATE table BIRTHDAYS (employee number, name, date of birth);
CREATE TABLE Birthdays (Empno NUMBER, Empname CHAR(20), Date of Birth DATE);
Incorrect Incorrect. Refer to Section 13 Lesson 1.
10. Which statement about creating a table is true? Mark for Review
(1) Points
With a CREATE TABLE statement, a table will always be created in the current user's schema.
If no schema is explicitly included in a CREATE TABLE statement, the CREATE TABLE statement will fail.
If a schema is explicitly included in a CREATE TABLE statement and the schema does not exist, it will be created.
If no schema is explicitly included in a CREATE TABLE statement, the table is created in the current user's schema. (*)
Incorrect Incorrect. Refer to Section 13 Lesson 1.
Previous Page 2 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
11. Evaluate this CREATE TABLE statement:
CREATE TABLE sales
(sales_id NUMBER,
customer_id NUMBER,
employee_id NUMBER,
sale_date TIMESTAMP WITH TIME ZONE,
sale_amount NUMBER(7,2));
Which statement about the SALE_DATE column is true?
Mark for Review
(1) Points
Data stored will not include seconds.
Data will be normalized to the client time zone.
Data will be stored using a fractional seconds precision of 5.
Data stored in the column will be returned in the database's local time zone. (*)
Incorrect Incorrect. Refer to Section 13 Lesson 2.
12. Evaluate this CREATE TABLE statement:
CREATE TABLE sales
( sales_id NUMBER(9),
customer_id NUMBER(9),
employee_id NUMBER(9),
description VARCHAR2(30),
sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
sale_amount NUMBER(7,2));
Which business requirement will this statement accomplish?
Mark for Review
(1) Points
Sales identification values could be either numbers or characters, or a combination of both.
Description values can range from 0 to 30 characters so the column should be fixed in length.
Today's date should be used if no value is provided for the sale date. (*)
All employee identification values are only 6 digits so the column should be variable in length.
Incorrect Incorrect. Refer to Section 13 Lesson 2.
13. The BLOB datatype can max hold 128 Terabytes of data. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
14. The SPEED_TIME column should store a fractional second value.
Which data type should you use?
Mark for Review
(1) Points
DATETIME
TIMESTAMP (*)
DATE
INTERVAL DAY TO SECOND
Incorrect Incorrect. Refer to Section 13 Lesson 2.
15. To store large amounts of text you should simply create a series of VARCHAR2 columns in a table. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 2.
Previous Page 3 of 3 Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
1. Evaluate this statement:
ALTER TABLE inventory
MODIFY backorder_amount NUMBER(8,2);
Which task will this statement accomplish?
Mark for Review
(1) Points
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8 2)
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(2,8)
Alters the definition of the BACKORDER_AMOUNT column to NUMBER
Changes the definition of the BACKORDER_AMOUNT column to NUMBER(8,2) (*)
Alters the definition of the BACKORDER_AMOUNT column to NUMBER(8.2)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
2. RENAME old_name to new_name can be used to: Mark for Review
(1) Points
Rename a row.
Rename a column.
Rename a table. (*)
All of the above.
Incorrect Incorrect. Refer to Section 13 Lesson 3.
3. The previous administrator created a table named CONTACTS, which contains outdated data. You want to remove the table and its data from the database. Which statement should you issue? Mark for Review
(1) Points
DELETE
ALTER TABLE
TRUNCATE TABLE
DROP TABLE (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
4. A column's data type can always be changed from NUMBER to VARCHAR2 but not from VARCHAR2 to NUMBER, provided the table is empty. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
5. You need to change the name of the EMPLOYEES table to the EMP table. Which statement should you use? Mark for Review
(1) Points
RENAME employees emp;
ALTER TABLE employees TO emp;
ALTER TABLE employees RENAME TO emp;
RENAME employees TO emp; (*)
Correct Correct
Page 1 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
6. Evaluate this CREATE TABLE statement:
CREATE TABLE sales
( sales_id NUMBER(9),
customer_id NUMBER(9),
employee_id NUMBER(9),
description VARCHAR2(30),
sale_date TIMESTAMP WITH LOCAL TIME ZONE DEFAULT SYSDATE,
sale_amount NUMBER(7,2));
Which business requirement will this statement accomplish?
Mark for Review
(1) Points
Sales identification values could be either numbers or characters, or a combination of both.
Today's date should be used if no value is provided for the sale date. (*)
Description values can range from 0 to 30 characters so the column should be fixed in length.
All employee identification values are only 6 digits so the column should be variable in length.
Incorrect Incorrect. Refer to Section 13 Lesson 2.
7. To store time with fractions of seconds, which datatype should be used for a table column? Mark for Review
(1) Points
TIMESTAMP (*)
INTERVAL YEAR TO MONTH
INTERVAL DAY TO SECOND
DATE
Incorrect Incorrect. Refer to Section 13 Lesson 2.
8. You are designing a table for the Human Resources department. This table must include a column that contains each employee's hire date. Which data type should you specify for this column? Mark for Review
(1) Points
INTERVAL YEAR TO MONTH
CHAR
DATE (*)
TIMESTAMP
Incorrect Incorrect. Refer to Section 13 Lesson 2.
9. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
(1) Points
CHAR
VARCHAR2
NUMBER (*)
DATE
Incorrect Incorrect. Refer to Section 13 Lesson 2.
10. The TIMESTAMP data type allows what? Mark for Review
(1) Points
Time to be stored as an interval of years and months.
Time to be stored as a date with fractional seconds. (*)
Time to be stored as an interval of days to hours, minutes and seconds.
None of the above.
Incorrect Incorrect. Refer to Section 13 Lesson 2.
Previous Page 2 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
11. You want to create a database table that will contain information regarding products that your company released during 2001. Which name can you assign to the table that you create? Mark for Review
(1) Points
PRODUCTS--2001
2001_PRODUCTS
PRODUCTS_(2001)
PRODUCTS_2001 (*)
Incorrect Incorrect. Refer to Section 13 Lesson 1.
12. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
(1) Points
True (*)
False
Correct Correct
13. Which column name is valid? Mark for Review
(1) Points
NUMBER
1_NUMBER#
NUMBER_1$ (*)
1NUMBER
Incorrect Incorrect. Refer to Section 13 Lesson 1.
14. It is possible to create a table by using the CREATE TABLE command in conjunction with a subquery. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
15. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
(1) Points
impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
impossible; School_Friends is a reserved term in SQL.
possible; our data will merge into one table, and we can more easily access our mutual friends information.
Incorrect Incorrect. Refer to Section 13 Lesson 1.
Previous Page 3 of 3 Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
1. CREATE TABLE bioclass
(hire_date DATE DEFAULT SYSDATE,
first_name varchar2(15),
last_name varchar2(15));
The above CREATE TABLE statement is acceptable, and will create a Table named bioclass that contains a hire_date, first_name, and last_name column. True or False?
Mark for Review
(1) Points
True (*)
False
Correct Correct
2. You want to create a table named TRAVEL that is a child of the EMPLOYEES table. Which of the following statements should you issue? Mark for Review
(1) Points
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, JOIN emp_id number(10) ON employees (emp_id));
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, t.emp_id = e.emp_id);
CREATE TABLE travel
(destination_id primary key, departure_date date, return_date date, emp_id REFERENCES employees (emp_id));
CREATE TABLE travel
(destination_id number primary key, departure_date date, return_date date, emp_id number(10) REFERENCES employees (emp_id));
(*)
Correct Correct
3. You are creating the EMPLOYEES table. This table should contain the COMMISSION_PCT column and use a value of 10 percent if no commission value is provided when a record is inserted. Which line should you include in the CREATE TABLE statement to accomplish this task? Mark for Review
(1) Points
commission_pct NUMBER(4,2) (DEFAULT, 0.10)
commission_pct NUMBER(4,2) DEFAULT = 0.10
commission_pct NUMBER(4,2) DEFAULT 0.10 (*)
commission_pct NUMBER(4,2) IS DEFAULT 0.10
Incorrect Incorrect. Refer to Section 13 Lesson 1.
4. I have a table named School_Friends in my schema. You want to build a table in your schema named School_Friends. This is ______________, because ____________________________________. Mark for Review
(1) Points
impossible; no matter what, there can never be two tables with the same name, even if they are in separate schemas.
impossible; School_Friends is a reserved term in SQL.
possible; my schema is separate from yours, and it is okay for us to have like-named tables in our separate schemas. (*)
possible; our data will merge into one table, and we can more easily access our mutual friends information.
Correct Correct
5. Which SQL statement below will correctly create the EMP table based on the structure of the EMPLOYEES table? Include only the EMPLOYEE_ID, FIRST_NAME, LAST_NAME, SALARY, and DEPARTMENT_ID columns. Mark for Review
(1) Points
CREATE TABLE emp
AS SELECT employee_id, first_name, last_name, salary, department_id
FROM employees;
(*)
CREATE TABLE employee
AS SELECT employee_id, first_name, last_name, salary, department_id
FROM employees;
CREATE TABLE emp (employee_id, first_name, last_name, salary, department_id);
CREATE TABLE emp
SELECT (employee_id, first_name, last_name, salary, department_id FROM employees);
Correct Correct
Page 1 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
6. When should you use the SET UNUSED command? Mark for Review
(1) Points
You should only use this command if you want the column to still be visible when you DESCRIBE the table.
You should use it when you need a quick way of dropping a column. (*)
Never, there is no SET UNUSED command.
You should use it if you think the column may be needed again later.
Incorrect Incorrect. Refer to Section 13 Lesson 3.
7. The FLASHBACK QUERY statement can restore data back to a point in time before the last COMMIT. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect Incorrect. Refer to Section 13 Lesson 3.
8. You need to remove all the rows from the SALES_HIST table. You want to release the storage space, but do not want to remove the table structure. Which statement should you use? Mark for Review
(1) Points
The DELETE statement
The DROP TABLE statement
The TRUNCATE TABLE statement (*)
The ALTER TABLE statement
Incorrect Incorrect. Refer to Section 13 Lesson 3.
9. The TEAMS table contains these columns:
TEAM_ID NUMBER(4) Primary Key
TEAM_NAME VARCHAR2(20)
MGR_ID NUMBER(9)
The TEAMS table is currently empty. You need to allow users to include text characters in the manager identification values. Which statement should you use to implement this?
Mark for Review
(1) Points
ALTER TABLE teams
MODIFY (mgr_id VARCHAR2(15));
(*)
ALTER TABLE teams
REPLACE (mgr_id VARCHAR2(15));
ALTER teams TABLE
MODIFY COLUMN (mgr_id VARCHAR2(15));
You CANNOT modify the data type of the MGR_ID column.
ALTER teams
MODIFY (mgr_id VARCHAR2(15));
Correct Correct
10. You want to issue the following command on a database that includes your company's inventory information:
ALTER TABLE products SET UNUSED COLUMN color;
What will be the result of issuing this command?
Mark for Review
(1) Points
The column named COLOR in the table named PRODUCTS will not be returned in subsequent reads of the table by Oracle, as it has been deleted logically. (*)
The column named COLOR in the table named PRODUCTS will be assigned default values.
The column named COLOR in the table named PRODUCTS will be created.
The column named COLOR in the table named PRODUCTS will be deleted.
Correct Correct
Previous Page 2 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
11. You are designing a table for the Human Resources department. This table must include a column that contains each employee's hire date. Which data type should you specify for this column? Mark for Review
(1) Points
INTERVAL YEAR TO MONTH
TIMESTAMP
CHAR
DATE (*)
Correct Correct
12. The BLOB datatype can max hold 128 Terabytes of data. True or False? Mark for Review
(1) Points
True (*)
False
Correct Correct
13. Which of the following are valid Oracle datatypes? Mark for Review
(1) Points
TIMESTAMP, LOB, VARCHAR2, NUMBER
SYSDATE, TIMESTAMP, DATE, LOCAL TIME ZONE
DATE, BLOB, LOB, VARCHAR2
DATE, TIMESTAMP WITH LOCAL TIME ZONE, BLOB (*)
Correct Correct
14. Which statement about data types is true? Mark for Review
(1) Points
The CHAR data type should be defined with a size that is not too large for the data it contains (or could contain) to save space in the database. (*)
The BFILE data type stores character data up to four gigabytes in the database.
The VARCHAR2 data type should be used for fixed-length character data.
The TIMESTAMP data type is a character data type.
Correct Correct
15. You need to store the SEASONAL data in months and years. Which data type should you use? Mark for Review
(1) Points
INTERVAL YEAR TO MONTH (*)
DATE
TIMESTAMP
INTERVAL DAY TO SECOND
Correct Correct
Previous Page 3 of 3 Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
1. The ELEMENTS column is defined as:
NUMBER(6,4)
How many digits to the right of the decimal point are allowed for the ELEMENTS column?
Mark for Review
(1) Points
Four (*)
Six
Two
Zero
Correct Correct
2. To store large amounts of text you should simply create a series of VARCHAR2 columns in a table. True or False? Mark for Review
(1) Points
True
False (*)
Correct Correct
3. Which statement about data types is true? Mark for Review
(1) Points
The VARCHAR2 data type should be used for fixed-length character data.
The CHAR data type should be defined with a size that is not too large for the data it contains (or could contain) to save space in the database. (*)
The BFILE data type stores character data up to four gigabytes in the database.
The TIMESTAMP data type is a character data type.
Correct Correct
4. You are designing a table for the Sales department. You need to include a column that contains each sales total. Which data type should you specify for this column? Mark for Review
(1) Points
VARCHAR2
CHAR
DATE
NUMBER (*)
Correct Correct
5. A table has a column: RESPONSE_TIME. This is used to store the difference between the time the problem was reported and the time the problem was resolved. Data in the RESPONSE_TIME column needs to be stored in days, hours, minutes and seconds. Which data type should you use? Mark for Review
(1) Points
INTERVAL DAY TO SECOND (*)
TIMESTAMP
INTERVAL YEAR TO MONTH
DATETIME
Incorrect Incorrect. Refer to Section 13 Lesson 2.
Page 1 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
6. Which statement about creating a table is true? Mark for Review
(1) Points
If no schema is explicitly included in a CREATE TABLE statement, the CREATE TABLE statement will fail.
If no schema is explicitly included in a CREATE TABLE statement, the table is created in the current user's schema. (*)
With a CREATE TABLE statement, a table will always be created in the current user's schema.
If a schema is explicitly included in a CREATE TABLE statement and the schema does not exist, it will be created.
Correct Correct
7. You are creating the EMPLOYEES table. This table should contain the COMMISSION_PCT column and use a value of 10 percent if no commission value is provided when a record is inserted. Which line should you include in the CREATE TABLE statement to accomplish this task? Mark for Review
(1) Points
commission_pct NUMBER(4,2) DEFAULT 0.10 (*)
commission_pct NUMBER(4,2) DEFAULT = 0.10
commission_pct NUMBER(4,2) IS DEFAULT 0.10
commission_pct NUMBER(4,2) (DEFAULT, 0.10)
Correct Correct
8. CREATE TABLE student_table
(id NUMBER(6),
lname VARCHAR(20),
fname VARCHAR(20),
lunch_num NUMBER(4));
Which of the following statements best describes the above SQL statement:
Mark for Review
(1) Points
Creates a table named student_table with four columns: lname, fname, lunch, num
Creates a table named student with four columns: id, lname, fname, lunch_num
Creates a table named student_table with four columns: id, lname, fname, lunch_num (*)
Creates a table named student_table with four columns: lname, fname, lunch, num
Correct Correct
9. Once they are created, external tables are accessed with normal SQL statements. (True or False?) Mark for Review
(1) Points
True (*)
False
Correct Correct
10. Which column name is valid? Mark for Review
(1) Points
1NUMBER
1_NUMBER#
NUMBER
NUMBER_1$ (*)
Correct Correct
Previous Page 2 of 3 Next Summary
Test: Section 13 Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 13 Quiz
(Answer all questions in this section)
11. Evaluate the structure of the EMPLOYEE table:
EMPLOYEE_ID NUMBER(9)
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
MANAGER_ID NUMBER(9)
SALARY NUMBER(7,2)
The EMPLOYEE_ID column currently contains 500 employee identification numbers. Business requirements have changed and you need to allow users to include text characters in the identification values. Which statement should you use to change this column's data type?
Mark for Review
(1) Points
You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not empty. (*)
ALTER TABLE employee
REPLACE (employee_id VARCHAR2(9));
ALTER employee TABLE
MODIFY COLUMN (employee_id VARCHAR2(15));
ALTER TABLE employee
MODIFY (employee_id VARCHAR2(9));
Correct Correct
12. Examine the structure of the DONATIONS table.
DONATIONS:
PLEDGE_ID NUMBER
DONOR_ID NUMBER
PLEDGE_DT DATE
AMOUNT_PLEDGED NUMBER (7,2)
AMOUNT_PAID NUMBER (7,2)
PAYMENT_DT DATE
You need to reduce the precision of the AMOUNT_PLEDGED column to 5 with a scale of 2 and ensure that when inserting a row into the DONATIONS table without a value for the AMOUNT_PLEDGED column, a price of $10.00 will automatically be inserted. The DONATIONS table currently contains NO records. Which statement is true?
Mark for Review
(1) Points
Both changes can be accomplished with one ALTER TABLE statement. (*)
You must use the ADD OR REPLACE option to achieve these results.
You CANNOT decrease the width of the AMOUNT_PLEDGED column.
You must drop and recreate the DONATIONS table to achieve these results.
Incorrect Incorrect. Refer to Section 13 Lesson 3.
13. Evaluate this statement:
ALTER TABLE employees SET UNUSED (fax);
Which task will this statement accomplish?
Mark for Review
(1) Points
Deletes the FAX column
Frees the disk space used by the data in the FAX column
Prevents data in the FAX column from being displayed, by performing a logical drop of the column (*)
Prevents a new FAX column from being added to the EMPLOYEES table
Correct Correct
14. Which statement about decreasing the width of a column is true? Mark for Review
(1) Points
You cannot decrease the width of a character column unless the table in which the column resides is empty.
When a character column contains data, you cannot decrease the width of the column.
When a character column contains data, you can decrease the width of the column without any restrictions.
When a character column contains data, you can decrease the width of the column if the existing data does not violate the new size. (*)
Correct Correct
15. To do a logical delete of a column without the performance penalty of rewriting all the table datablocks, you can issue the following command: Mark for Review
(1) Points
Alter table modify column
Alter table drop column
Alter table set unused (*)
Drop column "columname"
Incorrect Incorrect. Refer to Section 13 Lesson 3.
Previous Page 3 of 3 Summary
Langganan:
Posting Komentar (Atom)
thanks bro
BalasHapussama sama :v
HapusWhich command could you use to quickly remove all data from the rows in a table without deleting the table itself?
BalasHapusALTER TABLE
DROP TABLE
MODIFY
TRUNCATE TABLE (*)
Correct
INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and seconds. True or False?
True (*)
False
Correct
Which data types stores variable-length character data? Select two.
(Choose all correct answers)
CHAR
NCHAR
CLOB (*)
VARCHAR2 (*)
Correct
Examine this CREATE TABLE statement:
BalasHapusCREATE TABLE emp_load
(employee_number CHAR(5),
employee_dob CHAR(20),
employee_last_name CHAR(20),
employee_first_name CHAR(15),
employee_middle_name CHAR(15),
employee_hire_date DATE)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY def_dir1
ACCESS PARAMETERS
(RECORDS DELIMITED BY NEWLINE
FIELDS (employee_number CHAR(2),
employee_dob CHAR(20),
employee_last_name CHAR(18),
employee_first_name CHAR(11),
employee_middle_name CHAR(11),
employee_hire_date CHAR(10) date_format DATE mask "mm/dd/yyyy"))
LOCATION ('info.dat'));
What kind of table is created here?
An external table with the data stored in a file outside the database.(*)
A View.
An external table with the data stored in a file inside the database.
None. This is in invalid statement.
Don’t follow your role model. Be the Role model person for others. But it's so simple by getting Hadoop training in Chennai. Because it is an assurance course to bounce back from a double salary. For joining call 7502633633.
BalasHapusMany SEO techniques can be easily done from home and they also provide enough of money. Many online jobs of seo can be easily found there. get SEO virtual assistant today
BalasHapus