Cheat Exam Oracle
Cheat Exam Oracle
Section 12
(Answer all questions in this section)
1. In a conditional multi-table insert, you can specify either __________ or __________. Mark
for Review
(1) Points
All; First (*)
First; Second
All; Second
Null; Default
2. A multi-table insert statement can insert into more than one table. (True or False?) Mark
for Review
(1) Points
True (*)
False
3. Which of the following statements will add a new customer to the customers table in the
Global Fast Foods database? Mark for Review
(1) Points
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, 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", "8586667641");
4. You have been instructed to add a new customer to the CUSTOMERS table. Because the
new customer has not had a credit check, you should not add an amount to the CREDIT column.
The CUSTOMERS table contains these columns:
CUST_ID NUMBER(10)
COMPANY VARCHAR2(30)
CREDIT NUMBER(10)
POC VARCHAR2(30)
LOCATION VARCHAR2(30)
5. You need to remove a row from the EMPLOYEES table. Which statement would you
use? Mark for Review
(1) Points
INSERT with a WHERE clause
DELETE with a WHERE clause (*)
UPDATE with a WHERE clause
MERGE with a WHERE clause
Section 12
(Answer all questions in this section)
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
QTY_PER_UNIT NUMBER
UNIT_PRICE NUMBER (7,2)
QTY_IN_STOCK NUMBER
QTY_ON_ORDER NUMBER
REORDER_LEVEL NUMBER
You want to delete any products supplied by the five suppliers located in Atlanta. Which script should
you use?
8. Which two commands can be used to modify existing data in a database row? Mark for
Review
(1) Points
(Choose all correct answers)
DELETE
SELECT
UPDATE (*)
MERGE (*)
Section 13
(Answer all questions in this section)
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?
You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not empty.
(*)
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?
ALTER teams
MODIFY (mgr_id VARCHAR2(15));
Section 13
(Answer all questions in this section)
11. Which command could you use to quickly remove all data from the rows in a table without
deleting the table itself? Mark for Review
(1) Points
DROP TABLE
TRUNCATE TABLE (*)
ALTER TABLE
MODIFY
12. 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?
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 deleted.
13. 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 (*)
15. 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.
Section 13
(Answer all questions in this section)
16. 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?
17. 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. (*)
possible; our data will merge into one table, and we can more easily access our mutual
friends information.
19. Which CREATE TABLE statement will fail? Mark for Review
(1) Points
CREATE TABLE date (date_id NUMBER(9)); (*)
CREATE TABLE time (time_id NUMBER(9));
CREATE TABLE time_date (time NUMBER(9));
CREATE TABLE date_1 (date_1 DATE);
Section 14
(Answer all questions in this section)
20. A column defined as NOT NULL can have a DEFAULT value of NULL. True or
False? Mark for Review
(1) Points
True
False (*)
Section 14
(Answer all questions in this section)
21. A table must have at least one not null constraint and one unique constraint. True or
False? Mark for Review
(1) Points
True
False (*)
22. A table can have more than one UNIQUE key constraint. True or False? Mark for Review
(1) Points
True (*)
False
23. You disabled the EMPLOYEE_ID_PK PRIMARY KEY constraint on the ID column in the
EMPLOYEES table and imported 100 records. You need to enable the constraint and verify that the
new and existing ID column values do not violate the PRIMARY KEY constraint. Evaluate this
statement:
ALTER TABLE employees
ENABLE employee_id_pk;
You need to disable the FOREIGN KEY constraint. Which statement should you use?
25. A Primary Key that is made up of more than one column is called a: Mark for Review
(1) Points
Multiple Primary Key
Composite Primary Key (*)
Double Key
Primary Multi-Key
None of the Above
Section 14
(Answer all questions in this section)
26. The table that contains the Primary Key in a Foreign Key Constraint is known
as: Mark for Review
(1) Points
Child Table
Mother and Father Table
Parent Table (*)
Detail Table
Section 15
(Answer all questions in this section)
27. What is one advantage of using views? Mark for Review
(1) Points
To provide restricted data access (*)
To provide data dependence
To be able to store the same data in more than one place
28. Which of the following statements is a valid reason for using a view? Mark for Review
(1) Points
Views allow access to the data because the view displays all of the columns from the table.
Views are used when you only want to restrict DML operations using a WITH CHECK
OPTION.
Views are not valid unless you have more than one user.
Views provide data independence for infrequent users and application programs. One view
can be used to retrieve data from several tables. Views can be used to provide data security. (*)
29. Which statement would you use to alter a view? Mark for Review
(1) Points
CREATE OR REPLACE VIEW (*)
MODIFY VIEW
ALTER VIEW
ALTER TABLE
Which SELECT statement could be used to display the 10 lowest paid clerks that belong to
department 70?
Section 15
(Answer all questions in this section)
31. A Top-N Analysis is capable of ranking a top or bottom set of results. True or
False? Mark for Review
(1) Points
True (*)
False
32. What is the purpose of including the WITH CHECK OPTION clause when creating a
view? Mark for Review
(1) Points
To insure that no rows are updated through the view that would prevent those rows from
being returned by the view in the future. (*)
33. Which option would you use when creating a view to ensure that no DML operations occur
on the view? Mark for Review
(1) Points
WITH READ ONLY (*)
FORCE
WITH ADMIN OPTION
NOFORCE
34. If a database administrator wants to ensure that changes performed through a view do not
violate existing constraints, which clause should he include when creating the view? Mark for
Review
(1) Points
WITH CHECK OPTION (*)
FORCE
WITH READ ONLY
WITH CONSTRAINT CHECK
Section 16
(Answer all questions in this section)
35. When creating a sequence, which keyword or option specifies the minimum sequence
value? Mark for Review
(1) Points
MINVALUE (*)
CYCLE
NOMAXVALUE
MAXVALUE
Section 16
(Answer all questions in this section)
36. Which statement would you use to remove the EMP_ID_SEQ sequence? Mark for
Review
(1) Points
DROP SEQUENCE emp_id_seq; (*)
ALTER SEQUENCE emp_id_seq;
DELETE SEQUENCE emp_id_seq;
REMOVE SEQUENCE emp_id_seq;
37. When used in a CREATE SEQUENCE statement, which keyword specifies that a range of
sequence values will be preloaded into memory? Mark for Review
(1) Points
CACHE (*)
NOCACHE
NOCYCLE
LOAD
MEMORY
38. What kind of INDEX is created by Oracle when you create a primary key? Mark for
Review
(1) Points
UNIQUE INDEX (*)
NONUNIQUE INDEX
INDEX
Oracle cannot create indexes automatically.
39. Indexes can be used to speed up queries. True or False? Mark for Review
(1) Points
True (*)
False
40. Which of the following is created automatically by Oracle when a UNIQUE integrity constraint
is created? Mark for Review
(1) Points
An index (*)
A PRIMARY KEY constraint
A FOREIGN KEY constraint
A CHECK constraint
Section 17
(Answer all questions in this section)
44. Regular expressions used as check constraints are another way to ensure data is formatted
correctly prior to being written into the database table. True or False? Mark for Review
(1) Points
True (*)
False
45. A role can be granted to another role. True or False? Mark for Review
(1) Points
True (*)
False
Section 17
(Answer all questions in this section)
46. Scott King owns a table called employees. He issues the following statement:
GRANT select ON employees TO PUBLIC;
Allison Plumb has been granted CREATE SESSION by the DBA. She logs into the database and
issues the following statement:
GRANT ᅠselect ON ᅠscott_king.employees TO jennifer_cho;
47. Which keyword would you use to grant an object privilege to all database
users? Mark for Review
(1) Points
PUBLIC (*)
ALL
ADMIN
USERS
Section 18
(Answer all questions in this section)
48. If Oracle crashes, your changes are automatically rolled back. True or False? Mark for
Review
(1) Points
True (*)
False
49. When you logout of Oracle, your data changes are automatically rolled back. True or
False? Mark for Review
(1) Points
True
False (*)
Section 19
(Answer all questions in this section)
50. A software verification and validation method. Mark for Review
(1) Points
Documentation
Unit testing (*)
Software engineering
Production
FINAL EXAM DATABASE DESIGN
Section 6
(Answer all questions in this section)
1. An entity can only have one Primary UID. True or False? Mark for Review
(1) Points
True (*)
False
2. If an entity has no attribute suitable to be a Primary UID, we can create an artificial one. True
or False? Mark for Review
(1) Points
True (*)
False
3. There is no limit to how many columns can make up an entity's UID. True or
False? Mark for Review
(1) Points
True (*)
False
4. A unique identifier can only be made up of one attribute. True or False? Mark for
Review
(1) Points
True
False (*)
7. Examine the following entity and decide how to make it conform to the rule of 2nd Normal
Form:
ENTITY: RECEIPT
ATTRIBUTES:
#CUSTOMER ID
#STORE ID
STORE LOCATION
DATE
Mark for Review
(1) Points
Do nothing, it is already in 2nd Normal Form.
Delete the attribute STORE ID
Move the attribute STORE LOCATION to a new entity, STORE, with a UID of STORE ID,
and create a relationship to the original entity. (*)
Move the attribute STORE LOCATION to a new entity, STORE, with a UID of STORE
LOCATION, and create a relationship to the original entity.
8. When any attribute in an entity is dependent on any other non-UID attribute in that entity, this
is known as: Mark for Review
(1) Points
Dependency
Functional dependency
Non-dependency
Transitive dependency (*)
9. Examine the following Entity and decide which rule of Normal Form is being violated:
ENTITY: CLIENT
ATTRIBUTES:
# CLIENT ID
FIRST NAME
LAST NAME
ORDER ID
STREET
ZIP CODE
Mark for Review
(1) Points
1st Normal Form. (*)
2nd Normal Form.
3rd Normal Form.
None of the above, the entity is fully normalised.
10. As a database designer, you do not need to worry about where in the datamodel you store a
particular attribute; as long as you get it onto the ERD, your job is done. True or False? Mark for
Review
(1) Points
True
False (*)
11. Examine the following Entity and decide which rule of Normal Form is being violated:
ENTITY: CLIENT
ATTRIBUTES:
# CLIENT ID
FIRST NAME
LAST NAME
STREET
CITY
ZIP CODE
Mark for Review
(1) Points
1st Normal Form.
2nd Normal Form.
3rd Normal Form.
None of the above, the entity is fully normalised. (*)
12. When data is stored in more than one place in a database, the database violates the rules of
___________. Mark for Review
(1) Points
Normalcy
Replication
Normalization (*)
Decency
13. If an entity has a multi-valued attribute, to conform to the rule of 1st Normal Form we: Mark
for Review
(1) Points
Make the attribute optional
Do nothing, an entity does not have to be in 1st Normal Form
Create an additional entity and relate it to the original entity with a 1:M relationship. (*)
Create an additional entity and relate it to the original entity with a M:M relationship.
14. An entity ORDER has the attributes Order ID, Order Date, Product id, Customer ID. This
entity is in 1st Normal Form. True or False? Mark for Review
(1) Points
True
False (*)
15. An entity can have repeated values and still be in 1st Normal Form. True or
False? Mark for Review
(1) Points
True
False (*)
16. Cascading UIDs are a feature often found in what type of Relationship? Mark for Review
(1) Points
Invalid Relationship
General Relationship
Heirarchical Relationship (*)
Recursive Relationship
17. A relationship between an entity and itself is called a/an: Mark for Review
(1) Points
General Relationship
Recursive Relationship (*)
Heirarchical Relationship
Invalid Relationship
18. A single relationship can be both Recursive and Hierarchical at the same time. True or
False? Mark for Review
(1) Points
True
False (*)
19. A Hierarchical relationship is a series of relationships that reflect entities organized into
successive levels. True or False? Mark for Review
(1) Points
True (*)
False
20. A particular problem may be solved using either a Recursive Relationship or a Hierarchical
Relationship, though not at the same time. True or False? Mark for Review
(1) Points
True (*)
False
21. Which of the following would best be represented by an arc? Mark for Review
(1) Points
STUDENT (Grade A student, Average Student)
PARENT (Girl, Bob)
TEACHER (Female, Bob)
DELIVERY ADDRESS (Home, Office) (*)
22. Arcs are used to visually represent _________ between two or more relationships in an
ERD. Mark for Review
(1) Points
Sameness
Differences
Exclusivity (*)
Inheritance
23. An arc can often be modeled as Supertype and Subtypes. True or False? Mark for
Review
(1) Points
True (*)
False
24. Which of the following would best be represented by an arc? Mark for Review
(1) Points
STUDENT (Grade A student, Average Student)
STUDENT (senior, male)
STUDENT ( University, Technical College) (*)
STUDENT (graduating, female)
Section 8
(Answer all questions in this section)
25. Which of the following would be a logical constraint when modeling time for a country
entity? Mark for Review
(1) Points
Daily traffic patterns must be monitored to determine which countries are overcrowded.
People have births and deaths in their countries that must be tracked by the system.
If you are doing a system for France or Germany, you would need security clearance.
Countries may change their names and/or borders over a period of time. (*)
Section 8
(Answer all questions in this section)
26. Which of the following would be a logical constraint when modeling time for a City
entity? Mark for Review
(1) Points
Daily traffic patterns must be monitored to determine how many law enforcement officers are
needed.
If you are doing a system for any French City, you would need security clearance.
Cites may change their names and/or country association if the borders of a country change.
(*)
People are born in the city and people die in the city.
27. All systems must include functionality to provide logging or journaling in conceptual data
models. True or False? Mark for Review
(1) Points
True
False (*)
28. When a system requires that old values for attributes are kept on record, this is know as
Journaling or Logging. True or False? Mark for Review
(1) Points
True (*)
False
29. There is no point in trying to group your entities together on your diagram according to
volume, and making a diagram look nice is a waste of time. True or False? Mark for Review
(1) Points
True
False (*)
30. Formal rules exist for drawing ERD's. You must always follow them, even if it results in an
ERD that is difficult to read. True or False? Mark for Review
(1) Points
True
False (*)
31. Which of the following scenarios should be modeled so that historical data is kept? (Choose
two) Mark for Review
(1) Points
(Choose all correct answers)
LIBRARY and NUMBER OF BOOKS
STUDENT and GRADE (*)
STUDENT and AGE
LIBRARY and BOOK (*)
32. Historical data must never be kept. True or False? Mark for Review
(1) Points
True
False (*)
Section 9
(Answer all questions in this section)
Section 9
(Answer all questions in this section)
36. A foreign key cannot refer to a primary key in the same table. True or False? Mark for
Review
(1) Points
True
False (*)
40. A barrred Relationship will result in a Foreign Key column that also is part of: Mark for
Review
(1) Points
The Column Name
The Check Constraint
The Table Name
The Primary Key (*)
Section 9
(Answer all questions in this section)
41. Relationships on an ERD can only be transformed into UIDs in the physical model? True or
False? Mark for Review
(1) Points
True
False (*)
42. One-to-One relationships are transformed into Check Constraints in the tables created at
either end of that relationship. True or False? Mark for Review
(1) Points
True
False (*)
43. The "Arc Implementation" is a synonym for what type of implementation? Mark for
Review
(1) Points
Cascade Implementation
Supertype Implementation
Subtype Implementation
Supertype and Subtype Implementation (*)
44. When mapping supertypes, relationships at the supertype level transform as usual.
Relationships at the subtype level are implemented as foreign keys, but the foreign key columns all
become optional. True or False? Mark for Review
(1) Points
True (*)
False
45. The transformation from an ER diagram to a physical design involves changing terminology.
Entities in the ER diagram become __________ : Mark for Review
(1) Points
Columns
Tables (*)
Foreign Keys
Unique Keys
Section 9
(Answer all questions in this section)
46. The conceptual model is transformed into a physical model. The physical implementation will
be a relational database. True or False? Mark for Review
(1) Points
True (*)
False
47. In an Oracle database, why would 1_TABLE not work as a table name? Mark for Review
(1) Points
There is no problem here. You can create a table called 1_TABLE.
Object names must not start with a number. They must begin with a letter. (*)
TABLE is a reserved word.
The database does not understand all capital letters.
48. In an Oracle database, why would the following table name not be allowed 'EMPLOYEE
JOBS'? Mark for Review
(1) Points
JOBS is a reserved word
The database does not understand all capital letters
You cannot have spaces between words in a table name (*)
EMPLOYEE is a reserved word
Section 10
(Answer all questions in this section)
49. In which phases of the System Development Life Cycle will we need to use SQL as a
language? (Choose Two) Mark for Review
(1) Points
(Choose all correct answers)
Build and Document (*)
Analysis
Transition (*)
Strategy
50. During which phases of the System Development Life Cycle would you roll out the system to
the users? Mark for Review
(1) Points
Build and Transition
Design and Production
Strategy and Analysis