Professional Documents
Culture Documents
1. The first step in system development is to document the requirements. Why? Mark for
Review
(1) Points
Wrong. A blueprint for the database design is not needed. We can just start coding straight
away.
It clarifies what a business wants to accomplish, and provides measures for deciding if the
system delivers all that is required. (*)
Correct
2. Oracle Database Software provides which of the following functionality? (Choose two)
Mark for Review
(1) Points
Internet Browser
Server (*)
Operating System
3. Consider your school library. It will have a database with transaction details of which
student borrows which books. Is details of the total number of books out on loan in one given
month Data or Information? Mark for Review
(1) Points
Data
Information (*)
Both
Neither
4. The main subject areas taught by the Oracle Academy are: Mark for Review
(1) Points
Computer Repairs
Correct
Section 2
Experience
Instance
Table (*)
Correct
6. Which of the following entities most likely contains valid attributes? (Choose two) Mark
for Review
(1) Points
Entity: Home. Attributes: Number of Bedrooms, Owner, Address, Date Built (*)
Correct
7. Relationship names are usually verbs. True or False? Mark for Review
(1) Points
True (*)
False
8. All of the following could be attributes of an ENTITY called PERSON except one. Select
the incorrect one: Mark for Review
(1) Points
Haircolor
Weight
Gender
Correct
9. Which of the following statements about relationships are true? (Choose Two) Mark for
Review
(1) Points
10. The Physical Model is derived from the Conceptual Model. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
Section 2
11. Entity and Attribute names are usually Nouns. True or False? Mark for Review
(1) Points
True (*)
False
Section 3
12. Entity names are always singular. True or False? Mark for Review
(1) Points
True (*)
False
13. Two entities can ONLY have one relationship between them. True or False? Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 3.
14. Which of the following are valid relationship degrees? (Choose two) Mark for Review
(1) Points
1:1 (*)
1:M (*)
1:O
O:O
15. Relationships represents something of significance to the business. True or False? Mark
for Review
(1) Points
True (*)
False
16. Matrix Diagrams are developed BEFORE the ERD. True or False? Mark for Review
(1) Points
True
False (*)
Section 4
17. A business rule such as "We only ship goods after customers have completely paid any
outstanding balances on their account" is best enforced by: Mark for Review
(1) Points
We need to trust our customers, and we know they will pay some day.
Hiring a programmer to create additional programming code to verify no goods are shipped
until the account has been settled in full. (*)
18. A supertype can only have two subtypes and no more. True or False? Mark for Review
(1) Points
True
False (*)
19. Which of the following is true about subtypes? Mark for Review
(1) Points
Subtype entities may not have relationships to the other subtype entities, only the supertype
itself.
20. Which of the following are suitable Entity names? (Choose Two) Mark for Review
(1) Points
DOGS
ANIMAL (*)
ANIMALS
DOG (*)
Page 2 of 5
Section 4
21. All instances of a subtype may be an instance of the supertype but does not have to.
True or False? Mark for Review
(1) Points
True
False (*)
22. The "Other" subtype is mandatory. True or False? Mark for Review
(1) Points
True
False (*)
Section 5
True (*)
False
Incorrect. Refer to Section 5 Lesson 2.
24. How do you include a relationship as part of the UID for an entity? Mark for Review
(1) Points
By including the UID from the parent entity as an attribute in the entity
25. Which of the following pairs of entities is most likely to be modeled as a M:M
relationship? Mark for Review
(1) Points
26. If two entities have two relationships between them, these relationships can be either
_____________ or _____________ ? Mark for Review
(1) Points
Replicated or Required
True
False (*)
28. When you resolve a M-M you simply re-draw the relationships between the two original
entities, no new entities are created. True or False? Mark for Review
(1) Points
True
False (*)
29. Intersection Entities often have the relationships participating in the UID, so the
relationships are often barred. True or False? Mark for Review
(1) Points
True (*)
False
30. Transferable relationships can only be mandatory, not optional. True or False? Mark for
Review
(1) Points
True
False (*)
Section 6
31. Until all attributes are single-valued, the database model is said to be: Mark for Review
(1) Points
Normalized
32. The is no limit to how may UID's an entity can have. True or False? Mark for Review
(1) Points
True (*)
False
33. The first UID for an entity is called the Primary UID, the second is called Secondary
UID and so on. Mark for Review
(1) Points
No, it is not possible to have more than one UID for an Entity.
Yes, but then it stops. No entities can have more than two UID's.
No, each Entity can only have one UID, the secondary one.
34. All instances of the subtypes must be an instance of the supertype. Mark for Review
(1) Points
True
False
Incorrect. Refer to Section 6 Lesson 4.
When all non-UID attributes are dependent upon the entire UID. (*)
When no attritibutes are mutually independant and fully independent on the primary key.
When no attritibutes are mutually independent and all are fully dependent on the primary
key.
Section 7
36. A particular problem may be solved using either a Recursive Realtionship or a Hierachy,
though not at the same time. True or False? Mark for Review
(1) Points
True (*)
False
37. Which of the following would best be represented by an arc? Mark for Review
(1) Points
True
False (*)
39. An arc can also be modelled as Supertype and Subtypes. True or False? Mark for
Review
(1) Points
True (*)
False
Something that each Entity should have, but is not mandatory (*)
Section 7
41. No parts of an UID are mandatory. True or False? Mark for Review
(1) Points
True
False (*)
True (*)
False
Section 9
43. You are doing a data model for a computer sales company, where the price of postage is
dependent on what day of the week goods are shipped. So shipping is more expensive if the
customer wants a delivery to take place on a Saturday or Sunday. What would be the best way
to model this? Mark for Review
(1) Points
Use a Delivery Day entity, which holds prices against week days, and ensure the we also
have an attribute for the Requested Delivery Day in the Order Entity. (*)
Update the prices in the system, print out the current prices when they change and pin them
on the company noticeboard
44. Which of the following is a logical constraint that could result from considering how
time impacts an example of data storage? Mark for Review
(1) Points
An ASSIGNMENT may only refer to an EMPLOYEE with a valid employee record at the
Start Date of the ASSIGNMENT. (*)
45. If a system includes the concept of time and it stores Start Dates, then End Dates
becomes Mandatory. For each Start Date attribute you create, you MUST create an End Date
attribute and it must be mandatory. True or False? Mark for Review
(1) Points
True
False (*)
46. When you add the concept of time to your data model, your model becomes more
complex. True or False? Mark for Review
(1) Points
True (*)
False
Section 10
47. There are formal rules for how to draw ERD's, even though they are only guidelines,
you should always try to follow them. True or False? Mark for Review
(1) Points
True (*)
False
48. There is no point in trying to group your entities together on your diagram according to
volume. Making a diagram pretty is a waste of time. True or False? Mark for Review
(1) Points
True
False (*)
49. All datamodels must be transformed from specifiec to generic. True or False? Mark for
Review
(1) Points
True
False (*)
50. A datamodel containing generic modelling techniques must not be mixed in with non-
generic models. The generic entities MUST be drawn on a diagram of their own. True or
False? Mark for Review
(1) Points
True
False (*)
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 1 Lesson 1
1. Once you have learned how to write programs and build systems, you no longer need any
input or involvement from any users, as you are perfectly capable of delivering the systems
the business needs and wants. Mark for Review
(1) Points
True. All users do is delay systems delivery with their forever changing minds and new
requirements.
True. Users never know what they want anyway, so building systems are best left to the
professionals.
Section 1 Lesson 2
2. Consider your school library. It will have a database with transaction details of which
student borrows which books. Is a record of one student borrowing one book Data or
Information? Mark for Review
(1) Points
Data (*)
Information
Both
Neither
3. What is the difference between "information" and "data"? Mark for Review
(1) Points
Information and data have no differences - they are two words for the same thing
Data turns into information when it is stored in a database and accessed by systems and
users (*)
Section 1 Lesson 3
4. The first step in system development is to document the requirements. Why? Mark for
Review
(1) Points
Wrong. A blueprint for the database design is not needed. We can just start coding straight
away.
It clarifies what a business wants to accomplish, and provides measures for deciding if the
system delivers all that is required. (*)
Section 1 Lesson 4
Hierarchical (*)
Relational (*)
SQL
Network (*)
Section 2 Lesson 2
(Answer all questions in this section)
7. An entity can have many Unique Identifiers. True or False? Mark for Review
(1) Points
True (*)
False
8. Which of the following statements about relationships are true? (Choose Two) Mark for
Review
(1) Points
9. The entity/relationship model is created before the physical database design model. True
or False? Mark for Review
(1) Points
True (*)
False
Are Required. The data model is not complete until all entities have a Primary UID. (*)
You may create more than one Primary Unique Identifier for an entity
Page 1 of 5
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 2 Lesson 2
(Answer all questions in this section)
11. A/an _________ is a picture of all the information that will form the basis for the
finished system. Mark for Review
(1) Points
ERD (*)
Process
Table
Attribute
12. All of the following would be instances of the entity ANIMAL SPECIES except which?
Mark for Review
(1) Points
Dog
Bird
Elephant
Leaf (*)
experience
instance
table (*)
14. One Relationship can be both mandatory and optional at different ends. True or False?
Mark for Review
(1) Points
True (*)
False
15. Relationships represents something of significance to the business? True or False? Mark
for Review
(1) Points
True (*)
False
Section 3 Lesson 2
(Answer all questions in this section)
16. Entity Boxes are drawn with 90 degree angles, also known as Hard Boxes. True or
False? Mark for Review
(1) Points
True
False (*)
Big Toe
Single Foot
Crows Foot
Section 3 Lesson 3
(Answer all questions in this section)
18. When reading an ERD including Relationships you are said to be speaking: Mark for
Review
(1) Points
Relationship-ish
Gibberish
ERDish (*)
Entity-ish
Section 4 Lesson 1
(Answer all questions in this section)
19. Which of the following are suitable Entity names? (Choose Two) Mark for Review
(1) Points
DOGS
ANIMAL (*)
ANIMALS
DOG (*)
20. All instances of a subtypes may be an instance of the supertype but does not have to.
True or False? Mark for Review
(1) Points
True
False (*)
Section 4 Lesson 1
(Answer all questions in this section)
21. The "Other" subtype is mandatory. True or False? Mark for Review
(1) Points
True
False (*)
22. When creating entities you must follow these rules: (Choose Two) Mark for Review
(1) Points
Exclude Attributes
23. A Supertype can have only one subtype. True or False? Mark for Review
(1) Points
True
False (*)
Section 4 Lesson 2
(Answer all questions in this section)
24. "Only teachers may supervise exams" is an example of which of the following? Mark
for Review
(1) Points
An attribute that is not be inherited from the PERSON supertype and is unique to the
TEACHER subtype
25. How would you model a business rule that states that girls and boys may not attend
classes together? Mark for Review
(1) Points
Use a supertype
Use two subtypes with relationships from class to student gender (*)
26. A business rule such as "We only ship goods after customers have completely paid any
outstanding balances on their account" is best enforced by: Mark for Review
(1) Points
We need to trust our customers, and we know they will pay some day.
Hiring a programmer to create additional programming code to verify no goods are shipped
until the account has been settled in full. (*)
27. Business rules are important to data modelers. True or False? Mark for Review
(1) Points
True (*)
False
Section 5 Lesson 1
(Answer all questions in this section)
28. Transferable relationships can only be mandatory, not optional. True or False? Mark for
Review
(1) Points
True
False (*)
Section 5 Lesson 2
(Answer all questions in this section)
29. Which of the following pairs of entities is most likely to be modeled as a M:M
relationship? Mark for Review
(1) Points
30. How do you include a relationship as part of the UID for an entity? Mark for Review
(1) Points
By including the UID from the parent entity as an attribute in the entity
You cannot model that.
Page 3 of 5
Section 5 Lesson 2
(Answer all questions in this section)
31. Many to many relationships must be left in the Model. It is important to have them
documented as M-M. True or False? Mark for Review
(1) Points
True
False (*)
32. A relationship from an entity back to itself is called a ___________ relationship. Mark
for Review
(1) Points
Mandatory
Recursive (*)
Transferrable
Section 6 Lesson 1
(Answer all questions in this section)
33. The is no limit to how may UID's an entity can have. True or False?
Mark for Review
(1) Points
True (*)
False
Section 6 Lesson 2
(Answer all questions in this section)
34. An entity without repeated values is said to be on 1st Normal Form. True or False?
Mark for Review
(1) Points
True (*)
False
Section 6 Lesson 3
(Answer all questions in this section)
35. Would it be a good idea to model age as an attribute of STUDENT Mark for Review
(1) Points
Yes
Maybe it could stop us having to calculate someones age every time we need it
Sometimes
Section 7 Lesson 1
(Answer all questions in this section)
This entity is NOT in 3rd Normal Form ("no non-UID attribute can be dependent on another
non-UID attribute). True or False?
Mark for Review
(1) Points
True (*)
False
37. Arcs are used to visually represent _________ between two or more relationships in an
ERD. Mark for Review
(1) Points
Sameness
Differencies
Exclusivity (*)
38. Arcs are Mandatory in Data modelling. All ERD's must have at least one Arc. True or
False? Mark for Review
(1) Points
True
False (*)
39. Which of the following would best be represented by an arc? Mark for Review
(1) Points
40. An arc can be modelled as Supertype and Subtypes. True or False? Mark for Review
(1) Points
True (*)
False
Page 4 of 5
Section 7 Lesson 2
(Answer all questions in this section)
41. A relationship can be both Recursive and Hierarchal at the same time. True or False?
Mark for Review
(1) Points
True
False (*)
Section 7 Lesson 3
(Answer all questions in this section)
42. If Audit trail attributes are added to an entity they must be in the entities they are
auditing. True or False? Mark for Review
(1) Points
True (*)
False
Section 8 Lesson 1
(Answer all questions in this section)
43. Communication Skills, Team-working and Presentations skills are all important for
Consultants. True or False? Mark for Review
(1) Points
True (*)
False
Section 8 Lesson 2
(Answer all questions in this section)
44. Which of the following are NOT valid techniques for effective public speaking?
(Choose Two) Mark for Review
(1) Points
Whispering (*)
Being enthusiastic
Section 10 Lesson 1
(Answer all questions in this section)
45. What do users of a system without the concept of time loose? Mark for Review
(1) Points
46. When you add the concept of time to your data model, your model becomes more
complex. True or False? Mark for Review
(1) Points
True (*)
False
47. Modeling historical data is Optional. True or False? Mark for Review
(1) Points
True (*)
False
48. If a system includes the concept of time, and it stores Start Dates, then End Dates
becomes Mandatory. For each Start Date attribute you create, you MUST create an End Date
attribute and it must be mandatory. True or False? Mark for Review
(1) Points
True
False (*)
Section 10 Lesson 2
(Answer all questions in this section)
49. You are doing a data model for a computer sales company, where the price of postage is
dependant on what day of the week goods are shipped. So shipping is more expensive if the
customer wants a delivery to take place on a Saturday or Sunday. What would be the best way
to model this? Mark for Review
(1) Points
Use a Delivery Day entity, which holds prices against week days, and ensure the we also
have an attribute for the Requested Delivery Day in the Order Entity. (*)
Update the prices in the system, print out the current prices when they change and pin them
on the company noticeboard
True
False (*)
sectiunea 17
1. Which of the following commands will display the last name concatenated with the job ID
from the employees table, separated by a comma and space, and label the resulting column
"Employee and Title"? Mark for Review
(1) Points
SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM employees;
SELECT last_name||', '|| job_id "Employee and Title" FROM employees; (*)
SELECT " last name" ||', '|| "job_id" + "Employee and Title" FROM emp;
2. You want to determine the orders that have been placed by customers who reside in
Chicago. You write this partial SELECT statement:
SELECT orderid, orderdate, total
FROM orders;
What should you include in your SELECT statement to achieve the desired results?
Mark for Review
(1) Points
!=
IN (*)
BETWEEN..AND..
4. You need to display all the employees whose last name starts with the letters Sm . Which
WHERE clause should you use? Mark for Review
(1) Points
5. You want to retrieve a list of customers whose last names begin with the letters Fr . Which
keyword should you include in the WHERE clause of your SELECT statement to achieve the
desired result? Mark for Review
(1) Points
AND
IN
BETWEEN
LIKE (*)
6. Which comparison condition would you use to select rows that match a character pattern?
Mark for Review
(1) Points
IN
LIKE (*)
ALMOST
SIMILAR
7. You need to display only unique combinations of the LAST_NAME and MANAGER_ID
columns in the EMPLOYEES table. Which keyword should you include in the SELECT
clause? Mark for Review
(1) Points
ONLY
UNIQUE
DISTINCT (*)
DISTINCTROW
8. You need to display employees whose salary is in the range of 10000 through 25000 for
employees in department 50 . What does the WHERE clause look like? Mark for Review
(1) Points
WHERE department_id = 50
AND salary BETWEEN 25001 AND 10001
WHERE department_id = 50
AND salary BETWEEN 25000 AND 10000
(*)
9. Which symbol represents the not equal to condition? Mark for Review
(1) Points
#
'+'
!= (*)
10. When using the LIKE condition, which symbol represents any sequence of none, one or
more characters? Mark for Review
(1) Points
% (*)
&
11. Which clause would you include in a SELECT statement to restrict the data returned to
only the employees in department 10? Mark for Review
(1) Points
WHERE (*)
FROM
SELECT
IS
The first statement will NOT display values from all of the rows in the EMPLOYEES table
13. You want to create a report that displays all employees who were hired before January 1,
2000 and whose annual salaries are greater than 50000.
The EMPLOYEES table contains these columns:
Each MAIN_SUBJECT_ID can be displayed more than once per ADVISOR_ID. (*)
15. If you write queries using the BETWEEN operator it does not matter in what order you
enter the values, i.e. BETWEEN low value AND high value will give the same result as
BETWEEN high value and low value. True or False? Mark for Review
(1) Points
True
False (*)
You are writing a SELECT statement to retrieve the names of employees that have an email
address.
18. What will the result of the following SELECT statement be:
SELECT last_name, salary, salary + 300
FROM employees;
How will the heading for the SALARY column appear in the display by default in Oracle
Application Express?
Mark for Review
(1) Points
Display the last name, salary and the results of adding 300 to each salary for all the
employees (*)
Modify the salary column by adding 300 and displaying the last name, salary and the new
salary.
Modify the salary column by adding 300 and only display the last name and the new salary.
Display the last name, salary and the results of adding 300 to the salary of the first
employee row
19. You want to retrieve a list of customers whose last names begin with the letters Fr .
Which symbol should you include in the WHERE clause of your SELECT statement to
achieve the desired result? Mark for Review
(1) Points
% (*)
Which SELECT statement should you use if you want to display unique combinations of the
TEAM_ID and MANAGER_ID columns?
Mark for Review
(1) Points
22. Which of the following elements cannot be included in a WHERE clause? Mark for
Review
(1) Points
A column name
A comparison condition
A constant
23. What does the DISTINCT keyword do when it is used in a SELECT clause? Mark for
Review
(1) Points
24. You need to display employees with salaries that are at least 30000 or higher. Which
comparison operator should you use? Mark for Review
(1) Points
>
"=>"
>= (*)
!=
You want to display product costs with these desired results: 1. The cost displayed for each
product is increased by 10 percent. 2. The product location id must be 4859, 9789, or 9898. 3.
Ten percent of the original cost is less than $10. Which statement should you issue?
Mark for Review
(1) Points
26. When using the LIKE condition to search for _ symbols, which character can you use as
the default ESCAPE option? Mark for Review
(1) Points
&
\ (*)
27. Which operator is used to combine columns of character strings to other columns? Mark
for Review
(1) Points
|| (*)
28. Which statement best describes how column headings are displayed by default in Oracle
Application Express: Mark for Review
(1) Points
29. Where in a SQL statement can you not use arithmetic operators? Mark for Review
(1) Points
SELECT
FROM (*)
WHERE
NONE
30. You need to display all the values in the EMAIL column that contains the underscore (_)
character as part of that email address. The WHERE clause in your SELECT statement
contains the LIKE operator. What must you include in the LIKE operator? Mark for Review
(1) Points
The ESCAPE option (\) and one or more percent signs (%)
How will the heading for the SALARY column appear in the display by default in Oracle
Application Express?
Mark for Review
(1) Points
The heading will display with the first character capitalized and centered.
The heading will display with the first character capitalized and left justified.
33. You need to combine the FIRST_NAME and LAST_NAME columns in the
EMPLOYEES table and display the columns as a combined character string. Which operator
should you use? Mark for Review
(1) Points
|
|| (*)
AND
34. The Concatenation Operator does which of the following? Mark for Review
(1) Points
Links two or more columns or literals to form a single output column (*)
Separates columns.
35. Which SELECT statement will display both unique and non-unique combinations of the
MANAGER_ID and DEPARTMENT_ID values from the EMPLOYEES table? Mark for
Review
(1) Points
36. You need to display all the rows in the EMPLOYEES table that contain a null value in
the DEPARTMENT_ID column. Which comparison operator should you use? Mark for
Review
(1) Points
"= NULL"
NULL!
ISNULL
IS NULL (*)
37.
sectiunea 12
True
False (*)
2. An "Arc Implementation" can be done just like any other Relationship - you simply add
the required Foreign Keys. True or False? Mark for Review
(1) Points
True
False (*)
3. The Oracle Database can implement a many to many relationship. You simply create two
foreign keys between the two tables. True or False? Mark for Review
(1) Points
True
False (*)
4. 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 (*)
True (*)
False
Entity integrity
User-defined integrity
Column integrity
Entity integrity
Column integrity
Referential integrity
8. The explanation below is a User Defined integrity rule and must therefore be manually
coded, the Database cannot enforce this rule automatically:
A primary key must be unique, and no part of the primary key can be null. True or False?
Mark for Review
(1) Points
True
False (*)
Column
11. Why would this table name NOT work in an Oracle database? this_year_end+next_year
Mark for Review
(1) Points
Too long
12. When mapping supertypes, relationships at the supertype level transform as usual.
Relationships at subtype level are implemented as foreign keys, but the foreign key columns
all become mandatory. True or False? Mark for Review
(1) Points
True
False (*)
13. When translating an arc relationship to a physical design, you must turn the arc
relationships into foreign keys. Assuming you are implementing an Exclusive Design, you
must also create two Unique Key Constraints to ensure the Arc is implemented correctly. True
or False? Mark for Review
(1) Points
True
False (*)
14. Foreign keys must be null. True or False? Mark for Review
(1) Points
True
False (*)
15. A table must have a primary key. True or False? Mark for Review
(1) Points
True
False (*)
17. If a primary key is a set of columns then one column must be null. True or False? Mark
for Review
(1) Points
True
False (*)
18. Attributes become tables in a database. True or False? Mark for Review
(1) Points
True
False (*)
19. In a physical data model, an attribute becomes a _____________. Mark for Review
(1) Points
Table
Foreign Key
Constraint
Column (*)
20. What do you create when you transform a many to many relationship from your ER
diagram into a physical design? Mark for Review
(1) Points
Intersection entity
Columns having Primary Keys, Foreign Keys, Unique Keys and Check constraints defined
in the database.
Tables having Primary Keys, Foreign Keys, Unique Keys and Check constraints defined in
the database. (*)
22. Identify all of the incorrect statements that complete this sentence: A primary key is:
(Choose three) Mark for Review
(1) Points
One or more columns in a table that uniquely identifies each row in that table
A set of columns in one table that uniquely identifies each row in another table (*)
23. Many to many relationships are implemented via a structure called a: ________________
Mark for Review
(1) Points
Supertype
Intersection Entity
Subtype
24. In an Oracle database, why would 1_TABLE not work as a table name? Mark for
Review
(1) Points
Object names must not start with a number. They must begin with a letter (*)
Columns
Tables
26. Which of the following are reasons why you should consider using a Subtype
Implementation? Mark for Review
(1) Points
The resulting table will reside in a single database and be used by just ONE user.
When the common access paths for the supertypes are different.
Business functionality and business rules, access paths and frequency of access are all very
different between subtypes. (*)
27. A table must have at least one candidate key, as well as its primary key. True or False?
Mark for Review
(1) Points
True
False (*)
28. A foreign key cannot refer to a primary key in the same table. True or False? Mark for
Review
(1) Points
True
False (*)
True
False (*)
sectiunea 13
1. What command will return data from the database to you? Mark for Review
(1) Points
FETCH
GET
SELECT (*)
RETURN
2. What command can be used to create a new row in a table in the database? Mark for
Review
(1) Points
CREATE
NEW
ADD
INSERT (*)
3. The DESCRIBE command returns all rows from a table. True or False? Mark for Review
(1) Points
True
False (*)
4. The _______ clause can be added to a SELECT statement to return a subset of the data.
Mark for Review
(1) Points
ANYWHERE
WHICH
WHERE (*)
EVERY
1. You cannot use computers unless you completely understand exactly how they work. True
or False? Mark for Review
(1) Points
True
False (*)
2. All computers in the world speak the same languages, so you only need to learn one
programming language - Oracle SQL. True or False? Mark for Review
(1) Points
True
False (*)
3. When listing columns in the SELECT list, what should you use to separate the columns?
Mark for Review
(1) Points
Commas (*)
Semicolons
Dashes
Underscores
4. When you use the SELECT clause to list one or two columns only from a table and no
WHERE clause, which SQL capability is used? Mark for Review
(1) Points
Joining only
Selection only
5. Which statement best describes how arithmetic expressions are handled? Mark for Review
(1) Points
Multiplication and subtraction operations are handled before any other operations.
Multiplication and addition operations are handled before subtraction and division
operations.
Division and multiplication operations are handled before subtraction and addition
operations. (*)
6. What would you use in the SELECT clause to return all the columns in the table? Mark for
Review
(1) Points
All three columns contain values greater than zero. There is one row of data in the table and
the values are as follows:
1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;
2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;
8. The SELECT statement retrieves information from the database. In a SELECT statement,
you can do all of the following EXCEPT: Mark for Review
(1) Points
Projection
Manipulation (*)
Joining
Selection
9. If a SQL statement returns data from two or more tables, which SQL capability is being
used? Mark for Review
(1) Points
Selection
Projection
Joining (*)
Insertion
10. In a SELECT statement Additions are evaluated before Multiplications. True or False?
Mark for Review
(1) Points
True
False (*)
If the RAISE_PERCENT column only contains null values, what will the statement return?
Mark for Review
(1) Points
Only zeroes
Only null values (*)
A null value or a numeric value depending on the value of the SALARY column
12. Which SQL statement will return an error? Mark for Review
(1) Points
8 (*)
10
13
14. You want to create a list of all albums that have been produced by the company. The list
should include the title of the album, the artist's name, and the date the album was released.
The ALBUMS table includes the following columns:
ALB_TITLE VARCHAR2(150) NOT NULL
ALB_ARTIST VARCHAR2(150) NOT NULL
ALB_DATE DATE NOT NULL
SELECT *
FROM albums;
(*)
15. In which clause of a SELECT statement would you specify the name of the table or tables
being queried? Mark for Review
(1) Points
Any of the above options, you can list tables wherever you want to in a SELECT statement
16. In the default order of precedence, which operator would be evaluated first? Mark for
Review
(1) Points
Subtractions
Multiplications (*)
Additions
Divisions
To insert data
18. There is only one kind of software used by all computers. True or False? Mark for
Review
(1) Points
True
False (*)
19. In a SQL statement, which clause specifies one or more columns to be returned by the
query? Mark for Review
(1) Points
SELECT (*)
FROM
WHERE
Any of the above options, you can list columns wherever you want to in a SELECT
statement.
20. Which SQL keyword specifies that an alias will be substituted for a column name in the
output of a SQL query? Mark for Review
(1) Points
AS (*)
OR
AND
SUBSTITUTE
Which SQL SELECT statement capabilities are achieved when this statement is executed?
Mark for Review
(1) Points
sectiunea 18
19
100, 101, 102, 103, 104, 107, 124, 141, 142, 143, 144, 149 (*)
The OR and AND conditions have the same precedence and will be evaluated from left to
right
The OR and AND conditions have the same precedence and will be evaluated from right to
left
5. Which SELECT statement should you use to limit the display of product information to
those products with a price of less than 50? Mark for Review
(1) Points
The rows will be sorted in reverse alphabetical order by the LAST_NAME values.
The rows will be sorted alphabetically by the FIRST_NAME and then the LAST_NAME
values
7. The ORDER BY clause always comes last. True or False? Mark for Review
(1) Points
True (*)
False
8. Which of the following is TRUE regarding the logical AND operator? Mark for Review
(1) Points
9. Which statement about the ORDER BY clause is true? Mark for Review
(1) Points
The ORDER BY clause can only contain columns that are included in the SELECT list.
The ORDER BY clause should immediately precede the FROM clause in a SELECT
statement
10. You need to change the default sort order of the ORDER BY clause so that the data is
displayed in reverse alphabetical order. Which keyword should you include in the ORDER
BY clause? Mark for Review
(1) Points
DESC (*)
ASC
SORT
CHANGE
11. Which statement about the logical operators is true? Mark for Review
(1) Points
12. Which comparison condition means "Less Than or Equal To?" Mark for Review
(1) Points
"=)"
"+<"
">="
"<=" (*)
This statement fails when executed. Which change will correct the problem?
Mark for Review
(1) Points
15. From left to right, what is the correct order of Precedence? Mark for Review
(1) Points
16. Which clause would you include in a SELECT statement to sort the rows returned by the
LAST_NAME column? Mark for Review
(1) Points
ORDER BY (*)
WHERE
FROM
HAVING
17. Which statement about the default sort order is true? Mark for Review
(1) Points
18. Which logical operator returns TRUE if either condition is true? Mark for Review
(1) Points
OR (*)
AND
NOT
BOTH
1.
SELECT DISTINCT department_id DEPT, last_name, first_name
FROM employees
ORDER BY department_id;
2.
SELECT department_id DEPT, last_name, first_name
FROM employees
ORDER BY DEPT;
50
25 (*)
10
250 (*)
100
21. You attempt to query the database with this SQL statement:
SELECT product_id "Product Number", category_id "Category", price "Price"
FROM products
WHERE "Category" = 5570
ORDER BY "Product Number";
This statement fails when executed. Which clause contains a syntax error?
Mark for Review
(1) Points
FROM products
22. You need to create a report to display all employees that were hired on or before January
1, 1996. The data should display in this format:
Employee Start Date and Salary
14837 - Smith 10-MAY-92 / 5000
Which operator is the equivalent of the OR conditions used in this SELECT statement?
Mark for Review
(1) Points
IN (*)
AND
LIKE
You need to sort data by manager id values and then alphabetically by employee last name
and first name values. Which ORDER BY clause could you use?
Mark for Review
(1) Points
1.
SELECT DISTINCT department_id DEPT, last_name, first_name
FROM employees
ORDER BY department_id;
2.
SELECT department_id DEPT, last_name, first_name
FROM employees
ORDER BY DEPT;
The database will display the rows in whatever order it finds it in the database, so no
particular order. (*)
FROM employees
ORDER BY last_name, 3;
28. Which statement about the default sort order is true? Mark for Review
(1) Points
29. Which of the following best describes the meaning of the LIKE operator? Mark for
Review
(1) Points
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Semester 2 Final Exam Part I covers Sections 8-10 of Database Programming with SQL.
Section 8
1. You need to store the SEASONAL data in months and years. Which data type should you
use? Mark for Review
(1) Points
DATE
TIMESTAMP
2. You need to store the HIRE_DATE value with a time zone displacement value and allow
data to be returned in the user's local session time zone. Which data type should you use?
Mark for Review
(1) Points
DATETIME
TIMESTAMP
Correct
Data stored in the column will be returned in the database's local time zone. (*)
Correct
5. The SPEED_TIME column should store a fractional second value. Which data type
should you use? Mark for Review
(1) Points
DATE
DATETIME
TIMESTAMP (*)
All employee identification values are only 6 digits so the column should be variable in
length.
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. (*)
7. To store time with fractions of seconds, which datatype should be used for a table
column? Mark for Review
(1) Points
DATE
TIMESTAMP (*)
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.
9. 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.
Correct
10. Which CREATE TABLE statement will fail? Mark for Review
(1) Points
Page 1 of 5
11. 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
12. 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
13. 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
2001_PRODUCTS
PRODUCTS_2001 (*)
PRODUCTS_(2001)
PRODUCTS--2001
Correct
14. Comments on tables and columns can be stored for documentation by: Mark for Review
(1) Points
Which statement should you use to decrease the width of the FIRST_NAME column to 10 if
the column currently contains 1500 records, but none are longer than 10 bytes or characters?
Mark for Review
(1) Points
16. 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
ALTER TABLE
DROP TABLE
MODIFY
18. You need to truncate the EMPLOYEES table. The EMPLOYEES table is not in your
schema. Which privilege must you have to truncate the table? Mark for Review
(1) Points
19. 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 convert a CHAR data type column to the VARCHAR2 data type.
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
21. 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
TRUNCATE TABLE
ALTER TABLE
Correct
You CANNOT modify the data type of the EMPLOYEE_ID column, as the table is not
empty. (*)
Correct
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));
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. (*)
You cannot decrease the width of a character column unless the table in which the column
resides is empty.
Section 10
25. Which statement about a FOREIGN KEY constraint is true? Mark for Review
(1) Points
A FOREIGN KEY constraint requires the constrained column to contain values that exist
in the referenced Primary or Unique key column of the parent table. (*)
A FOREIGN KEY constraint allows that a list of allowed values be checked before a value
can be added to the constrained column.
A FOREIGN KEY column can have a different data type from the primary key column that
it references.
Correct
26. What must exist on the Parent table before Oracle will allow you to create a FOREIGN
KEY constraint from a Child table? Mark for Review
(1) Points
A FOREIGN KEY constraint allows the constrained column to contain values that exist in
the primary key column of the parent table.
A PRIMARY or UNIQUE KEY constraint must exist on the Parent table. (*)
27. You need to create a composite primary key constraint on the EMPLOYEES table.
Which statement is true? Mark for Review
(1) Points
The PRIMARY KEY constraint must be defined at the table level. (*)
A PRIMARY KEY constraint must be defined for each column in the composite primary
key.
The PRIMARY KEY constraint must be defined for the first column of the composite
primary key.
The PRIMARY KEY constraint must be defined at the table level and for each column in
the composite primary key.
28. When creating the EMPLOYEES table, which clause could you use to ensure that salary
values are 1000.00 or more? Mark for Review
(1) Points
Correct
29. How many PRIMARY KEY constraints can be created for each table? Mark for
Review
(1) Points
None
One and only one (*)
One or two
Unlimited
30. What is an attribute of data that is entered into a primary key column? Mark for Review
(1) Points
Null and non-unique values cannot be entered into a primary key column. (*)
Data that is entered into a primary key column automatically increments by a value of 1
each time a new record is entered into the table.
Data that is entered into a primary key column references a column of the same datatype in
another table.
Data that is entered into a primary key column is restricted to a range of numbers that is
defined by the local Oracle database.
31. Which clause could you use to ensure that cost values are greater than 1.00? Mark for
Review
(1) Points
32. Which of the following best describes the function of a CHECK constraint? Mark for
Review
(1) Points
A CHECK constraint enforces uniqueness of the values that can be entered in a column or
combination of columns.
33. Which statement about a non-mandatory foreign key constraint is true? Mark for
Review
(1) Points
A foreign key value must match an existing value in the parent table.
A foreign key value must either be null or match an existing value in the parent table. (*)
Correct
EMPLOYEE_ID NUMBER
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER
JOB_ID NUMBER
MANAGER_ID NUMBER
SALARY NUMBER(9,2)
HIRE_DATE DATE
The ALTER TABLE statement creates a referential constraint from the EMPLOYEES
table to the DEPARTMENTS table.
The ALTER TABLE statement creates a referential constraint from the DEPARTMENTS
table to the EMPLOYEES table.
The ALTER TABLE statement fails because the ADD CONSTRAINT clause contains a
syntax error. (*)
The ALTER TABLE statement succeeds, but does NOT recreate a referential constraint.
Correct
You need to disable the FOREIGN KEY constraint. Which statement should you use?
Mark for Review
(1) Points
Correct
36. Which of the following would definitely cause an integrity constraint error? Mark for
Review
(1) Points
Using the DELETE command on a row that contains a primary key with a dependent
foreign key declared without either an ON DELETE CASCADE or ON DELETE SET
NULL. (*)
37. 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;
The statement will execute, but will ensure that the new ID values are unique.
The statement will execute, but will not verify that the existing values are unique.
The statement will NOT execute because it contains a syntax error. (*)
38. When dropping a constraint, which keyword(s) specifies that all the referential integrity
constraints that refer to the primary and unique keys defined on the dropped columns are
dropped as well? Mark for Review
(1) Points
FOREIGN KEY
REFERENCES
CASCADE (*)
39. You successfully create a table named SALARY in your company's database. Now, you
want to establish a parent/child relationship between the EMPLOYEES table and the
SALARY table by adding a FOREIGN KEY constraint to the SALARY table that references
its matching column in the EMPLOYEES table. You have not added any data to the
SALARY table. Which of the following statements should you issue? Mark for Review
(1) Points
To drop and recreate the PRIMARY KEY constraint on the PO_NUM column
To disable the PRIMARY KEY and any FOREIGN KEY constraints that are dependent on
the PO_NUM column (*)
To disable the constraint on the PO_NUM column while creating a PRIMARY KEY index
41. What actions can be performed on or with Constraints? Mark for Review
(1) Points
Correct
To activate a new constraint while preventing the creation of a PRIMARY KEY index
To activate the previously disabled constraint on the EMPLOYEE_ID column while
creating a PRIMARY KEY index (*)
Correct
43. You need to add a PRIMARY KEY constraint on the EMP_ID column of the
EMPLOYEES table. Which ALTER TABLE statement should you use? Mark for Review
(1) Points
ALTER TABLE
ADD CONSTRAINT emp_emp_id_pk PRIMARY KEY employees(emp_id);
Correct
Correct
NOT NULL constraints can only be specified at the column level. (*)
46. Primary Key, Foreign Key, Unique Key and Check Constraints can be added at which
two levels? (Choose two) Mark for Review
(1) Points
Null Field
Table (*)
Row
Dictionary
Column (*)
Correct
47. You need to ensure that each value in the SEAT_ID column is unique or null. Which
constraint should you define on the SEAT_ID column? Mark for Review
(1) Points
CHECK
UNIQUE (*)
NOT NULL
PRIMARY KEY
Correct
48. What is the highest number of NOT NULL constraints you can have on a table? Mark
for Review
(1) Points
10
You can have as many NOT NULL constraints as you have columns in your table. (*)
Correct
49. Which statement about the NOT NULL constraint is true? Mark for Review
(1) Points
The NOT NULL constraint must be defined at the column level. (*)
The NOT NULL constraint can be defined at either the column level or the table level.
The NOT NULL constraint prevents a column from containing alphanumeric values.
50. You need to ensure that the LAST_NAME column only contains certain character
values. No numbers or special characters are allowed.
Which type of constraint should you define on the LAST_NAME column? Mark for Review
(1) Points
CHECK (*)
UNIQUE
NOT NULL
PRIMARY KEY
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Semester 2 Final Exam Part II covers Sections 11-16 of Database Programming with SQL
also.
Section 11
1. You need to create a view that when queried will display the name, employee
identification number, first and last name, salary, and department identification number.
When queried, the display should be sorted by salary from lowest to highest, then by last
name and first name alphabetically. The view definition should be created regardless of the
existence of the EMPLOYEES table. No DML may be performed when using this view.
Evaluate these statements:
CREATE OR REPLACE NOFORCE VIEW EMP_SALARY_V
AS SELECT employee_id, last_name, first_name, salary, department_id
FROM employees WITH READ ONLY;
SELECT *
FROM emp_salary_v
ORDER BY salary, last_name, first_name;
Which statement is true?
Mark for Review
(1) Points
When both statements are executed all of the desired results are achieved.
The CREATE VIEW statement will fail if the EMPLOYEES table does not exist. (*)
The statements will NOT return all of the desired results because the WITH CHECK
OPTION clause is NOT included in the CREATE VIEW statement.
To achieve all of the desired results this ORDER ON clause should be added to the
CREATE VIEW statement: 'ORDER ON salary, last_name, first_name?.
Which of the following statements using the PART_NAME_V view will execute
successfully?
Mark for Review
(1) Points
SELECT *
FROM part_name_v;
(*)
UPDATE part_name_v
SET cost = cost * 1.23
WHERE part_id = 56990;
3. Which of the following keywords cannot be used when creating a view? Mark for
Review
(1) Points
HAVING
WHERE
ORDER BY
Correct
4. In order to query a database using a view, which of the following statements applies?
Mark for Review
(1) Points
You can retrieve data from a view as you would from any table. (*)
You can never see all the rows in the table through the view.
The tables you are selecting from can be empty, yet the view still returns the original data
from those tables.
Correct
5. Views must be used to select data from a table. As soon as a view is created on a table,
you can no longer select directly from the table. True or False? Mark for Review
(1) Points
True
False (*)
6. Which option would you use to modify a view rather than dropping it and recreating it?
Mark for Review
(1) Points
FORCE
NOFORCE
7. Which statement about the CREATE VIEW statement is true? Mark for Review
(1) Points
Which SELECT statement could be used to display the 10 lowest paid clerks that belong to
department 70?
Mark for Review
(1) Points
The statement will not necessarily return the 25 highest new balance values, as the inline
view has no ORDER BY. (*)
The 25 greatest new balance values were displayed from the highest to the lowest.
The statement failed to execute because the ORDER BY does NOT use the Top-n column.
10. An inline view is an unnamed select statement found: Mark for Review
(1) Points
Section 11
11. The EMP_HIST_V view is no longer needed. Which statement should you use to the
remove this view? Mark for Review
(1) Points
DROP emp_hist_v;
DELETE emp_hist_v;
REMOVE emp_hist_v;
12. Which of the following describes a top-N query? Mark for Review
(1) Points
A top-N query returns the bottom 15 records from the specified table.
A top-N query returns the top 15 records from the specified table.
A top-N query returns a result set that is sorted according to the specified column values.
A top-N query returns a limited result set, returning data based on highest or lowest criteria.
(*)
13. You create a view on the EMPLOYEES and DEPARTMENTS tables to display salary
information per department. What will happen if you issue the following statement:
CREATE OR REPLACE VIEW sal_dept
AS SELECT SUM(e.salary) sal, d.department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
GROUP BY d.department_name
ORDER BY d.department_name;
Mark for Review
(1) Points
A complex view is created that returns the sum of salaries per department, sorted by
department name. (*)
A simple view is created that returns the sum of salaries per department, sorted by
department name.
A complex view is created that returns the sum of salaries per department, sorted by
department id.
14. For a View created using the WITH CHECK OPTION keywords, which of the
following statements are true? Mark for Review
(1) Points
The view will allow the user to check it against the data dictionary
Prohibits changing rows not returned by the subquery in the view definition. (*)
Allows for DELETES from other tables, including ones not listed in subquery
15. Your manager has just asked you to create a report that illustrates the salary range of all
the employees at your company. Which of the following SQL statements will create a view
called SALARY_VU based on the employee last names, department names, salaries, and
salary grades for all employees? Use the EMPLOYEES, DEPARTMENTS, and
JOB_GRADES tables. Label the columns Employee, Department, Salary, and Grade,
respectively. Mark for Review
(1) Points
Correct
16. Which option would you use when creating a view to ensure that no DML operations
occur on the view? Mark for Review
(1) Points
FORCE
NOFORCE
Correct
17. You need to create a new view on the EMPLOYEES table to update salary information
for employees in Department 50. You need to ensure that DML operations through the view
do not change the result set of the view. Which clause should include in the CREATE VIEW
statement? Mark for Review
(1) Points
FORCE
OR REPLACE
18. You cannot insert data through a view if the view includes ______. Mark for Review
(1) Points
A WHERE clause
A join
A column alias
19. Which of the following is TRUE regarding simple views? Mark for Review
(1) Points
They derive data from many tables, so they typically contain joins.
Correct
Section 12
Future sequence numbers generated will increase by 2 each time a number is generated. (*)
The statement fails if the current value of the sequence is greater than the START WITH
value.
Correct
Page 2 of 5
Section 12
21. Which statement would you use to remove the EMP_ID_SEQ sequence? Mark for
Review
(1) Points
22. What would you create to make the following statement execute faster?
SELECT *
FROM employees
WHERE LOWER(last_name) = 'chang';
Mark for Review
(1) Points
A synonym.
EMP_ID only
JOB_ID only
DEPT_ID only
25. You want to create a composite index on the FIRST_NAME and LAST_NAME
columns of the EMPLOYEES table. Which SQL statement will accomplish this task? Mark
for Review
(1) Points
26. For which column would you create an index? Mark for Review
(1) Points
Section 13
27. Granting an object privilege WITH GRANT OPTION allows the recipient to grant other
object privileges on the table to other users. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 13 Lesson 2.
28. Which keyword would you use to grant an object privilege to all database users? Mark
for Review
(1) Points
ADMIN
ALL
PUBLIC (*)
USERS
Correct
29. Which statement would you use to add privileges to a role? Mark for Review
(1) Points
CREATE ROLE
ALTER ROLE
GRANT (*)
ASSIGN
30. Which statement would you use to grant a role to users? Mark for Review
(1) Points
GRANT (*)
ALTER USER
CREATE USER
ASSIGN
Section 13
31. Which data dictionary view shows which system privileges have been granted to a user?
Mark for Review
(1) Points
USER_TAB_PRIVS
USER_SYS_PRIVS (*)
USER_SYSTEM_PRIVS
USER_SYSTEM_PRIVILEGES
32. Which of the following best describes the purpose of the REFERENCES object
privilege on a table? Mark for Review
(1) Points
It allows a user's session to read from the table but only so that foreign key constraints can
be checked. (*)
It allows the user to create new tables which contain the same data as the referenced table.
33. User SUSAN creates an EMPLOYEES table, and then creates a view EMP_VIEW
which shows only the FIRST_NAME and LAST_NAME columns of EMPLOYEES. User
RUDI needs to be able to access employees' names but no other data from EMPLOYEES.
Which statement should SUSAN execute to allow this? Mark for Review
(1) Points
Correct
34. Evaluate this statement:
ALTER USER bob IDENTIFIED BY jim;
35. User Kate wants to create indexes on tables in her schema. What privilege must be
granted to Kate so that she can do this? Mark for Review
(1) Points
CREATE INDEX
ALTER TABLE
None; users do not need extra privileges to create indexes on tables in their own schema (*)
Correct
36. User JAMES has created a CUSTOMERS table and wants to allow all other users to
SELECT from it. Which command should JAMES use to do this? Mark for Review
(1) Points
37. You want to grant user BOB the ability to change other users' passwords. Which
privilege should you grant to BOB? Mark for Review
(1) Points
38. Which of these SQL functions used to manipulate strings is not a valid regular
expression function? Mark for Review
(1) Points
REGEXP_REPLACE
REGEXP_LIKE
REGEXP (*)
REGEXP_SUBSTR
39. _________________ are special characters that have a special meaning, such as a
wildcard character, a repeating character, a non-matching character, or a range of characters.
You can use several of these symbols in pattern matching. Mark for Review
(1) Points
Clip art
Alphanumeric values
Reference checks
Correct
40. Regular expressions are a method of describing both simple and complex patterns for
searching and manipulating. True or False? Mark for Review
(1) Points
True (*)
False
Correct
Section 14
41. A transaction makes several successive changes to a table. If required, you want to be
able to rollback the later changes while keeping the earlier changes. What must you include in
your code to do this? Mark for Review
(1) Points
An update statement
A savepoint (*)
An object privilege
A database link
A sequence
42. Steven King's row in the EMPLOYEES table has EMPLOYEE_ID = 100 and SALARY
= 24000. A user issues the following statements in the order shown:
UPDATE employees
SET salary = salary * 2
WHERE employee_id = 100;
COMMIT;
UPDATE employees
SET salary = 30000
WHERE employee_id = 100;
The user's database session now ends abnormally. What is now King's salary in the table?
Mark for Review
(1) Points
48000 (*)
30000
24000
78000
Section 15
43. You need to join the EMPLOYEES table and the SCHEDULES table, but the two tables
do not have any corresponding columns. Which type of join will you create? Mark for
Review
(1) Points
An equijoin
A cross join
A non-equijoin (*)
44. What is produced when a join condition is not specified in a multiple-table query using
Oracle proprietary Join syntax? Mark for Review
(1) Points
A self-join
An outer join
An equijoin
You want to determine the amount of each employee's bonus as a calculation of salary times
bonus. Which of the following queries should you issue?
Mark for Review
(1) Points
SALES
SALES_ID NUMBER(5) PRIMARY KEY
CUST_ID NUMBER(10) FOREIGN KEY
TOTAL_SALES NUMBER(30)
Which SELECT statement will return the customer ID, the company and the total sales?
Mark for Review
(1) Points
48. Using Oracle Proprietary join syntax, which operator would you use after one of the
column names in the WHERE clause when creating an outer join? Mark for Review
(1) Points
(+) (*)
Correct
Natural join
Self-join
Equijoin
50. Unit testing is done prior to a database going into production to ensure a random number
of business requirements functions properly. True or False? Mark for Review
(1) Points
True
False (*)
Section 12 Lesson 1
1.
The explanation below is a column integrity constraint: A column must contain only values
consistent with the defined data format of the column. True or False?
True (*)
2.
A table must have a primary key. True or False?
False (*)
3.
The explanation below is a userdefined integrity rule: A primary key must be unique, and no
part of the primary key can be null. True or False?
False (*)
4.
The text below is an example of what constraint type: The value in the manager_id column of
the EMPLOYEES table must match a value in the employee_id column in the EMPLOYEES
table.
Referential integrity (*)
Section 12 Lesson 2
5.
Attributes become tables in a database. True or False?
False (*)
6.
In a physical data model, a relationship is represented as a combination of:
Primary Key or Unique Key (*)
Foreign Key (*)
7.
The transformation from an ER diagram to a physical design involves changing terminology.
Secondary Unique Identifiers becomes
Unique Constraints (*)
8.
One-to-One relationships are transformed into Check Constraints in the tables created at
either end of that relationship. True or False?
False (*)
9.
What do you create when you transform a one to one relationship from your ER diagram into
a physical design?
Intersection table (*)
10.
When mapping supertypes, relationships at the supertype level transform as usual.
Relationships at subtype level are implemented as foreign keys, but the foreign key columns
all become mandatory. True or False?
False (*)
Section 12 Lesson 4
11.
An "Arc Implementation" can be done just like any other Relationship - you simply add the
required Foreign Keys. True or False?
False (*)
Section 13 Lesson 1
12.
What command will return data from the database to you?
SELECT (*)
13.
The _______ clause can be added to a select statement to return a subset of the data.
WHERE (*)
Section 16 Lesson 1
14.
In a SQL statement, which clause specifies one or more columns to be returned by the query?
SELECT (*)
Section 16 Lesson 1
15.
Which SQL keyword specifies that an alias will be substituted for a column name in the
output of a SQL query?
AS (*)
Section 16 Lesson 1
16.
In the default order of precedence, which operator would be evaluated first?
Multiplications (*)
17.
You query the database with this SQL statement:
SELECT * FROM students;
Why would you use this statement?
To view data (*)
18.
Which keyword can be used to specify a column alias?
AS (*)
19.
The EMPLOYEES table contains these columns:
SALARY NUMBER(7,2)
BONUS NUMBER(7,2)
COMMISSION_PCT NUMBER(2,2)
All three columns contain values greater than zero. There is one row of data in the table and
the values are as follows:
Salary = 500, Bonus = 50, Commission_pct = .5
Evaluate these two SQL statements:
1.
SELECT salary + bonus + commission_pct * salary - bonus AS income
FROM employees;
2.
SELECT (salary + bonus ) + commission_pct * (salary - bonus) income
FROM employees;
What will be the result?
20.
In which clause of a SELECT statement would you specify the name of the table or tables
being queried?
the FROM clause (*)
21.
All computers in the world speaks the same languages, so you only need to learn one
programming language - Oracle SQL. True or False?
False (*)
Section 17 Lesson 1
23.
Which comparison operator searches for a specified character pattern?
LIKE (*)
24.
Where in a SQL statement can you not use arithmetic operators?
FROM (*)
25.
You need to display only unique combinations of the LAST_NAME and MANAGER_ID
columns in the EMPLOYEES table. Which keyword should you include in the SELECT
clause?
DISTINCT (*)
26.
When using the LIKE condition to search for _ symbols, which character can you use as the
ESCAPE option?
\ (*)
27.
You need to combine the first and last name values in the EMPLOYEE table and display the
values as a combined character string. Which operator should you use?
|| (*)
Section 17 Lesson 1
28.
Which comparison condition would you use to select rows that match a character pattern?
LIKE (*)
29.
You need write a SELECT statement that should only return rows that contain 34, 46, or 48
for the DEPARTMENT_ID column. Which operator should you use in the WHERE clause to
compare the DEPARTMENT_ID column to this specific list of values?
IN (*)
30.
The PLAYERS table contains these columns:
PLAYER_ID NUMBER (9) Primary Key
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
TEAM_ID NUMBER (4)
MANAGER_ID NUMBER (9)
POSITION_ID NUMBER (4)
Which SELECT statement should you use if you want to display unique combinations of the
TEAM_ID and MANAGER_ID columns?
31.
If the EMPLOYEES table has the following columns, and you want to write a SELECT
statement to return the employee last name and department number for employee number 176,
which of the following SQL statements should you use?
Name Type Length
EMPLOYEE_ID NUMBER 22
FIRST_NAME VARCHAR2 20
LAST_NAME VARCHAR2 25
EMAIL VARCHAR2 25
PHONE_NUMBER VARCHAR2 20
SALARY NUMBER 22
COMMISSION_PCT NUMBER 22
MANAGER_ID NUMBER 22
DEPARTMENT_ID NUMBER 22
32.
Which SELECT statement will display both unique and non-unique combinations of the
MANAGER_ID and DEPT_ID values from the EMPLOYEES table?
SELECT manager_id, department_id FROM employees; (*)
33.
You want to retrieve a list of customers whose last names begin with the letters Fr . Which
symbol should you include in the WHERE clause of your SELECT statement to achieve the
desired result?
% (*)
34.
You want to create a report that displays all employees who were hired before January 1,
2000 and whose annual salaries are greater than 50000.
The EMPLOYEES table contains these columns:
EMPLOYEE_ID VARCHAR2(5) PRIMARY KEY
LAST_NAME VARCHAR2(35)
HIREDATE DATE
DEPARTMENT_ID NUMBER(4)
The SALARY table contains these columns:
SALARYID VARCHAR2(5) PRIMARY KEY
SALARY NUMBER(5, 2)
EMPLOYEE_ID VARCHAR2(5) FOREIGN KEY
Which query should you issue?
Section 17 Lesson 3
35.
The STUDENT table contains these columns:
STUDENT_ID NUMBER(10) Primary Key
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
MAJOR_ID NUMBER(3)
ADVISOR_ID NUMBER(5)
Evaluate this statement:
SELECT DISTINCT advisor_id, major_id
FROM student;
Which statement is true?
Each MAJOR_ID can be displayed more than once per ADVISOR_ID. (*)
Section 17 Lesson 3
36.
The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(9) PrimaryKey
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
DEPARTMENT_ID NUMBER(5) NOT NULL
MANAGER_ID NUMBER(9) NOT NULL
Evaluate these two SELECT statements:
1. SELECT DISTINCT employee_id, department_id, manager_id FROM employees;
2. SELECT employee_id, department_id, manager_id FROM employees;
Which of the following statements is true?
37.
You need to override the default sort order of the ORDER BY clause so that the data is
displayed in reverse alphabetical order. Which keyword should you include in the ORDER
BY clause?
DESC (*)
38.
Which statement about the default sort order is true?
The earliest date values are displayed first. (*)
39.
Which logical operator returns TRUE if either condition is true?
OR (*)
41.
Which of the following best describes the meaning of the LIKE operator?
True (*)
42.
The ORDER BY clause always comes last. True or False?
True (*)
Section 18 Lesson 2
43.
Evaluate this SELECT statement:
SELECT emp_id, last_name, first_name, salary 'Yearly Salary'
FROM employees
WHERE salary IS NOT NULL
ORDER BY last_name, 3;
Which clause contains an error?
44.
Evaluate this SQL statement:
SELECT product_id, product_name, price
FROM products
ORDER BY product_name, price;
What occurs when the statement is executed?
IN (*)
46.
Evaluate this SELECT statement:
SELECT last_name, first_name, email
FROM employees
ORDER BY email;
If the EMAIL column contains null values, which statement is true?
47.
Evaluate this SELECT statement:
SELECT last_name, first_name, salary
FROM employees;
How will the results of this query be sorted?
The database will display the rows in whatever order it finds it in the database, so no
particular order. (*)
48.
Evaluate this SELECT statement:
SELECT last_name, first_name, department_id, manager_id
FROM employees;
You need to sort data by manager id values and then alphabetically by employee last name
and first name values. Which ORDER BY clause could you use?
Section 18 Lesson 3
49.
The PLAYERS table contains these columns:
PLAYERS TABLE:
LAST_NAME VARCHAR2 (20)
FIRST_NAME VARCHAR2 (20)
SALARY NUMBER(8,2)
TEAM_ID NUMBER(4)
MANAGER_ID NUMBER(9)
POSITION_ID NUMBER(4)
You want to display all players' names with position 6900 or greater. You want the players
names to be displayed alphabetically by last name and then by first name. Which statement
should you use to achieve the required results?
50.
The EMPLOYEES table contains these columns:
EMPLOYEE_ID NUMBER(9) PK
LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
DEPARTMENT_ID NUMBER(9)
Compare these two SQL statements:
1.
SELECT DISTINCT department_id DEPT, last_name, first_name
FROM employees
ORDER BY department_id;
2.
SELECT department_id DEPT, last_name, first_name
FROM employees
ORDER BY DEPT;
How will the results differ?
2. One or more columns in a primary key can be null. True or False? Mark for Review
(1) Points
False (*)
5. A table does not have to have a primary key. True or False? Mark for Review
(1) Points
True (*)
6. A foreign key always refers to a primary key in the same table. True or False? Mark for
Review
(1) Points
False (*)
7. Identify all of the correct statements that complete this sentence: A primary key is ...
(Choose Three) Mark for Review
(1) Points
Columns always containing values consistent with the defined data format (*)
Table (*)
6. In an Oracle database, why would the following table name not be allowed 'EMPLOYEE
JOBS'? Mark for Review
True (*)
1. Relationships on an ERD can only be transformed into UIDs in the physical model? True
or False? Mark for Review
(1) Points
False (*)
Nothing (There are no new columns created on the Master table) (*)
3. Two entities A and B have an optional (A) to Mandatory (B) One-to-One relationship.
When they are transformed, the Foreign Key(s) is placed on: Mark for Review
(1) Points
4. What do you create when you transform a many to many relationship from your ER
diagram into a physical design? Mark for Review
(1) Points
5. A barrred Relationship will result in a Foreign Key column that also is part of: Mark for
Review
(1) Points
6. One-to-One relationships are transformed into Foreign Keys in the tables created at either
end of that relationship? True or False? Mark for Review
(1) Points
False (*)
1. When mapping supertypes, relationships at the supertype level transform as usual.
Relationships at subtype level are implemented as foreign keys, but the foreign key columns
all become optional. True or False? Mark for Review
(1) Points
True (*)
2. The "Arc Implementation" is a synonym for what type of implementation? Mark for
Review
(1) Points
3. Which of the following are reasons you should consider when using a Subtype
Implementation? Mark for Review
When the common access paths for the subtypes are different. (*)
4. When translating an arc relationship to a physical design, you must turn the arc
relationships into foreign keys. What additional step must you take with the created foreign
keys to ensure the exclusivity principle of arc relationships? (Assume that you are
implementing an Exclusive Design) (Choose Two) Mark for Review
Create an additional check constraint to verify that one foreign key is populated and the
others are not (*)
This statement will retrieve all the rows in the employees table. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
2. What command can be added to a select statement to return a subset of the data? Mark
for Review
(1) Points
WHERE (*)
WHEN
ALL
EVERYONE
Correct
3. What command retrieves data from the database? Mark for Review
(1) Points
ALTER
SELECT (*)
DESCRIBE
INSERT
Correct
4. What command can be used to show information about the structure of a table? Mark for
Review
(1) Points
ALTER
SELECT
DESCRIBE (*)
INSERT
Correct
5. What command do you use to add rows to a table Mark for Review
(1) Points
INSERT (*)
ADD
ADD_ROW
NEW_ROW
1. The SQL statement ALTER TABLE EMPLOYEES DROP COLUMN SALARY will
delete all of the rows in the employees table. True or False? Mark for Review
(1) Points
True
False (*)
Correct
1 (*)
Correct
1. 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
Transition (*)
3. During which phases of the System Development Life Cycle would you roll out the
system to the users? Mark for Review
(1) Points
1. 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
Transition (*)
Build and Document (*)
3. During which phases of the System Development Life Cycle would you roll out the
system to the users? Mark for Review
(1) Points
Statement (*)
* / + - (*)
5. If you want to see just a subset of the columns in a table, you use what symbol? Mark for
Review
(1) Points
None of the above, instead of using a symbol you name the columns you want to see the
data for. (*)
1. RDBMS stands for Mark for Review
(1) Points
Correct
2. Once data has been created in a RDBMS, the ony way of getting it out again is by writing
a Java or C program. No other languages can be used to access that data. True or False? Mark
for Review
(1) Points
True
False (*)
True
False (*)
4. The following statements are true regarding tables in a RDBMS: (Choose Two) Mark for
Review
(1) Points
A table holds all the data necessary about something in the real world, such as employees,
invoices or customers. (*)
Tables contain fields, which can be found at the intersection of a row and a column. (*)
Correct
False (*)
3. In order to eliminate duplicate rows use the ________ keyword Mark for Review
(1) Points
DISTINCT (*)
4. The structure of the table can be displayed with the _________ command: Mark for
Review
(1) Points
2. Which example would limit the number of rows returned? Mark for Review
(1) Points
3. Which of the following are true? (Choose Two) Mark for Review
(1) Points
5. To restrict the rows returned from an SQL Query, you should use the _____ clause:
Mark for Review
(1) Points
WHERE (*)
6. How can you write not equal to in the WHERE-clause Mark for Review
(1) Points
!=
^=
<>
LAST_NAME SALARY
Davies 3100
(*)
1. When using the "LIKE" operator, the % and _ symbols can be used to do a pattern-
matching, wild card search. True or False? Mark for Review
(1) Points
True (*)
False
2. Which of the following WHERE clauses would not select the number 10? Mark for
Review
(1) Points
Correct
3. Which of the following are examples of comparison operators used in the WHERE
clause? Mark for Review
(1) Points
in (..,..,.. )
like
is null
Correct
4. Which two statements would select salaries that are greater than or equal to 2500 and less
than or equal to 3500? (Choose two) Mark for Review
(1) Points
Correct
1. Which of the following is earliest in the rules of precedence? Mark for Review
The order in which the expressions are evaluated and calculated (*)
3. Which symbol in the WHERE clause means "Not Equal To"? (Choose Two) Mark for
Review
(1) Points
<> (*)
4. Find the clause that will give the same results as:
SELECT *
FROM d_cds
WHERE cd_id NOT IN(90, 91, 92);
Mark for Review
(1) Points
5. Which of the following are examples of logical operators that might be used in a WHERE
clause. (Choose Two) Mark for Review
(1) Points
AND, OR (*)
NOT (*)
1. Which of the following is true of the ORDER BY clause: (Choose Two) Mark for
Review
(1) Points
2. A column alias can be specified in an ORDER BY Clause. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
3. What columns can be added to the following SELECT statement in its ORDER BY
clause? (Choose Three)
SELECT first_name, last_name, salary, hire_date
FROM employees
WHERE department_id = 50
ORDER BY ?????;
Mark for Review
(1) Points
The table name, EMPLOYEES, which would then automatically sort by all columns in the
table
Any column in the EMPLOYEES table, any expression in the SELECT list or any ALIAS
in the SELECT list (*)
4. What clause must you place in a SQL statement to have your results sorted from highest
to lowest salary? Mark for Review
(1) Points
None, the database always sorts from highest to lowest on the salary column.
Correct
1. The conversion function TO_CHAR is a single row function. True or False? Mark for
Review
(1) Points
True (*)
2. The function COUNT is a single row function. True or False? Mark for Review
False (*)
False (*)
Yes, it will return the highest salary, the lowest salary and the average salary from all
employees (*)
True (*)
Section 1
(Answer all questions in this section)
1. Which of the following are types of SQL functions? (Choose two correct answers.) Mark
for Review
(1) Points
Column-Row Functions
Many-to-Many Functions
Incorrect. Refer to Section 1 Lesson 1.
2. Character functions accept character arguments and only return character values. True or
False? Mark for Review
(1) Points
True
False (*)
Correct
3. Which query selects the first names of the DJ On Demand clients who have a first name
beginning with "A"? Mark for Review
(1) Points
SELECT UPPER(first_name)
FROM d_clients
WHERE first_name LIKE %a%
SELECT UPPER(first_name)
FROM d_clients v
WHERE first_name LIKE '%a%'
SELECT UPPER(first_name)
FROM d_clients
WHERE first_name LIKE 'a%'
SELECT UPPER(first_name)
FROM d_clients
WHERE LOWER(first_name) LIKE 'a%'
(*)
4. Which query would return a user password combining the ID of an employee and the first
4 characters of the last name? Mark for Review
(1) Points
******SQL
***SQL
SQL*** (*)
SQL******
6. Which character manipulation function always returns a numerical value? Mark for
Review
(1) Points
TRIM
LPAD
LENGTH (*)
SUBSTR
Correct
7. Which of the following SQL statements would correctly return a song title identified in
the database as "All These Years"? Mark for Review
(1) Points
Programming
PROGRAMMING (*)
Database
DATABASE
True
False (*)
2. ROUND and TRUNC functions can be used with which of the following Datatypes?
Mark for Review
(1) Points
Correct
3. Which number function may be used to determine if a value is odd or even? Mark for
Review
(1) Points
MOD (*)
TRUNC
ROUND
BINARY
46
45.9
50 (*)
7/11/1995
1/11/2000
7/11/2000
2. If hire_date has a value of '03-July-03', then what is the output from this code
SELECT ROUND(hire_date, 'Year') FROM employees; Mark for Review
(1) Points
01-JAN-04 (*)
01-JAN-03
01-JUL-03
01-AUG-03
3. What function would you use to return the highest date in a month? Mark for Review
(1) Points
FINAL_DAY
END_DAY
HIGHEST_DAY
LAST_DAY (*)
True
False (*)
3. Sysdate is 12-MAY-2004.
You need to store the following date: 7-DEC-89
Which statement about the date format for this value is true? Mark for Review
(1) Points
Both the YY and RR date formats will interpret the year as 1989
Both the YY and RR date formats will interpret the year as 2089
The RR date format will interpret the year as 1989, and the YY date format will interpret
the year as 2089 (*)
The RR date format will interpret the year as 2089, and the YY date format will interpret
the year as 1989
SELECT *
FROM employees
WHERE employee_id = manager_id;
Mark for Review
(1) Points
No, because the WHERE-clause will not find any matching data
No. You will have to re-write the statement and perform explicit datatype conversion.
Correct
5. Which statement will return the salary of e.g. 6000 from the Employees table in the
following format $6000.00? Mark for Review
(1) Points
Correct
6. You need to display the HIRE_DATE values in this format: 25th of July 2002. Which
SELECT statement would you use? Mark for Review
(1) Points
4. Which query would return a whole number if the sysdate is 26-MAY-04? Mark for
Review
(1) Points
5. Round and Trunc can be used on Date datatypes. True or False? Mark for Review
(1) Points
True (*)
False
Correct
17-JAN-1994
11-JAN-1995
11-JUL-1994 (*)
17-JUL-1994
1. Sysdate is 12-MAY-2004.
You need to store the following date: 7-DEC-89
Which statement about the date format for this value is true? Mark for Review
(1) Points
Both the YY and RR date formats will interpret the year as 1989
Both the YY and RR date formats will interpret the year as 2089
The RR date format will interpret the year as 1989, and the YY date format will interpret
the year as 2089
The RR date format will interpret the year as 2089, and the YY date format will interpret
the year as 1989
2. You need to display the HIRE_DATE values in this format: 25th of July 2002. Which
SELECT statement would you use? Mark for Review
(1) Points
SELECT enroll_date(hire_date, 'DDspth "of" Month YYYY')
FROM employees;
3. Which statement will return the salary of e.g. 6000 from the Employees table in the
following format $6000.00? Mark for Review
(1) Points
True
False
SELECT *
FROM employees
WHERE employee_id = manager_id;
Mark for Review
(1) Points
No, because the WHERE-clause will not find any matching data
No. You will have to re-write the statement and perform explicit datatype conversion.
True
False (*)
King, -1
Kochhar, 100
Vargas, 124
Zlotkey, .2
(*)
King, -1
Kochhar, 100
Vargas, 124
Zlotkey, 100
King, null
Kochhar, 100
Vargas, 124
Zlotkey, .2
zero
ZERO
NVL
NULLIF (*)
NVL2
NULL
Correct
King, -1
Kochhar, -1
Vargas, -1
Zlotkey, .2
King, -1
Kochhar, 100
Vargas, 124
Zlotkey, .2
King, -1
Kochhar, -1
Vargas, -1
Zlotkey, 100
(*)
. Which statement will return a listing of last names, salaries and a rating of 'Low', 'Medium',
'Good' or 'Excellent' depending on the salary value? Mark for Review
(1) Points
SELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
(*)
SELECT last_name,salary,
(CASE WHEN salary<5000 THEN 'Low'
WHEN sal <10000 THEN 'Medium'
WHEN sal <20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
SELECT last_name,sal,
(CASE WHEN sal<5000 THEN 'Low'
WHEN sal<10000 THEN 'Medium'
WHEN sal<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
SELECT last_name,salary,
(RATING WHEN salary<5000 THEN 'Low'
WHEN salary<10000 THEN 'Medium'
WHEN salary<20000 THEN 'Good'
ELSE 'Excellent'
END) qualified_salary
FROM employees;
Correct
2. For the given data from Employees (last_name, manager_id) what is the result of the
following statement:
DATA:( King, null
Kochhar, 100
De Haan, 100
Hunold, 102
Ernst, 103)
SELECT last_name,
DECODE(manager_id, 100, 'King', 'A N Other') "Works For?"
FROM employees
Mark for Review
(1) Points
King, Null
Kochhar, King
De Haan, King
Hunold, A N Other
Ernst, A N Other
King, A N Other
Kochhar, King
De Haan, King
Hunold, A N Other
Ernst, A N Other
(*)
Invalid statement.
King, A N Other
Kochhar, King
De Haan, King
Hunold, Kochhar
Ernst, De Haan
True (*)
False
Correct
4. Which of the following is a conditional expression used in SQL? Mark for Review
(1) Points
CASE (*)
DESCRIBE
WHERE
NULLIF
. The join column must be included in the select statement when you use the NATURAL
JOIN clause. True or False? Mark for Review
(1) Points
True
False (*)
2. The ___________ join is the ANSI-standard syntax used to generate a Cartesian product.
Mark for Review
(1) Points
NATURAL
ALL
FULL
CROSS (*)
3. What happens when you create a Cartesian product? Mark for Review
(1) Points
All rows from one table are joined to all rows of another table (*)
No rows are returned as you entered wrong join-criteria
The table is joined to itself, one column to the next column, exhausting all possibilities
All rows that do not match in the WHERE clause are displayed
Table aliases MUST be used with columns referenced in the JOIN USING clause. True or
False? Mark for Review
(1) Points
True
False (*)
2. You can do nonequi-joins with ANSI-Syntax. True or False? Mark for Review
(1) Points
True (*)
False
3. The keywords JOIN _____________ should be used to join tables with the same column
names but different datatypes. Mark for Review
(1) Points
NATURAL ON
ON
WHEN
USING (*)
True or False?
Mark for Review
(1) Points
True (*)
False
Correct
The join happens automatically based on matching column names and data types
1. EMPLOYEES Table:
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
DEPARTMENT_ID NUMBER (4)
DEPARTMENTS Table:
Name Null? Type
DEPARTMENT_ID NOT NULL NUMBER 4
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER (6)
A query is needed to display each department and its manager name from the above tables.
However, not all departments have a manager but we want departments returned in all cases.
Which of the following SQL: 1999 syntax scripts will accomplish the task?
Mark for Review
(1) Points
2. If you select rows from two tables (employees and departments) using an outer join, what
will you get? Use the code below to arrive at your answer:
SELECT e.last_name, e.department_id, d.department_name
FROM employees e
LEFT OUTER JOIN departments d
ON (e.department_id = d.department_id);
Mark for Review
(1) Points
All employees including those that do not have a departement_id assigned to them (*)
Correct
3. For which of the following tables will all the values be retrieved even if there is no match
in the other?
SELECT e.last_name, e.department_id, d.department_name
FROM employees e
LEFT OUTER JOIN departments d
ON (e.department_id = d.department_id);
employees (*)
department
Both
Neither. the LEFT OUTER JOIN limits the value to the matching department id's.
4. Given the following descriptions of the employees and jobs tables, which of the
following scripts will display each employee's possible minimum and maximum salaries
based on their job title?
EMPLOYEES Table:
Name Null? Type
EMPLOYEE_ID NOT NULL NUMBER (6)
FIRST_NAME VARCHAR2 (20)
LAST_NAME NOT NULL VARCHAR2 (25)
EMAIL NOT NULL VARCHAR2 (25)
PHONE_NUMBER VARCHAR2 (20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2 (10)
SALARY NUMBER (8,2)
COMMISSION_PCT NUMBER (2,2)
MANAGER_ID NUMBER (6)
DEPARTMENT_ID NUMBER (4)
JOBS Table:
Name Null? Type
JOB_ID NOT NULL VARCHAR2 (10)
JOB_TITLE NOT NULL VARCHAR2 (35)
MIN_SALARY NUMBER (6)
MAX_SALARY NUMBER (6)
Correct
Inner Join
Equijoin
Optimal Join
Correct
6. What is another name for a simple join or an inner join? Mark for Review
(1) Points
Nonequijoin
Equijoin (*)
Self Join
Outer Join
7. Which syntax would be used to retrieve all rows in both the EMPLOYEES and
DEPARTMENTS tables, even when there is no match? Mark for Review
(1) Points
Non-Transferability
Supertype
Arc
Correct
2. Which of the following database design concepts is implemented with a self join? Mark
for Review
(1) Points
Non-Transferability
Supertype
Arc
Correct
4. Hierarchical queries MUST use the LEVEL pseudo column. True or False? Mark for
Review
(1) Points
True
False (*)
Correct
5. Which select statement will return the last name and hire date of an employee and his/ her
manager for employees that started in the company before their managers? Mark for Review
(1) Points
6. Hierarchical queries can walk both Top-Down and Bottom-Up. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
1. What two group functions can be used with any datatype? Mark for Review
(1) Points
STDDEV, VARIANCE
SUM, AVG
COUNT, SUM
2. Given the following data in the employees table (employee_id, salary, commission_pct)
DATA: (143, 2600, null
144, 2500, null
149, 10500, .2
174, 11000, .3
176, 8600, .2
178, 7000, .15)
SELECT AVG(commission_pct)
FROM employees
WHERE employee_id IN( 143,144,149,174,176,178)
Mark for Review
(1) Points
1.2125
0.0425
3. Given the following data in the employees table (employee_id, salary, commission_pct)
DATA: (143, 2600, null
144, 2500, null
149, 10500, .2
174, 11000, .3
176, 8600, .2
178, 7000, .15)
4. The following statement will work because it uses the same column with different
GROUP functions:
SELECT AVG(salary), MAX(salary), MIN(salary), SUM(salary)
FROM employees;
True or False?
Mark for Review
(1) Points
True (*)
False
Correct
5. You can use GROUP functions in all clauses of a SELECT statement. True or False?
Mark for Review
(1) Points
True
False (*)
Correct
2. Using your existing knowledge of the employees table, would the following two
statements produce the same result?
SELECT COUNT(*)
FROM employees;
SELECT COUNT(commission_pct)
FROM employees;
Yes
No (*)
3. To include null values in the calculations of a group function, you must: Mark for
Review
(1) Points
Correct
The total number of non-null first names in the employees table (*)
Which of the following SQL statements could display the number of people with the same last
name: Mark for Review
(1) Points
Yes
No, beause you cannot have a WHERE-clause when you use group functions.
No, because the statement is missing salary in the GROUP BY clause (*)
Yes, because Oracle will correct any mistakes in the statement itself
Yes, because the SELECT clause can contain both individual columns and group functions
No, because the AVG function cannot be used on the salary column
Yes
Incorrect. Refer to Section 5 Lesson 1.
4. Read the following SELECT statement. Choose the column or columns that must be
included in the GROUP BY clause.
SELECT COUNT(last_name), grade, gender
FROM STUDENTS
GROUP_BY ?????;
Mark for Review
(1) Points
last_name
last_name, grade
last_name, gender
Correct
5. How would you alter the following query to list only employees where there existed more
than one per last_name with the same last name:
SELECT last_name, COUNT(employee_id)
FROM EMPLOYEES
GROUP BY last_name;
Mark for Review
(1) Points
Correct
If you want to include subtotals and grant totals for all columns mentioned in a GROUP BY
clause you should use which of the following extensions to the GROUP BY clause? Mark for
Review
(1) Points
ROLLUP
CUBE (*)
HAVING
Subtotals for department_id, job_id, manager_id and grand totals for salary.
Select the correct GROUP BY GROUPING SETS clause from the following list:
MINUS, PLUS
2. INTERSECT will give you rows found in both queries? (True or False) Mark for Review
(1) Points
True (*)
False
Correct
3. MINUS will give you rows from the first query not present in the second query? (True or
False) Mark for Review
(1) Points
True (*)
False
Correct
4. The difference between UNION and UNION ALL is Mark for Review
(1) Points
UNION will remove duplicates, UNION ALL returns all rows from all queries (*)
True
False (*)
A list of last_names and salaries of employees that makes more than employee 103
A list of last_names and salaries of employees that makes less than employee 103 (*)
A list of first_names and salaries of employees making less than employee 103
4. Which of the following statements is a true guideline for using subqueries? Mark for
Review
(1) Points
The outer and inner queries can reference more than one table. They can get data from
different tables. (*)
Only one WHERE clause can be used for a SELECT statement, and if specified, it must be
the outer query.
A list of last_names and salaries of employees that works in the same department and has
the same job_id as that of employee 103. (*)
A list of last_names or salaries of employees that works in the same department and has the
same job_id as that of employee 103.
A list of last_names and salaries of employees that works in the same department or has the
same job_id as that of employee 103.
Correct
2. Which of the following statements is a true guideline for using subqueries? Mark for
Review
(1) Points
The outer and inner queries can reference more than one table. They can get data from
different tables. (*)
Only one WHERE clause can be used for a SELECT statement, and if specified, it must be
the outer query.
Correct
3. Subqueries can only be placed in the WHERE clause. True or False? Mark for Review
(1) Points
True
False (*)
Correct
A list of last_names and salaries of employees that works in the same department and has
the same job_id as that of employee 103. (*)
A list of last_names or salaries of employees that works in the same department and has the
same job_id as that of employee 103.
A list of last_names and salaries of employees that works in the same department or has the
same job_id as that of employee 103.
A list of last_names and salaries of employees that makes less than employee 103 (*)
A list of first_names and salaries of employees making less than employee 103
Correct
. Subqueries are limited to four per SQL transaction. True or False? Mark for Review
(1) Points
True
False (*)
Correct
2. Single row subqueries may not include this operator: Mark for Review
(1) Points
ALL (*)
=
<>
>
Correct
An error since you can't get data from two tables in the same subquery
Only the employees whose job id matches employee 141 and who work in location 1500
(*)
4. If the subquery returns no rows will the outer query return any values? Mark for Review
(1) Points
No, because you are not allowed to not return any rows from a subquery
No, because the subquery will be treated like a null value. (*)
Yes, Oracle will find the nearest value and rewrite your statement implicitly when you run
it
Incorrect. Refer to Section 6 Lesson 2.
5. In a non-correlated subquery, the outer query always executes prior to the inner query's
execution. True or False? Mark for Review
(1) Points
True
False (*)
Correct
Group functions can be used in subqueries even though they may return many rows. True or
False? Mark for Review
(1) Points
True (*)
False
Correct
2. In a subquery the ALL operator compares a value to every value returned by the inner
query. True or False? Mark for Review
(1) Points
True (*)
False
Correct
3. When a multiple-row subquery uses the NOT IN (<>ALL) operator, if one of the values
returned by the inner query is a null value, the entire query returns: Mark for Review
(1) Points
A list of Nulls
All rows that were selected by the inner query including the null value(s)
All rows, minus the null value(s), that were selected by the inner query
4. The SQL multiple-row subquery extends the capability of the single-row syntax through
the use of what three comparison operators? Mark for Review
(1) Points
Correct
True (*)
False
Correct
6. Multiple-row subqueries must have NOT, IN or ANY in the WHERE clause of the inner
query. True or False? Mark for Review
(1) Points
True
False (*)
7. The salary column of the f_staffs table contains the following values:
4000
5050
6000
11000
23000
Which of the following statements will return the last_name and first_name of those
employees who earn more than 5000.
Mark for Review
(1) Points
Correct
8. There can be more than one subquery returning information to the outer query. True or
False? Mark for Review
(1) Points
True (*)
False
Correct
In a correlated subquery the outer and inner query are joined on one or more columns? (True
or False) Mark for Review
(1) Points
True (*)
False
Correct
2. The WITH-clause is a way of creating extra tables in the database? (True or False) Mark
for Review
(1) Points
True
False (*)
Correct
3. Table aliases must be used when you are writing correlated subqueries? (True or false)
Mark for Review
(1) Points
True (*)
False
4. Correlated Subqueries must work on the same tables in both the inner and outer query?
(True or False) Mark for Review
(1) Points
True
False (*)
. 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
2. When creating a new table, which of the following naming rules apply. (Choose three)
Mark for Review
(1) Points
Can have the same name as another object owned by the same user
Correct
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
4. Once they are created, external tables are accessed with normal SQL statements? (True or
False) Mark for Review
(1) Points
True (*)
False
Correct
5. 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
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.
impossible; no matter what, there can never be two tables with the same name, even if they
are in separate schemas.
Correct
True (*)
False
Correct
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.
Correct
8. DCL, which is the acronym for Data Control Language, allows: Mark for Review
(1) Points
Correct
Statement will fail, as you must list the columns into which you are inserting.
Statement will work and the hire_date column will have the value of the date when the
statement was run. (*)
Correct
The BLOB datatype can max hold 4 gigabytes of data. True or False? Mark for Review
(1) Points
True (*)
False
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 (*)
3. Which of the following are valid Oracle datatypes? Mark for Review
(1) Points
Correct
4. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes,
and seconds. True or False? Mark for Review
(1) Points
True (*)
False
Correct
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 (*)
2. 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 (*)
3. You can use the ALTER TABLE statement to: Mark for Review
(1) Points
Drop a column
All of the above (*)
4. The following code creates a table named student_table with four columns: id, lname,
fname, lunch_num
CREATE TABLE student_table
(id NUMBER(6),
lname VARCHAR(20),
fname VARCHAR(20),
lunch_num NUMBER(4));
The lunch_num column in the above table has been marked as UNUSED. Which of the
following is the best statement you can use if you wish to remove the UNUSED column from
the student_table?
Mark for Review
(1) Points
DROP column
5. Comments can be added to a table by using the COMMENT ON TABLE statement. The
comments being added are enclosed in: Mark for Review
(1) Points
Parentheses ( )
Brackets { }
Correct
6. To completely get rid of a table, its contents, its structure, AND release the storage space
the keyword is: Mark for Review
(1) Points
DROP (*)
DELETE
TRUNCATE
KILL
7. After issuing a SET UNUSED command on a column, another column with the same
name can be added using an ALTER TABLE statement. True or False? Mark for Review
(1) Points
True (*)
False
Correct
8. 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 (*)
9. The data type of a column can never be changed once it has been created. True or False?
Mark for Review
(1) Points
True
False (*)
You should use it if you think the column may be needed again later
You should use it when the system is being heavily used (*)
You should only use this command if you want the column to still be visible when you
DESCRIBE the table
11. When you use ALTER TABLE to add a column, the new column: Mark for Review
(1) Points
Will not be created because you cannot add a column after the table is created
12. The FLASHBACK TABLE to BEFORE DROP can restore only the table structure, but
not its data back to before the table was dropped. True or False? Mark for Review
(1) Points
True
False (*)
13. Which of the following will correctly change the name of the LOCATIONS table to
NEW_LOCATIONS? Mark for Review
(1) Points
None of the above; you cannot rename a table, you can only CREATE, ALTER and DROP
a table.
14. ALTER TABLE table_name RENAME can be used to: Mark for Review
(1) Points
Rename a row.
Rename a column.
A unique key constraint can only be defined on a not null column. True or False? Mark for
Review
(1) Points
True
False (*)
2. Which of the following is not a valid Oracle constraint type? Mark for Review
(1) Points
UNIQUE KEY
NOT NULL
PRIMARY KEY
Correct
3. If the employees table has a UNIQUE constraint on the DEPARTMENT_ID column, we
can only have one employee per department. True or False? Mark for Review
(1) Points
True (*)
False
4. A table can have more than one UNIQUE key constraint. True or False? Mark for
Review
(1) Points
True (*)
False
5. A column defined as NOT NULL can have a DEFAULT value of NULL. True or False?
Mark for Review
(1) Points
True
False (*)
6. A table must have at least one not null constraint and one unique constraint. True or
False? Mark for Review
(1) Points
True
False (*)
If a Primary Key is made up of more than one column, one of the columns can be null. True
or False? Mark for Review
(1) Points
True
False (*)
2. To automatically delete rows in a child table when a parent record is deleted use: Mark
for Review
(1) Points
ON DELETE ORPHAN
3. Foreign Key Constraints are also known as: Mark for Review
(1) Points
Multi-Table Constraints
4. The table that contains the Primary Key in a Foreign Key Constraint is known as: Mark
for Review
(1) Points
Child Table
Detail Table
Mother and Father Table
5. A composite primary key may only be defined at the table level. True or False? Mark for
Review
(1) Points
True (*)
False
Correct
Line 2 (*)
Line 3
Line 5
Line 7
7. An example of adding a check constraint to limit the salary that an employee can earn is:
Mark for Review
(1) Points
8. The number of check constraints that can be defined on a column is: Mark for Review
(1) Points
10
100
9. The employees table contains a foreign key column department_id that references the id
column in the departments table. Which of the following constraint modifiers will NOT allow
the deletion of id values in the department table? Mark for Review
(1) Points
ON DELETE CASCADE
Both A and B
10. A Primary Key that is made up of more than one column is called a: Mark for Review
(1) Points
Primary Multi-Key
11. Which of the following pieces of code will NOT successfully create a foreign key in the
CDS table that references the SONGS table Mark for Review
(1) Points
12. The main reason that constraints are added to a table is: Mark for Review
(1) Points
All of a user's constraints can be viewed in the Oracle Data Dictionary view called: Mark for
Review
(1) Points
USER_TABLES
USER_CONSTRAINTS (*)
CONSTRAINTS
TABLE_CONSTRAINTS
2. What mechamisn does Oracle use in the background to enforce uniqueness in Primary
and Unique key constraints? Mark for Review
(1) Points
Ordered Lists
Internal Pointers
Nothing extra is created when Primary Keys and Unique Keys are created
Unique indexes are created in the background by Oracle when Primary and Unique
constraints are created or enabled (*)
4. You can drop a column in a table with a simple ALTER TABLE DROP COLUMN
statement, even if the column is referenced in a constraint. True or False? Mark for Review
(1) Points
True
False (*)
True
False (*)
Correct
A view can contain group functions. True or False? Mark for Review
(1) Points
True (*)
False
Correct
2. A view can contain a select statement with a subquery. True or False? Mark for Review
(1) Points
True (*)
False
Correct
3. Any select statement can be stored in the database as a view. True or False Mark for
Review
(1) Points
True (*)
False
Correct
4. Given the following CREATE VIEW statement, what data will be returned?
CREATE OR REPLACE VIEW emp_dept
AS SELECT SUBSTR(e.first_name,1,1) ||' '||e.last_name emp_name,
e.salary,
e.hire_date,
d.department_name
FROM employees e, departments d
WHERE e.department_id = d.department_id
AND d.department_id >=50;
Mark for Review
(1) Points
First character from employee first_name concatenated to the last_name, the salary, the
hire_date and department_id of all employees working in department number 50 or higher.
First character from employee first_name concatenated to the last_name, the salary, the
hire_date and department_id of all employees working in department number 50.
First character from employee first_name concatenated to the last_name, the salary, the
hire_date and department_name of all employees working in department number 50.
First character from employee first_name concatenated to the last_name, the salary, the
hire_date and department_name of all employees working in department number 50 or higher.
(*)
5. Views contain no data of their own. True or False? Mark for Review
(1) Points
True (*)
False
Correct
SELECT, DELETE
SELECT, INSERT
True
False (*)
3. If a database administrator wants to ensure that changes performed through a view do not
violate existing constraints, which clause should he/she include when creating the view?
Mark for Review
(1) Points
FORCE
True
False (*)
5. Examine the view below and choose the operation that CANNOT be performed on it.
CREATE VIEW dj_view (last_name, number_events) AS
SELECT c.last_name, COUNT(e.name)
FROM d_clients c, d_events e
WHERE c.client_number = e.client_number
GROUP BY c.last_name
Correct
6. Which of the following DML operations is not allowed when using a Simple View
created with read only? Mark for Review
(1) Points
INSERT
UPDATE
DELETE
True (*)
False
Correct
INLINE
ONLINE (*)
SIMPLE
COMPLEX
4. Which of these Keywords is typically used with a Top-N Analysis? Mark for Review
(1) Points
Rowid
Rownum (*)
Sequence
Number
It is the number assigned to each row returned from a query after they are ordered.
It is the number assigned to each row returned from a query as they are read from disk. (*)
Correct
6. When you drop a table referenced by a view, the view is automatically dropped as well.
True or False? Mark for Review
(1) Points
True
False (*)
7. When you drop a view, the data it contains is also deleted. True or False? Mark for
Review
(1) Points
True
False (*)
True (*)
False
Correct
Change
Update
Alter (*)
Create
Correct
True
False (*)
4. CURRVAL is a pseudocolumn used to refer to a sequence number that the current user
has just generated by referencing NEXTVAL. True or False? Mark for Review
(1) Points
True (*)
False
Correct
5. A sequence is a window through which data can be queried or changed. True or False?
Mark for Review
(1) Points
True
False (*)
100010011002
0, 1, 2
Correct
7. In order to be able to generate primary key values that are not likely to contain gaps,
which phrase should be included in the sequence creation statement? Mark for Review
(1) Points
NOCACHE (*)
CACHE
MAXVALUE
8. When you alter a sequence, a new increased MAXVALUE can be entered without
changing the existing number order. True or False? Mark for Review
(1) Points
True (*)
False
Correct
9. Why do gaps in sequences occur? Mark for Review
(1) Points
A rollback is executed
10. Nextval and Currval are know as column aliases. True or False? Mark for Review
(1) Points
True
False (*)
Drop (*)
Delete
Remove
Revoke
12. Which is the correct syntax for specifying a maximum value in a sequence? Mark for
Review
(1) Points
Maxval
Max_value
Maximumvalue
Maxvalue (*)
Correct
If the employees table have 7 rows how many rows are inserted into the copy_emps table
with the following statement:
INSERT INTO copy_emps (employee_id, first_name, last_name, salary, department_id)
SELECT employee_id, first_name, last_name, salary, department_id
FROM employees
Correct
3. What is the quickest way to use today's date when you are creating a new row? Mark for
Review
(1) Points
4. When inserting rows into a table all columns must be given values. True or False? Mark
for Review
(1) Points
True
False (*)
5. When inserting a new row the null keyword can be included in the values list for any null
column. True or False? Mark for Review
(1) Points
True (*)
False
Correct
6. Is it possible to insert more than one row at a time using an INSERT statement with a
VALUES clause? Mark for Review
(1) Points
No, you can only create one row at a time when using the VALUES clause. (*)
Yes, you can just list as many rows as you want, just remember to separate the rows with
commas.
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");
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);
(*)
8. To return a table summary on the customers table, which of the following is correct?
Mark for Review
(1) Points
9. Insert statements can be combined with subqueries to create more than one row per
statement. True or False? Mark for Review
(1) Points
True (*)
False
Correct
Which of the following statements best describes what will happen to the student table in this
SQL statement?
UPDATE students
SET lunch_number =
(SELECT lunch_number
FROM student
WHERE student_id = 17)
WHERE student_id = 19;
Mark for Review
(1) Points
The statement updates the student_table by replacing student id 19's lunch number with
student id 17's lunch number. (*)
Deletes student 17's lunch_number and inserts a new value from student 19.
Correct
2. DELETE statements can use correlated subqueries? (True or False) Mark for Review
(1) Points
True
False (*)
3. Assuming there are no Foreign Keys on the EMPLOYEES table, if the following
subquery returns one row, how many rows will be deleted from the EMPLOYEES table?
DELETE FROM employees
WHERE department_id =
(SELECT department_id
FROM departments
WHERE department_name LIKE '%Public%');
One row will be deleted, as the subquery only returns one row.
All the rows in the EMPLOYEES table with department_ids matching the department_id
returned by the subquery. (*)
All rows in the EMPLOYEES table will be deleted, regardless of their department_id.
Correct
4. If the subquery returns one row, how many rows will be deleted from the employees
table?
DELETE FROM employees
WHERE department_id =
(SELECT department_id
FROM departments
WHERE department_name LIKE '%Public%');
Mark for Review
(1) Points
One row will be deleted, as the subquery only returns one row.
All rows in the employees table which work in the given department will be deleted. (*)
All rows in the employees table will be deleted, no matter their department_id.
Correct
5. How many rows will be deleted from the employees table with the following statement?
DELETE FROM employees
WHERE last_name = 'king';
Mark for Review
(1) Points
6. Using your knowledge of the employees table, what would be the result of the following
statement:
DELETE FROM employees; Mark for Review
(1) Points
All rows in the employees table will be deleted if there are no constraints on the table. (*)
7. Is the following statement valid, i.e. is it allowed to update rows in one table, based on a
subquery from another table?
UPDATE copy_emp
SET department_id = (SELECT department_id
FROM employees
WHERE employee_id = 100)
WHERE job_id = (SELECT job_id
FROM employees
WHERE employee_id = 200);
Mark for Review
(1) Points
The statement will fail, because the subqueries are returning data from different rows
False (*)
9. To change an existing row in a table, you can use the UPDATE or INSERT statements.
True or False? Mark for Review
(1) Points
True
False (*)
The MERGE statement can be used to update rows in one table based on values in another
table and if the update fails, then the rows will automatically be inserted instead. True or
False? Mark for Review
(1) Points
True (*)
False
Correct
2. A multi-table insert statement can insert into more than one table? (True or False) Mark
for Review
(1) Points
True (*)
False
Correct
3. The DEFAULT keyword can be used in the following statements: Mark for Review
(1) Points
4. Which statement below will not insert a row of data onto a table? Mark for Review
(1) Points
5. A multi-table insert statement must have a subquery at the end of the statement? (True or
False) Mark for Review
(1) Points
True (*)
False
6. If a default value was set for a null column, Oracle sets the column to the default value.
However, if no default value was set when the column was created, Oracle inserts an empty
space. True or False? Mark for Review
(1) Points
True
False (*)
Correct
7. In developing the Employees table, you create a column called hire_date. You assign the
hire_date column a DATE datatype with a DEFAULT value of 0 (zero). A user can come
back later and enter the correct hire_date. This is __________. Mark for Review
(1) Points
A great idea. When a new employee record is entered, if no hire_date is specified, the 0
(zero) will be automatically specified.
A great idea. When new employee records are entered, they can be added faster by
allowing the 0's (zeroes) to be automatically specified.
A bad idea. The default value must match the DATE datatype of the column. (*)
It is possible to have an indexed column in a table where a value in the table column does not
exist in the index. True or False? Mark for Review
(1) Points
True
False (*)
Incorrect. Refer to Section 12 Lesson 2.
2. Indexes can be used to speed up queries. True or False? Mark for Review
(1) Points
True (*)
False
Correct
Correct
4. Which of the following statements best describes indexes and their use? Mark for
Review
(1) Points
They contain the column value and pointers to the data in the table, but the data is sorted.
(*)
They contain all the rows and columns from the table
Correct
5. All tables must have indexes on them otherwise they cannot be queried. True or False?
Mark for Review
(1) Points
True
False (*)
Correct
6. What kind of INDEX is created by Oracle when you create a primary key? Mark for
Review
(1) Points
NONUNIQUE INDEX
INDEX
Correct
7. You must use a synonym to access another users table. True or False? Mark for Review
(1) Points
True
False (*)
Correct
8. Which of the following SQL statements shows a correct syntax example of creating a
synonym accessible to all users of a database? Mark for Review
(1) Points
Update (*)
References (*)
Insert
Delete
Correct
4. The following table shows some of the output from one of the data dictionary views.
Which view is being queried?
USERNAME PRIVILEGE ADMIN_OPTION
USCA_ORACLE_SQL01_S08 CREATE VIEW NO
USCA_ORACLE_SQL01_S08 CREATE TABLE NO
USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
5. What system privilege must be held in order to login to an Oracle database? Mark for
Review
(1) Points
CREATE LOGIN
CREATE LOGON
No special privilege is needed, if your username exists in the database, you can login.
6. By Controlling User Access with Oracle Database Security you can give access to
specific Objects in the Database. True or False? Mark for Review
(1) Points
True (*)
False
Incorrect. Refer to Section 12 Lesson 1.
7. Which Object Privilege apart from Alter can be granted to a Sequence? Mark for Review
(1) Points
SELECT (*)
UPDATE
INSERT
DELETE
9. Which of these is not a System Privilege granted by the DBA? Mark for Review
(1) Points
Create Sequence
Create Procedure
Create Session
10. A Schema is a collection of Objects such as Tables, Views and Sequences. True or
False? Mark for Review
(1) Points
True (*)
False
11. Which of the following is not a database object? Mark for Review
(1) Points
View
Subquery (*)
Table
Sequence
Correct
2. A Schema is a collection of Objects such as Tables, Views and Sequences. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
3. Which of the following Object Privileges can be granted on an individual column on a
table? (Choose two) Mark for Review
(1) Points
Update (*)
References (*)
Insert
Delete
Correct
Correct
5. By Controlling User Access with Oracle Database Security you can give access to
specific Objects in the Database. True or False? Mark for Review
(1) Points
True (*)
False
Correct
6. Which Object Privilege apart from Alter can be granted to a Sequence? Mark for Review
(1) Points
SELECT (*)
UPDATE
INSERT
DELETE
Correct
7. What system privilege must be held in order to login to an Oracle database? Mark for
Review
(1) Points
CREATE LOGIN
CREATE LOGON
No special privilege is needed, if your username exists in the database, you can login.
Correct
View
Subquery (*)
Table
Sequence
Correct
Correct
10. Which of these is not a System Privilege granted by the DBA? Mark for Review
(1) Points
Create Sequence
Create Procedure
Create Session
Correct
11. The following table shows some of the output from one of the data dictionary views.
Which view is being queried?
USERNAME PRIVILEGE ADMIN_OPTION
USCA_ORACLE_SQL01_S08 CREATE VIEW NO
USCA_ORACLE_SQL01_S08 CREATE TABLE NO
USCA_ORACLE_SQL01_S08 CREATE SYNONYM NO
USCA_ORACLE_SQL01_S08 CREATE TRIGGER NO
USCA_ORACLE_SQL01_S08 CREATE SEQUENCE NO
USCA_ORACLE_SQL01_S08 CREATE DATABASE NO
Correct
Database Links can be created by any user of a database. You do not need any special
privileges to create them.
Correct
2. When a user is logged into one database, they are restricted to working with objects found
in that database. True or False? Mark for Review
(1) Points
True
False (*)
Correct
3. If you are granted privileges to your friend's object, by default you may also grant access
to this same object to other users. True or False? Mark for Review
(1) Points
True
False (*)
Correct
4. To take away a privilege from a user you use which command? Mark for Review
(1) Points
DELETE
REMOVE
REVOKE (*)
ALTER
Correct
5. Which of the following statements about granting object privileges is false? Mark for
Review
(1) Points
To grant privileges on an object, the object must be in your own schema, or you must have
been granted the object privileges WITH GRANT OPTION.
An object owner can grant any object privilege on the object to any other user or role of the
database.
The owner of an object automatically acquires all object privileges on that object.
Correct
6. User1 owns a table and grants select on it WITH GRANT OPTION to User2. User2 then
grants select on the same table to User3. If User1 revokes select privileges from User2, will
User3 be able to access the table? Mark for Review
(1) Points
Yes
No (*)
Correct
7. What Oracle feature simplifies the process of granting and revoking privileges? Mark for
Review
(1) Points
Role (*)
Object
Data dictionary
Schema
Correct
8. Roles are: Mark for Review
(1) Points
Correct
9. A role can be granted to another role. True or False? Mark for Review
(1) Points
True (*)
False
Correct
10. 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;
True (*)
False
Correct
Select the correct REGULAR EXPRESSION functions: (Choose two) Mark for Review
(1) Points
REGEXP_LIKE, REGEXP_NEAR
REGEXP_LIKE, REGEXP_REPLACE (*)
REGEXP_REPLACE, REGEXP_REFORM
Correct
True (*)
False
Correct
True (*)
False
4. REGULAR EXPRESSIONS does exactly the same as LIKE. No more and no less? (True
or False) Mark for Review
(1) Points
True
False (*)
If a database crashes, all uncommitted changes are automatically rolled back. True or False?
Mark for Review
(1) Points
True (*)
False
Correct
2. Table MYTAB contains only one column of datatype CHAR(1). A user executes the
following statements in the order shown.
INSERT INTO mytab VALUES ('A');
INSERT INTO mytab VALUES ('B');
COMMIT;
INSERT INTO mytab VALUES ('C');
ROLLBACK;
A, B and C
A and B (*)
3. Which SQL statement is used to remove all the changes made by an uncommitted
transaction? Mark for Review
(1) Points
UNDO;
ROLLBACK; (*)
ROLLBACK TO SAVEPOINT;
REVOKE ...;
Correct
4. User BOB's CUSTOMERS table contains 20 rows. BOB inserts two more rows into the
table but does not COMMIT his changes. User JANE now executes:
SELECT COUNT(*) FROM bob.customers;
What result will JANE see?
Mark for Review
(1) Points
22
20 (*)
JANE will receive an error message because she is not allowed to query the table while
BOB is updating it.
5. Steven King's row in the EMPLOYEES table has EMPLOYEE_ID = 100 and SALARY
= 24000. A user issues the following statements in the order shown:
UPDATE employees
SET salary = salary * 2
WHERE employee_id = 100;
COMMIT;
UPDATE employees
SET salary = 30000
WHERE employee_id = 100;
The user's database session now ends abnormally. What is now King's salary in the table?
Mark for Review
(1) Points
48000 (*)
30000
24000
78000
6. Which of the following best describes the term "read consistency"? Mark for Review
(1) Points
It prevents other users from seeing changes to a table until those changes have been
committed (*)
It prevents users from querying tables on which they have not been granted SELECT
privilege
An update statement
A savepoint (*)
An object privilege
A database link
A sequence
You want to retain all the employees with a salary of 15000; What statement would you
execute next?
Mark for Review
(1) Points
ROLLBACK;
Yes, Oracle will resolve which department_id colum comes from which table.
2. If table A have 10 rows and table B have 5 rows, how many rows will be returned if you
perform a equi-join on those two tables? Mark for Review
(1) Points
50
10
3. When must column names be prefixed by table names in join syntax? Mark for Review
(1) Points
When the same column name appears in more than one table of the query (*)
Never
Correct
4. What is the result of a query that selects from two tables but includes no join condition?
Mark for Review
(1) Points
A syntax error
Correct
5. If table A have 10 rows and table B have 5 rows, how many rows will be returned if you
perform a cartesian join on those two tables? Mark for Review
(1) Points
50 (*)
10
15
6. Oracle proprietary JOINS can use the WHERE clause for conditions other than the join-
condition. True or False? Mark for Review
(1) Points
True (*)
False
Correct
When must column names be prefixed by table names in join syntax? Mark for Review
(1) Points
When the same column name appears in more than one table of the query (*)
Never
Correct
2. Oracle proprietary JOINS can use the WHERE clause for conditions other than the join-
condition. True or False? Mark for Review
(1) Points
True (*)
False
Correct
3. If table A have 10 rows and table B have 5 rows, how many rows will be returned if you
perform a equi-join on those two tables? Mark for Review
(1) Points
50
10
Correct
4. What is the result of a query that selects from two tables but includes no join condition?
Mark for Review
(1) Points
Correct
Yes, Oracle will resolve which department_id colum comes from which table.
Correct
6. If table A have 10 rows and table B have 5 rows, how many rows will be returned if you
perform a cartesian join on those two tables? Mark for Review
(1) Points
50 (*)
10
15
Which of the following operators is/are typically used in a nonequijoin? Mark for Review
(1) Points
NOT
OR
IN
Correct
True (*)
False
Correct
3. Which statement about joining tables with a non-equijoin is false? Mark for Review
(1) Points
A WHERE clause must specify a column in one table that is compared to a column in the
second table (*)
The number of join conditions required is always one less than the number of tables being
joined
Correct
True or False?
Mark for Review
(1) Points
True
False (*)
Correct
||
(+) (*)
Correct
3. The ID column in the CLIENT table that corresponds to the CLIENT_ID column of the
ORDER table contains null values for rows that need to be displayed. Which type of join
should you use to display the data? Mark for Review
(1) Points
Equijoin
Self join
Nonequi-Join
Correct
e.department_id(+) = d.department_id(+)
e.department_id = d.department_id(+)
e.department_id = d.department_id
Correct