You are on page 1of 5

1.

Constraints - Question 1
Which of the following statements is correct?
Student Response Value Correct Answer Feedback
1. A PRIMARY KEY constraint allows NULL values in the primary key column(s).
2. You can enable a dropped constraint if you need it in the future.
3. Every table must have at least one PRIMARY KEY constraint, or Oracle 10g doe
s not allow the table to be created.
4. None of the above statements is correct. 100%
Score: 5/5

2. Constraints - Question 2.
Which of the following is not a valid constraint type?

Student Response Value Correct Answer Feedback


1. PRIMARY KEYS 100%
2. UNIQUE
3. CHECK
4. FOREIGN KEY
Score: 5/5

3. Constraints - Question 3.
Which of the following SQL statements is invalid and returns an error message?

Student Response Value Correct Answer Feedback


1. ALTER TABLE books ADD CONSTRAINT books_pubid_uk UNIQUE(pubid);
2. ALTER TABLE books ADD CONSTRAINT books_pubid_pk PRIMARY KEY(pubid);
3. ALTER TABLE books ADD CONSTRAINT books_pubid_nn NOT NULL(pubid); 100%
4. ALTER TABLE books ADD CONSTRAINT books_pubid_fk FOREIGN KEY(pubid) REFERENCE
S publisher(pub_id);
5. All of the above statements are invalid.
Score: 5/5

4. Constraints - Question 4.
What is the maximum number of PRIMARY KEY constraints allowed for a table?
Student Response Value Correct Answer Feedback
1. 1
2. 2
3. 30
4. 255 0%
Score: 0/5

5. Constraints - Question 5.
How many NOT NULL constraints can be created at the table level using the CREA
TE TABLE command?
Student Response Value Correct Answer Feedback
1. 0 100%
2. 1
3. 12
4. 30
5. 255
Score: 5/5

6. Constraints - Question 6.
The FOREIGN KEY constraint should be added to which table?
Student Response Value Correct Answer Feedback
1. the table representing the "one" side of a one-to-many relationship
2. the parent table in a parent-child relationship
3. the child table in a parent-child relationship 100%
4. the table that does not have a primary key
Score: 5/5

7. Constraints - Question 7.
Which of the following commands can you use to rename a constraint?
Student Response Value Correct Answer Feedback
1. RENAME
2. ALTER CONSTRAINT
3. MOVE
4. NEW NAME
5. None of the above commands can be used. 100%
Score: 5/5

8. Constraints - Question 8.
Which type of constraint would you use on a column to allow values only above
100 to be entered?
Student Response Value Correct Answer Feedback
1. PRIMARY KEY
2. UNIQUE
3. CHECK 100%
4. NOT NULL

Score: 5/5

9. Constraints - Question 9.
Which of the following can be used to enable a disabled constraint?
Student Response Value Correct Answer Feedback
1. ALTER TABLE...MODIFY
2. ALTER TABLE...ADD
3. ALTER TABLE...DISABLE
4. ALTER TABLE...ENABLE 100%
Score: 5/5

10. Constraints - Question 10.


Which of the following keywords will allow the user to delete a record from a
table even if rows in another table reference the record through a FOREIGN KEY c
onstraint?
Student Response Value Correct Answer Feedback
1. CASCADE
2. CASCADE ON DELETE
3. DELETE ON CASCADE
4. DROP
5. ON DELETE CASCADE 100%
Score: 5/5

11. Transaction - Question 11


Which of the following is a valid SQL statement?
Student Response Value Correct Answer Feedback
1. SELECT * WHERE amid = 'J100' FOR UPDATE;
2. INSERT INTO homework 10VALUES (SELECT * FROM acctmanager);
3. DELETE amid FROM acctmanager;
4. rollback; 100%
5. all of the above
Score: 5/5

12. Transaction - Question 12


Which of the following commands can be used to add rows to a table?
Student Response Value Correct Answer Feedback
1. INSERT INTO 100%
2. ALTER TABLE ADD
3. UPDATE
4. SELECT...FOR UPDATE
Score: 5/5

13. Transaction - Question 13


Which of the following will delete all the rows in the HOMEWORK10 table?
Student Response Value Correct Answer Feedback
1. DELETE * FROM homework10;
2. DELETE *.* FROM homework10;
3. DELETE FROM homework10; 100%
4. DELETE FROM homework10 WHERE 9amid = '*';
Score: 5/5

14. Transaction - Question 14


Assuming that the HOMEWORK10 table has three columns (Col1, Col2, and Col3 in
the order listed), which of the following commands will store a NULL value in Co
l3 of the HOMEWORK10 table?
Student Response Value Correct Answer Feedback
1. INSERT INTO homework10 VALUES ('A','B','C');
2. INSERT INTO homework10(col3, col2, col1) VALUES (NULL,'A','B'); 100%
3. INSERT INTO homework10 VALUES (NULL, 'A','B');
4. UPDATE homework10 SET col1=col3;
Score: 5/5

15. Transaction - Question 15


Whihc of the following symbols designates a substitution variable?
Student Response Value Correct Answer Feedback
1. & 100%
2. $
3. #
4. _
Score: 5/5

16. Transaction - Question 16


You issue the following command:
INSERT INTO homework10(col1,col2,col3)
VALUES ('a', NULL, 'C'). The command will fail if which of the following stateme
nts is true?
Student Response Value Correct Answer Feedback
1. Col1 has a PRIMARY KEY constraint enabled.
2. Col2 has a UNIQUE constraint enabled.
3. Col3 is defined as a DATE column. 100%
4. None of the above would cause the command to fail.
Score: 5/5

17. Transaction - Question 17


Which of the following commands will remove all orders placed before April 1,
2006?
Student Response Value Correct Answer Feedback
1. DELETE FROM orders WHERE orderdate < '01-APR-06'; 100%
2. DROP FROM orders WHERE orderdate < '01-APR-06';
3. REMOVE FROM orders WHERE orderdate < '01-APR-06';
4. DELETE FROM orders WHERE orderdate > '01-APR-06';
Score: 5/5

18. Transaction - Question 18


How many rows can be added to a table per execution of the INSERT INTO...VALUE
S command?
Student Response Value Correct Answer Feedback
1. 1 100%
2. 2
3. 3
4. unlimited
Score: 5/5

19. Transaction - Question 19


You accidentally deleted all the orders in the ORDERS table. How can the error
be corrected after a COMMIT command has been issued?
Student Response Value Correct Answer Feedback
1. ROLLBACK;
2. ROLLBACK COMMIT;
3. REGENERATE RECORDS orders;
4. None of the above will restore the deleted orders. 0%
Score: 0/5

20. Transaction - Question 20


A rollback will not automatically occur when:
Student Response Value Correct Answer Feedback
1. A DDL command is executed.
2. The user exits the system.
3. The system crashes.
4. None of the above. 0%
Score: 0/5

1 4
2 1
3 3
4 1
5 1
6 3
7 5
8 3
9 4
10 5
11 4
12 1
13 3
14 2
15 1
16 3
17 1
18 1
19 1
20 1

You might also like