PDF Quiz 12 PDF
PDF Quiz 12 PDF
INSERT; SELECT
UPDATE;SELECT UPDATE;
DELETE
INSERT; UPDATE (*)
2.An insert statement in multiple tables can be inserted into more than one.
table. (True or false?)
Mark for Review
(1) Points
TRUE
E
A
S
LF
Correct
3.Insertions into multiple tables are used when the same data source
it should be inserted in destination table(s).
Mark for Review
Points
Ten
A data warehouse More
of one (*)
A vast
Correct
INSERT INTO student_table (id, lname, fname, lunch_num)
VALUES (143352, 'Roberts', 'Cameron', DEFAULT);
INSERT INTO (id, lname, fname, lunch_num)
VALUES (143354, 'Roberts', 'Cameron', 6543);
(*)
INSERT INTO student_table (id, lname, fname, lunch_num)
VALUESINTO
INSERT (143354,
student_table ' Roberts ' , Cameron, 6543);
VALUES (143354, 'Roberts', 'Cameron', 6543);
6.If the subquery returns one row, how many rows will be deleted from the table?
employees? Mark for Review
(1) Points
DELETE FROM employees
WHERE department_id =
(SELECT department_id
FROM departments
WHERE department_name LIKE '%Public%');
Correct
PRODUCTS:
PRODUCT_ID NUMBER NOT NULL, Primary Key
PRODUCT_NAME VARCHAR2 (25)
SUPPLIER_ID NUMBER Foreign key to SUPPLIER_ID of the SUPPLIERS
table
CATEGORY_ID NUMBER
NUMBER
UNIT_PRICE NUMBER (7,2)
NUMBER
Quantity on Order
NUMBER
Correct
9. You must update the area code of employees living in Atlanta. Mark for Review
Evaluate this partial UPDATE statement:
(1) Points
UPDATE employee
SET area_code = 770
Which of the following elements should you include in your UPDATE statement?
to achieve the desired results?
SET city = 'Atlanta'; WHERE city = 'Atlanta'; (*) UPDATE city = Atlanta; LIKE 'At%';
10.If you are executing an UPDATE statement with a subquery, it MUST be
A correlated subquery? (True or false) Mark for Review
(1) Points
TRUE FALSE
(*)
column.Correct
The PRODUCTS table contains these columns:
12. Mark for Review
PROD_ID NUMBER(4) (1) Points
PROD_NAME VARCHAR2(25)
PROD_PRICE NUMBER(3)
You want to add the following row of data to the PRODUCTS table:
The row has been created with the correct data in the three columns. (*)
(*)
14.You must copy the rows from the EMPLOYEE table to the EMPLOYEE_HIST table.
Mark for Review
What could I use in the INSERT statement to carry out this task?
(1) Points
A function
A subquery
esualA
c)*(
SET a clause
ON
15.You have been asked to add a new customer to the CUSTOMERS table. Mark for Review
Since the credit of the new customer has not been verified, it should not
Points
add an amount in the CREDIT column.
The CUSTOMERS table contains these columns:
NUMBER(10)
VARCHAR2(30)
CREDIT NUMBER(10)
POC VARCHAR2(30)
LOCATION VARCHAR2(30)
(*)
INSERT INTO customers (cust_id, company, poc, location)
4.You should add a row to an existing table. What DML statement should you use?
to use? Mark for Review
(1) Points
DELETE
UPDATE
CREATE INSERT
(*)
Yes, you can show as many rows as you want; you just have to remember
separate the rows with commas.
No, there is nothing like INSERT... VALUES.
No, you can only create one row at a time when using the clause
VALUES.
(Answer all the questions(*)
in this section)
6.An insert statement into multiple tables can be inserted into more than
A table. (True or false?) Mark for Review
(1) Points
TRUE
E
A
S
LF)*(
7.Inserts into multiple tables are used when the same source of
An immense
A data warehouse
More than one (*) Ten
Correct
9.The default value must match with (the) from the column.
Mark for Review
(1) Pu
nts
Size
Table
Type of data (*) Name
from the column
11.Using what you know from the employees table, what would be the result of the
next sentence?
Mark for Review
DELETE FROM employees;
(1) Points
The first row of the employees table is
It will be removed. Nothing. No data will be changed.
All rows from the employees table will be deleted if there is no
Correct
12. Which of the following statements best describes what will happen in
the table of students in this SQL statement? Mark for Review
(1) Points
UPDATE students
SET lunch_number =
(SELECT lunch_number
FROM student
WHERE student_id = 17)
WHERE student_id = 19;
MANAGERS:
NUMBER Primary Key
VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
TEAM_ID NUMBER
TEAMS
NUMBER Primary Key
VARCHAR2 (20)
VARCHAR2 (20)
VARCHAR2 (20)
To show each player, their manager, and the name of their team
for all teams with an ID value greater than 5000
To show the names of the managers of all the teams of a
determined owner (*)
14.One of the saleswomen, Janet Roper, has informed you that she has gotten married.
recently and has asked you to update your name in the database Mark for Review
employee data. Her new last name is Cooper. Janet is the only one.
(1) Points
person with the last name Roper hired by the company. The table
EMPLOYEES contains these columns and all the data is stored in
lowercase:
UPDATE employees
SET last_name = 'roper'
WUPHD A E T RE E l
a employees
s t_ n a m =
' cooper '; SET cooper =
last_name WHERE
roper
UPDATE employees SET last_name = 'cooper'
WHERE last_name = 'roper';
UPDATE employees
cooper
WHERE last_name = 'roper'; (*)
15.If it is assumed that there are no foreign keys in the EMPLOYEES table, if
the following subquery returns a row, how many rows will be suppressed from Mark for Review
the
EMPLOYEES table?
(1) Points
Do you want to add the following row of data to the PRODUCTS table:
The row has been created with the correct data in two of the three.
columns. The row has been created with the correct data in the three
columns. (*)
The row has been created completely incorrectly. None of the
data has ended in the correct columns.
The row has been created with the correct data in one of the three columns.
correct
correct
8 INSERT
5 8 INTO
6 66 customers
7 6 4 (id, 1 first_name,
); last_name,
address
VALUES (145, 'Katie', 'Hernandez', '92 Chico Way', 'Los Angeles', 'CA',
8586667641
(*)
INSERT IN customers (id, first_name, last_name, address, city, state,
zip, phone_number);
INSERT INTO customers (id, first_name, last_name, address, city, state,
zip, phone_number
VALUES ("145", 'Katie', 'Hernandez', '92 Chico Way', 'Los Angeles', 'CA',
98008
correct
7.To change an existing row in a table, you can use the statements
UPDATE or INSERT. True or false?
Mark for Review
Points
VERDADERO FALSO
(*)
8.Is the following statement valid, that is to say, can the rows be updated in
a table, based on a subquery from another table?
Mark for Review
UPDATE copy_emp (1) Points
SET department_id = (SELECT department_id
FROM employees
Yes, it is a perfectly valid sentence.
No, this statement will return an error.
No, it doesn't do anything.
The statement will fail because the subqueries are returning data.
from different rows.
DELETE MERGE
(*) UPDATE
(*) SELECT
Which of the following elements should you include in your UPDATE statement?
to achieve the desired results?
LIKE 'At%';
UPDATE city = Atlanta;
13. Which of the following statements will not insert a row of data into a
table? Mark for Review
(1) Points
Correct
to
TRUE
E
A
S
LF)*(
Correct
15. If a default value has been defined for a null column, Oracle defines
the column in the default value. However, if it has not been defined
no default value when creating the column, Oracle inserts a space Mark for Review
empty. True or false? Points
TRUE FALSE
(*)
4.Evaluate this
Mark for Review
sentence:DELETEFROM
Points
customer
Correct
INSERT
WHERE with a clause
MERGE with a clause
WHERE
Answer all the questions in this section
Mark for Review
6.The STUDENTS table contains these Points
columns:STU_IDNUMBER(9)NOTNULL
LAST_NAME VARCHAR2 (30) NOT NULL
VARCHAR2 (25) NOT NULL
DOB DATE
STU_TYPE_ID VARCHAR2(1) NOT NULL
Create another table, called FT_STUDENTS, with an identical structure.
He wants to insert all full-time students who have a value
STU_TYPE_ID 'F' in the new table. Execute this INSERT statement:
LF)*TRUE
E
A
S (