DD Database Design Learner
DD Database Design Learner
DD Database Design Learner
Section 1 – Introduction
1. Every time you shop online, it is likely you will be accessing a database. True or False?
A. Benar
B. Palsu
2. Databases are used in most countries and by most governments. Life, as we know it, would
change drastically if we no longer had access to databases. True or False?
A. benar
B. Palsu
3. Oracle was one of the first relational database systems available commercially. True or False?
A. benar
B. Palsu
4. Data Modeling is the last step in the database development process. True or False?
A. benar
B. Palsu
5. 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 that businesses
need and want.
A. True. Users delay the delivery of a system by changing their minds and adding new
requirements.
B. True. Users never know what they want anyway, so building systems is best left to the
professionals.
C. False. Business requirements can and will change. For instance new legal requirements
may arise.
D. True. The only requirement for creating a perfect system is a perfect programmer.
6. The market for IT professionals is still increasing and will continue to do so in the future as the
world gets ever more dependent on computer systems. True or False?
A. True
B. False
8. Users could directly interact with which of the following software to access essential business
applications? (Choose three)
9. The overall mission of the Oracle Corporation is to use the internet and fast processing servers to
build its own network. True or False?
A. True
B. False
10. A specialized type of software, which controls and manages the hardware in a computer system.
A. Software
B. Client
C. Operating System
D. Hardware
12. Personal computers (PCs) have been in existence since 1950. True or False?
A. True
B. False
14. Consider your school library. It will have a database with transaction details of the books that are
borrowed by students. Is a detail of one student borrowing one book considered Data or
Information?
A. Data
B. Information
C. Both
D. Neither
6. Which of the following entities most likely contains valid attributes? (Choose two)
(Choose all correct answers)
A. Entity: Home. Attributes: Number of Bedrooms, Owner, Address, Date Built
B. Entity: Pet. Attributes: Name, Birthdate, Owner
C. Entity: Mother. Attributes: Name, Birthdate, Occupation, Start Date
D. Entity: Car. Attributes: Owner Occupation, Owner Salary, Speed
7. Unique Identifiers:
A. Distinguish nothing
B. Distinguish one instance of an entity from all other instances of that entity
C. Distinguish one entity from another
D. Distinguish all entities in a database
8. A/an _________ is defined as "Something" of significance to the business about which data must
be known.
A. Instance
B. Relationship
C. Entity
D. None of the above
9. All of the following would be instances of the entity PERSON except which?
A. Grace Abinajam
B. Male
C. Angelina Rosalie
D. David Jones
10. Which of the following statements about attributes are true? (Choose 3)
(Choose all correct answers)
A. They have a data type, such as number or character string.
B. They describe, qualify, quantify, classify, or specify an entity.
C. They must be single valued.
D. They are often adjectives.
12. Which of the following are examples of ENTITY: Instance ? (Choose Two)
A. MEAT PRODUCT: Lettuce
B. TRANSPORTATION METHOD: Car
C. ANIMAL: Dog
D. BODY PART: Larry Ellison
13. Entity Relationship modeling is dependent on the hardware or software used for implementation,
so you will need to change your ERD if you decide to change Hardware Vendor. True or False?
A. True
B. False
14. A well structured ERD will show only some parts of the finished data model. You should never
try to model the entire system in one diagram, no matter how small the diagram might be. True or
False?
A. True
B. False
15. An Entity Relationship model is independent of the hardware or software used for
implementation. True or False?
A. True
B. False
2. Which of the following are used to show a relationship on an ERD? (Choose Three)
(Choose all correct answers)
A. # symbol.
B. Crow's foot.
C. Solid line.
D. Dashed line.
7. Matrix Diagrams are used to verify that all relationships have been identified for an ERD. True or
False?
A. True
B. False
8. Matrix Diagrams show Optionality and Cardinality of the ERDs they document. True or False?
A. True
B. False
10. Which of the following are used to show Cardinality on an ERD? (Choose two)
(Choose all correct answers)
A. Single toe.
B. Crow's foot.
C. Dashed line.
D. Solid line.
11. What are the three properties that every relationship should have?
A. Name, optionality, arcs
B. A UID bar, a diamond, an arc
C. Transferability, degree, name
D. Name, optionality, cardinality
12. One Relationship can be mandatory in one direction and optional in the other direction. True or
False?
A. True
B. False
2. How would you model a business rule that states that on a student's birthday, he does not have to
attend his classes?
A. Make the attribute Birthdate mandatory
B. Use a supertype
C. You cannot model this. You need to document it
D. Use a subtype
3. How would you model a business rule that states that girls and boys may not attend classes
together?
A. Supertype STUDENT has two subtypes BOY and GIRL which are related to GENDER,
which is related to CLASS
B. Make the attribute Gender optional
C. Make the attribute Gender mandatory
D. Use a supertype
5. A new system would have a mixture of both Procedural and Structural Business Rules as part of
the documentation of that new system. True or False?
A. True
B. False
6. A business rule such as "We only ship goods after customers have completely paid any
outstanding balances on their account" is best enforced by:
A. Creating additional programming code to verify no goods are shipped until the account
has been settled in full.
B. Making the payment attribute null.
C. Making the payment attribute optional.
D. We need to trust our customers, and we know they will pay some day.
8. All instances of a subtype may be an instance of the supertype but does not have to. True or
False?
A. True
B. False
9. All instances of the supertype must be an instance of one of the subtypes. True or False?
A. True
B. False
10. A subtype can have a relationship not shared by the supertype. True or False?
A. True
B. False
11. A supertype can only have two subtypes and no more. True or False?
A. True
B. False
12. A subtype is shown on an ERD as an entity with a one to many relationship to the supertype. True
or False?
A. True
B. False
13. A subtype is drawn on an ERD as an entity inside the "softbox" of the supertype. True or False?
A. True
B. False
14. You can only create relationships to a Supertype, not to a Subtype. True or False?
A. True
B. False
15. All instances of a subtype must be an instance of the supertype. True or False?
A. True
B. False
2. Which of the following pairs of entities is most likely to be modeled as a M:M relationship?
A. CAR and WHEEL
B. TREE and BRANCH
C. PERSON and FINGERPRINT
D. TEACHER and SUBJECT AREA
3. What uncommon relationship is described by the statements: "Each DNA SAMPLE may be taken
from one and only one PERSON and each PERSON may provide one and only one DNA
SAMPLE"
A. One to Many Mandatory
B. One to One Optional
C. Many to Many Mandatory
D. One to Many Optional
4. Many to many relationships must be left in the Model. It is important to have them documented as
M-M. True or False?
A. True
B. False
5. If the same relationship is represented twice in an Entity Relationship Model, it is said to be:
A. Resourceful
B. Redundant
C. Replicated
D. Removable
7. A non-transferable relationship means the relationship is manatory at both sides. True or False?
A. True
B. False
10. Every ERD must have at least one non-transferable relationship. True or False?
A. True
B. False
11. Intersection Entities often have the relationships participating in the UID, so the relationships are
often barred. True or False?
A. True
B. False
12. If an intersection entity is formed that contains no attributes of its own, its uniqueness may be
modeled by
A. Creating new attributes.
B. Barring the relationships to the original entities.
C. Placing the UID attributes from the original entities into the intersection entity.
D. None of the above.
13. 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?
A. True
B. False
14. A barred relationship on an ERD signifies that the UID of the intersection entity is inherited from
the entities that made up the original many to many relationship. True or False?
A. True
B. False
15. What do you call the entity created when you resolve a M:M relationship?
A. Intersection entity
B. Inclusion entity
C. M:M entity
D. Recursive entity
3. Personal computers (PCs) have been in existence since 1950. True or False?
A. True
B. False
4. In the grid computing model, resources are pooled together for efficiency. True or False?
A. True
B. False
5. The demand for Information Technology professionals in today's market is increasing. True or
False?
A. True
B. False
6. Consider your school library. It will have a database with transaction details of the books that are
borrowed by students. Is the total number of books out on loan in one given month considered
Data or Information?
A. Data
B. Information
C. Both
D. Neither
8. Every time you shop online, it is likely you will be accessing a database. True or False?
A. True
B. False
9. Entities are transformed into Tables during the Database Design process. True or False?
A. True
B. False
10. Data Modeling is the last step in the database development process. True or False?
A. True
B. False
Section 2
11. An ERD is an example of a Physical Model. True or False?
A. True
B. False
12. Documenting Business Requirements helps developers control the scope of the system and
prevents users from claiming that the new system does not meet their business requirements. True
or False?
A. True
B. False
13. Data models are drawn to show users the actual Data that their new system will contain; only
Data listed on the Diagram can be entered into the Database. True or False?
A. True
B. False
14. Many reasons exist for creating a conceptual model. Choose three appropriate reasons from the
options below. (Choose all correct answers)
A. They model the information flow of data.
B. They accurately describe what a physical model will contain.
C. They capture current and future needs.
D. They capture the implementation details of the physical model.
E. They model functional and informational needs.
15. Entity Relationship modeling is dependent on the hardware or software used for implementation,
so you will need to change your ERD if you decide to change Hardware Vendor. True or False?
A. True
B. False
16. Which of the following statements are true about ERD's? (Choose Two). (Choose all correct
answers)
A. A piece of information can be shown multiple times on an ERD.
B. A piece of information should only be found in one place on an ERD.
C. All data must be represented on the ERD, including derived summaries and the result of
calculations.
D. You should not model derivable data.
17. The purpose of an ERD is to document the proposed system and facilitate discussion and
understanding of the requirements captured by the developer. True or False?
A. True
B. False
19. Which of the following are examples of ENTITY: Instance ? (Choose Two). (Choose all correct
answers)
A. ANIMAL: Dog
B. BODY PART: Larry Ellison
C. TRANSPORTATION METHOD: Car
D. MEAT PRODUCT: Lettuce
22. In the following statements, find two good examples of ENTITY: Instance. (Choose Two).
(Choose all correct answers)
A. DAIRY PRODUCT: milk
B. VEGETABLE: grows
C. TRAIN: runs
D. BOOK: Biography of Mahatma Gandhi
23. Which of the following statements about attributes are true? (Choose 3). (Choose all correct
answers)
A. They describe, qualify, quantify, classify, or specify an entity.
B. They have a data type, such as number or character string.
C. They are often adjectives.
D. They must be single valued.
Section 3
24. Relationship Cardinality is important. True or False?
A. True
B. False
26. One Relationship can be mandatory in one direction and optional in the other direction. True or
False?
A. True
B. False
27. Matrix Diagrams show Optionality and Cardinality of the ERDs they document. True or False?
A. True
B. False
28. Matrix Diagrams are used to verify that all relationships have been identified for an ERD. True or
False?
A. True
B. False
30. When reading a relationship between 2 entities, the relationship is read both from left to right and
right to left. True or False?
A. True
B. False
Section 4
32. How should you handle constraints that cannot be modeled on an ER diagram?
A. Always let the network architect handle them
B. Explain them to the users so they can enforce them
C. List them on a separate document to be handled programmatically
D. All constraints must be modeled and shown on the ER diagram
33. How would you model a business rule that states that girls and boys may not attend classes
together?
A. Make the attribute Gender optional
B. Make the attribute Gender mandatory
C. Supertype STUDENT has two subtypes BOY and GIRL which are related to GENDER,
which is related to CLASS
D. Use a supertype
37. A supertype can only have two subtypes and no more. True or False?
A. True
B. False
38. All instances of the supertype must be an instance of one of the subtypes. True or False?
A. True
B. False
39. You can only create relationships to a Supertype, not to a Subtype. True or False?
A. True
B. False
40. All instances of a subtype must be an instance of the supertype. True or False?
A. True
B. False
Section 5
41. A Diamond on a relationship indicates the Relationship as Non-Tranferable. True or False?
A. True
B. False
42. If a relationship can be moved between instances of the entities it connects, it is said to be:
A. Recursive
B. Implicit
C. Transferable
D. Committed
43. Every ERD must have at least one non-transferable relationship. True or False?
A. True
B. False
44. Which of the following pairs of entities is most likely to be modeled as a M:M relationship?
A. TREE and BRANCH
B. CAR and WHEEL
C. TEACHER and SUBJECT AREA
D. PERSON and FINGERPRINT
45. If the same relationship is represented twice in an Entity Relationship Model, it is said to be:
A. Removable
B. Redundant
C. Resourceful
D. Replicated
46. Which of the following pairs of entities is most likely to be modeled as a 1:1 relationship?
A. PERSON and FINGERPRINT
B. TREE and BRANCH
C. CAR and WHEEL
D. TEACHER and SUBJECT AREA
47. If two entities have two relationships between them, these relationships can be either
_____________ or _____________ .
A. Redundant and Replicated
B. Redundant or Required
C. Replicated or Required
D. Resourced and Really Good
48. When you resolve a M:M by creating an intersection entity, this new entity will always inherit:
A. The UID's from the entities in the original M:M.
B. The attributes of both related entities.
C. Nothing is inherited from the original entities and relationship.
D. A relationship to each entity from the original M:M.
49. 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?
A. True
B. False
50. Intersection Entities often have the relationships participating in the UID, so the relationships are
often barred. True or False?
A. True
B. False
2. Where an entity has more than one attribute suitable to be the Primary UID, these are known as
_____________ UIDs.
A. Candidate
B. Composite
C. Secondary
D. Simple
3. There is no limit to how many attributes can make up an entity's UID. True or False?
A. True
B. False
4. If an entity has no attribute suitable to be a Primary UID, we can create an artificial one. True or
False?
A. True
B. False
5. If an entity has a multi-valued attribute, to conform to the rule of 1st Normal Form we:
A. Create an additional entity and relate it to the original entity with a 1:M relationship.
B. Make the attribute optional
C. Do nothing, an entity does not have to be in 1st Normal Form
D. Create an additional entity and relate it to the original entity with a M:M relationship.
6. An entity ORDER has the attributes Order ID, Order Date, Product id, Customer ID. This entity is
in 1st Normal Form. True or False?
A. True
B. False
7. To convert an entity with a multi valued attribute to 1st Normal Form, we create an additional
entity and relate it to the original entity with a 1:1 relationship. True or False?
A. True
B. False
8. When data is stored in more than one place in a database, the database violates the rules of
___________.
A. Decency
B. Normalcy
C. Replication
D. Normalization
10. Examine the following entity and decide how to make it conform to the rule of 2nd Normal Form:
ENTITY: RECEIPT
ATTRIBUTES:
#CUSTOMER ID
#STORE ID
STORE LOCATION
DATE
A. Move the attribute STORE LOCATION to a new entity, STORE, with a UID of STORE
ID, and create a relationship to the original entity.
B. Do nothing, it is already in 2nd Normal Form.
C. Move the attribute STORE LOCATION to a new entity, STORE, with a UID of STORE
LOCATION, and create a relationship to the original entity.
D. Delete the attribute STORE ID
11. Any Non-UID attribute must be dependent upon the entire UID. True or False?
A. True
B. False
12. Examine the following Entity and decide which rule of Normal Form is being violated:
ENTITY: CLIENT
ATTRIBUTES:
# CLIENT ID
FIRST NAME
LAST NAME
STREET
CITY
A. 1st Normal Form.
B. 2nd Normal Form.
C. 3rd Normal Form.
D. None of the above, the entity is fully normalised.
13. A transitive dependency exists when any attribute in an entity is dependent on any other non-UID
attribute in that entity. True or False?
A. True
B. False
14. When any attribute in an entity is dependent on any other non-UID attribute in that entity, this is
known as:
A. Transitive dependency
B. Functional dependency
C. Dependency
D. Non-dependency
15. The Rule of 3rd Normal Form states that No Non-UID attribute can be dependent on another non-
UID attribute. True or False?
A. True
B. False
2. Arcs are used to visually represent _________ between two or more relationships in an ERD.
A. Exclusivity
B. Sameness
C. Differences
D. Inheritance
4. Every business has restrictions on which attribute values and which relationships are allowed.
These are known as:
A. Entities.
B. Relationships
C. Attributes
D. Constraints.
6. To visually represent exclusivity between two or more relationships in an ERD you would most
likely use an ________.
A. UID
B. Relationship
C. Arc
D. Attribute
7. Arcs model an Exclusive OR constraint. True or False?
A. benar
B. Palsu
10. A Hierarchical relationship is a series of relationships that reflect entities organized into
successive levels. True or False?
A. benar
B. Palsu
11. A particular problem may be solved using either a Recursive Relationship or a Hierarchical
Relationship, though not at the same time. True or False?
A. benar
B. Palsu
12. A single relationship can be both Recursive and Hierarchical at the same time. True or False?
A. benar
B. Palsu
14. Cascading UIDs are a feature often found in what type of Relationship?
A. General Relationship
B. Invalid Relationship
C. Recursive Relationship
D. Heirarchical Relationship
2. Which of the following scenarios should be modeled so that historical data is kept? (Choose two)
A. BABY and AGE
B. CUSTOMER and ORDERS
C. TEACHER and AGE
D. CUSTOMER and PAYMENTS
3. Modeling historical data can produce a unique identifier that includes a date. True or False?
A. benar
B. Palsu
4. How do you know when to use the different types of time in your design?
A. Always model time; you can take it out later if it is not needed.
B. It depends on the functional needs of the system .
C. The rules are fixed and should be followed.
D. You would first determine the existence of the concept of time and map it against the
Greenwich Mean Time.
5. There are no circumstances where you would create a DAY entity. True or False?
A. benar
B. Palsu
6. Which of the following would be a logical constraint when modeling time for a country entity?
A. Daily traffic patterns must be monitored to determine which countries are overcrowded.
B. People have births and deaths in their countries that must be tracked by the system.
C. Countries may change their names and/or borders over a period of time.
D. If you are doing a system for France or Germany, you would need security clearance.
7. When you add the concept of time to your data model, your model becomes more complex. True
or False?
A. benar
B. Palsu
9. Formal rules exist for drawing ERD's. You must always follow them, even if it results in an ERD
that is difficult to read. True or False?
A. benar
B. Palsu
10. Which of the following statements are true for ERD's to enhance their readability. (Choose Two)
A. You must ensure that you have every single entity--even if hundreds of them exist--on one
single, big diagram.
B. It is OK to break down a large ERD into subsets of the overall picture. By doing so, you
end up with more than one ERD that, taken together, documents the entire system.
C. Avoid crossing one relationship line with another.
D. The crows feet (many ends) can point whichever way is the easiest to draw.
11. No formal rules exist for drawing ERD's. The most important thing is to make sure that all
entities, attributes, and relationships are documented on the diagram, and the diagram is clear and
readable. True or False?
A. benar
B. Palsu
12. In an ERD, High Volume Entities usually have very few relationships to other entities. True or
False?
A. benar
B. Palsu
13. You are doing a data model for a computer sales company where the price fluctuates on a regular
basis. If you want to allow the company to modify the price and keep track of the changes, what is
the best way to model this?
A. Create a product entity and a related price entity with start and end dates, and then let the
users enter the new price whenever required.
B. Create a new item and a new price every day.
C. Use a price entity with a start and end date
D. Allow them to delete the item and enter a new one.
E. Both A and C
14. When a system requires that old values for attributes are kept on record, this is know as
Journaling or Logging. True or False?
A. benar
B. Palsu
15. Why would you want to model a time component when designing a system that lets people buy
bars of gold?
A. The Government of your country might want to be notified of this transaction.
B. You would not want to model this; it is not important.
C. Sales people must determine where the gold is coming from.
D. The price of gold fluctuates and, to determine the current price, you need to know the
time of purchase.
Section 9 – Mapping
1. In an Oracle database, why would the following table name not be allowed 'EMPLOYEE JOBS'?
A. EMPLOYEE is a reserved word
B. JOBS is a reserved word
C. The database does not understand all capital letters
D. You cannot have spaces between words in a table name
3. Why would this table name NOT work in an Oracle database? this_year_end+next_year
A. Table names must begin with an alphabetic character.
B. It is too long.
C. The Plus sign + is not allowed in object names.
D. None of the above.
5. Identify all of the correct statements that complete this sentence: A primary key is: (Choose
Three)
A. Only one column that cannot be null
B. A single column that uniquely identifies each row in a table
C. A set of columns and keys in a single table that uniquely identifies each row in a single
table
D. A set of columns that uniquely identifies each row in a table
9. 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)
A. Make all relationships mandatory
B. Make all relationships optional
C. Create an additional check constraint to verify that one foreign key is populated and the
others are not
D. All the above
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?
A. benar
B. Palsu
11. Which of the following is a valid reason for considering a Subtype Implementation?
A. The resulting table will reside in a single database and be used by just ONE user.
B. Business functionality, business rules, access paths, and frequency of access are all very
different between the subtypes.
C. Most of the relationships are at the supertype level.
D. The common access paths for the supertypes are different.
12. Relationships on an ERD can only be transformed into UIDs in the physical model? True or
False?
A. benar
B. Palsu
13. An Arc is transformed to the physical model by adding a foreign Key for every relationship in the
Arc. True or False?
A. benar
B. Palsu
14. When an Arc is transformed to the physical model every relationship in the Arc becomes a
mandatory Foreign Key. True or False?
A. benar
B. Palsu
15. In a physical model, many to many relationships are resolved via a structure called a(n):
________________
A. Intersection Entity
B. Subtype
C. Intersection Table
D. Supertype
3. If an entity has no attribute suitable to be a Primary UID, we can create an artificial one. True or
False?
A. benar
B. Palsu
7. Examine the following entity and decide which attribute breaks the 2nd Normal Form rule:
ENTITY: RECEIPT
ATTRIBUTES:
#CUSTOMER ID
#STORE ID
STORE LOCATION
DATE
A. STORE ID
B. CUSTOMER ID
C. DATE
D. STORE LOCATION
8. If an entity has a multi-valued attribute, to conform to the rule of 1st Normal Form we:
A. Create an additional entity and relate it to the original entity with a 1:M relationship.
B. Create an additional entity and relate it to the original entity with a M:M relationship.
C. Do nothing, an entity does not have to be in 1st Normal Form
D. Make the attribute optional
9. An entity ORDER has the attributes Order ID, Order Date, Product id, Customer ID. This entity is
in 1st Normal Form. True or False?
A. benar
B. Palsu
10. When data is only stored in one place in a database, the database conforms to the rules of
___________.
A. Multiplication
B. Reduction
C. Normality
D. Normalization
11. When all attributes are single-valued, the database model is said to conform to:
A. 2nd Normal Form
B. 3rd Normal Form
C. 4th Normal Form
D. 1st Normal Form
12. Examine the following Entity and decide which sets of attributes break the 3rd Normal Form rule:
ENTITY: TRAIN
ATTRIBUTES:
TRAIN ID
MAKE
DRIVER ID
DRIVER NAME
DATE OF MANUFACTURE
A. TRAIN ID, MAKE
B. DRIVER ID, DRIVER NAME
C. MAKE, DATE OF MANUFACTURE
D. None of the above, the entity is already in 3rd Normal Form.
13. The Rule of 3rd Normal Form states that No Non-UID attribute can be dependent on another non-
UID attribute. True or False?
A. benar
B. Palsu
14. As a database designer, you do not need to worry about where in the datamodel you store a
particular attribute; as long as you get it onto the ERD, your job is done. True or False?
A. benar
B. Palsu
15. When any attribute in an entity is dependent on any other non-UID attribute in that entity, this is
known as:
A. Functional dependency
B. Non-dependency
C. Transitive dependency
D. Dependency
Section 7
16. Arcs are used to visually represent _________ between two or more relationships in an ERD.
A. Sameness
B. Differences
C. Exclusivity
D. Inheritance
17. Every business has restrictions on which attribute values and which relationships are allowed.
These are known as:
A. Constraints.
B. Entities.
C. Attributes
D. Relationships
18. Which of the following can be added to a relationship?
A. An attribute
B. An optional attribute can be created
C. A composite attribute
D. An arc can be assigned
19. To visually represent exclusivity between two or more relationships in an ERD you would most
likely use an ________.
A. Attribute
B. Arc
C. Relationship
D. UID
21. A single relationship can be both Recursive and Hierarchical at the same time. True or False?
A. benar
B. Palsu
24. A Hierarchical relationship is a series of relationships that reflect entities organized into
successive levels. True or False?
A. benar
B. Palsu
Section 8
25. Historical data must never be kept. True or False?
A. benar
B. Palsu
26. Which of the following scenarios should be modeled so that historical data is kept? (Choose two)
A. TEACHER and AGE
B. BABY and AGE
C. CUSTOMER and ORDERS
D. CUSTOMER and PAYMENTS
27. Which of the following statements are true for ERD's to enhance their readability. (Choose Two)
A. It is OK to break down a large ERD into subsets of the overall picture. By doing so, you end
up with more than one ERD that, taken together, documents the entire system.
B. You must ensure that you have every single entity--even if hundreds of them exist--on one
single, big diagram.
C. Avoid crossing one relationship line with another.
D. The crows feet (many ends) can point whichever way is the easiest to draw.
28. In an ERD, High Volume Entities usually have very few relationships to other entities. True or
False?
A. benar
B. Palsu
30. All systems must have an entity called WEEK with a holiday attribute so that you know when to
give employees a holiday. True or False?
A. benar
B. Palsu
31. You are doing a data model for a computer sales company where the price of postage depends
upon the day of the week that 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?
A. 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.
B. Update the prices in the system, print out the current prices when they change, and pin them
on the company noticeboard.
C. Allow them to enter whatever delivery charge they want.
D. Email current prices to all employees whenever a price changes.
32. You are doing a data model for a computer sales company where the price fluctuates on a regular
basis. If you want to allow the company to modify the price and keep track of the changes, what is
the best way to model this?
A. Create a product entity and a related price entity with start and end dates, and then let the
users enter the new price whenever required.
B. Create a new item and a new price every day.
C. Use a price entity with a start and end date
D. Allow them to delete the item and enter a new one.
E. Both A and C
Section 9
33. The explanation below is an example of which constraint type?
The value in the dept_no column of the EMPLOYEES table must match a value in the dept_no
column in the DEPARTMENTS table.
A. Referential integrity
B. Column integrity
C. Entity integrity
D. User-defined integrity
36. A foreign key cannot refer to a primary key in the same table. True or False?
A. benar
B. Palsu
38. Which of the following is a valid reason for considering a Subtype Implementation?
A. Business functionality, business rules, access paths, and frequency of access are all very
different between the subtypes.
B. The resulting table will reside in a single database and be used by just ONE user.
C. Most of the relationships are at the supertype level.
D. The common access paths for the supertypes are different.
39. 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)
A. Make all relationships mandatory
B. Make all relationships optional
C. Create an additional check constraint to verify that one foreign key is populated and the others
are not
D. All the above
40. Relationships on an ERD can only be transformed into UIDs in the physical model? True or
False?
A. benar
B. Palsu
41. 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:
A. The table B
B. Nowhere, One-to-One relationships are not transformed.
C. Both tables A and B get a new column and a Foreign Key.
D. The table A
43. In a physical model, many to many relationships are resolved via a structure called a(n):
________________
A. Subtype
B. Intersection Entity
C. Intersection Table
D. Supertype
44. A barrred Relationship will result in a Foreign Key column that also is part of:
A. The Primary Key
B. The Column Name
C. The Table Name
D. The Check Constraint
45. In an Oracle database, why would the following table name not be allowed 'EMPLOYEE JOBS'?
A. You cannot have spaces between words in a table name
B. EMPLOYEE is a reserved word
C. JOBS is a reserved word
D. The database does not understand all capital letters
48. The Physical model is created by transforming which of the following models?
A. Table
B. Constraint
C. Conceptual
D. Physical
Section 10
49. During which phases of the System Development Life Cycle would you roll out the system to the
users?
A. Transition and Production
B. Design and Production
C. Build and Transition
D. Strategy and Analysis
50. System Documentation is developed right at the end once the system has gone live and users have
been using it for a little while. You are more likely to get it correct that way. True or False?
A. benar
B. Palsu
This statement will retrieve all the rows in the employees table. True or False?
A. benar
B. Palsu
3. The DESCRIBE command returns all rows from a table. True or False?
A. benar
B. Palsu
4. What command can be used to create a new row in a table in the database?
A. CREATE
B. INSERT
C. NEW
D. ADD
5. All computers in the world speak the same languages, so you only need to learn one programming
language - Oracle SQL. True or False?
A. benar
B. Palsu
6. Most of the well know Internet search engines use databases to store data. True or False?
A. benar
B. Palsu
7. Every time you shop online, it is likely you will be accessing a database. True or False?
A. benar
B. Palsu
8. Every row in a relational database table is unique.
A. benar
B. Palsu
11. In the default order of precedence, which operator would be evaluated first?
A. Multiplications and Divisions are at the same level and would be evaluated first based
on left to right order
B. Divisions and Subtractions are at the same level and would be evaluated first based on left to
right order
C. Subtractions and Additions are at the same level and would be evaluated first based on left to
right order
D. Additions and Multiplications are at the same level and would be evaluated first based on left
to right order
14. If you want to see just a subset of the columns in a table, you use what symbol?
A. &
B. %
C. *
D. None of the above; instead of using a symbol, you name the columns for which you want
to see data.
15. The SELECT statement retrieves information from the database. In a SELECT statement, you can
do all of the following EXCEPT:
A. Selection
B. Joining
C. Projection
D. Manipulation
2. When using the "LIKE" operator, the % and _ symbols can be used to do a pattern-matching, wild
card search. True or False?
A. benar
B. Palsu
4. Which two statements would select salaries that are greater than or equal to 2500 and less than or
equal to 3500? (Choose two)
A. WHERE salary >= 2500 AND salary <= 3500
B. WHERE salary BETWEEN 3500 AND 2500
C. WHERE salary <=2500 AND salary >= 3500
D. WHERE salary BETWEEN 2500 AND 3500
5. 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?
A. benar
B. Palsu
7. You need to display employees with salaries that are at least 30000 or higher. Which comparison
operator should you use?
A. !=
B. "=>"
C. >=
D. >
9. The structure of the table can be displayed with the _________ command:
A. Dis
B. Describe
C. Desc
D. Desc and the Describe
10. Which operator is used to combine columns of character strings to other columns?
A. ||
B. +
C. /
D. *
11. 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?
A. %
B. #
C. ~
D. *
12. What will be the result of the SELECT statement and what will display?
SELECT last_name, salary, salary + 300
FROM employees;
A. Display the last name, salary, and the results of adding 300 to the salary of the first employee
row
B. Display the last name, salary, and the results of adding 300 to each salary for all the
employees
C. Display the last name and salary of all employees who have a salary greater than 300.
D. Modify the salary column by adding 300 and only display the last name and the new salary.
14. How can you write "not equal to" in the WHERE-clause?
A. !=
B. ^=
C. <>
D. All of the above
2. Which of the following are TRUE regarding the logical AND operator?
A. TRUE AND FALSE return FALSE
B. TRUE AND TRUE return FALSE
C. FALSE AND TRUE return NULL
D. TRUE AND FALSE return TRUE
4. 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?
A. CHANGE
B. SORT
C. DESC
D. ASC
9. 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-1992 / 5000
Which SELECT statement could you use?
A. SELECT employee_id ||'"- "|| last_name "Employee",
hire_date ||" / "|| salary Start Date and Salary"
FROM employees
WHERE hire_date <= '01-Jan-1996';
You must display the player name, team id, and salary for players whose salary is in the
range from 25000 through 100000 and whose team id is in the range of 1200 through
1500. The results must be sorted by team id from lowest to highest and then further sorted
by salary from highest to lowest. Which statement should you use to display the desired
result?
A. SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary > 24999.99 AND salary < 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id ASC, salary DESC;
B. SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 24999.99 AND 100000.01
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id DESC, salary DESC;
C. SELECT last_name, first_name, team_id, salary
FROM players
WHERE salary BETWEEN 25000 AND 100000
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary DESC;
D. SELECT last_name, first_name, team_id, salary
FROM players
WHERE (salary > 25000 OR salary < 100000)
AND team_id BETWEEN 1200 AND 1500
ORDER BY team_id, salary;
5. Which of the following SQL statements would correctly return a song title identified in the
database as "All These Years"?
A. WHERE title IN('All','These','Years');
B. WHERE title CONTAINS 'Years';
C. WHERE title LIKE INITCAP('%all these years');
D. WHERE title LIKE LOWER('all these years');
7. You want to create a report that displays all orders and their amounts that were placed during the
month of January. You want the orders with the highest amounts to appear first. Which query
should you issue?
A. SELECT orderid, total
FROM orders
WHERE order_date IN ( 01-Jan-2002 , 31-Jan-2002 )
ORDER BY total;
B. SELECT orderid, total
FROM orders
WHERE order_date BETWEEN '01-Jan-2002' AND '31-Jan-2002'
ORDER BY total DESC;
C. SELECT orderid, total
FROM orders
WHERE order_date BETWEEN '31-Jan-2002' AND '01-Jan-2002'
ORDER BY total DESC;
D. SELECT orderid, total
FROM orders
WHERE order_date LIKE '01-Jan-2002' AND '31-Jan-2002'
ORDER BY total DESC;
8. Which function would you use to return the current database server date and time?
A. DATETIME
B. CURRENTDATE
C. SYSDATE
D. DATE
9. You need to display the number of months between today's date and each employee's hiredate.
Which function should you use?
A. BETWEEN
B. MONTHS_BETWEEN
C. ROUND
D. ADD_MONTHS
10. Round and Trunc cannot be used on Date datatypes. True or False?
A. benar
B. Palsu
13. Which script displays '01-May-2004' when the HIRE_DATE value is '20-May-2004'?
A. SELECT TRUNC(hire_date, 'MI')
FROM employees;
B. SELECT TRUNC(hire_date, 'MONTH')
FROM employees;
C. SELECT ROUND(hire_date, 'MONTH')
FROM employees;
D. SELECT ROUND(hire_date, 'MON')
FROM employees;
A. 46
B. 45.9
C. 50
D. None of the above
4. Which of the following General Functions will return the first non-null expression in the
expression list?
A. NULLIF
B. NVL2
C. COALESCE
D. NVL
5. When executed, which statement displays a zero if the TUITION_BALANCE value is zero and
the HOUSING_BALANCE value is null?
A. SELECT TO_NUMBER(tuition_balance, 0), TO_NUMBER (housing_balance, 0),
tutition_balance + housing_balance "Balance Due"
FROM student_accounts;
B. SELECT NVL (tuition_balance + housing_balance, 0) "Balance Due"
FROM student_accounts;
C. SELECT NVL(tuition_balance, 0), NVL (housing_balance), tuition_balance +
housing_balance "Balance Due"
FROM student_accounts;
D. SELECT tuition_balance + housing_balance
FROM student_accounts;
6. Consider the following data in the Employees table: (last_name, commission_pct, manager_id)
DATA:
King, null, null
Kochhar, null, 100
Vargas, null, 124
Zlotkey, .2, 100
9. You need to replace null values in the DEPT_ID column with the text N/A. Which functions
should you use?
A. TO_NUMBER and NULLIF
B. TO_CHAR and NVL
C. TO_CHAR and NULL
D. TO_CHAR and NULLIF
SELECT *
FROM employees
WHERE employee_id = manager_id;
A. Yes, Oracle will perform implicit dataype conversion, and the query will return one row of
data.
B. No, because the datatypes of EMPLOYEE_ID and MANAGER_ID are different.
C. Yes, Oracle will perform implicit datatype conversion, but the WHERE clause will not
find any matching data.
D. No.ᅠ You will have to re-wirte the statement and perform explicit datatype conversion.
11. If you use the RR format when writing a query using the date 27-Oct-17 and the year is 2001,
what year would be the result?
A. 1917
B. 1901
C. 2017
D. 2001
14. You need to display the HIRE_DATE values in this format: 25th of July 2002. Which SELECT
statement would you use?
A. SELECT TO_CHAR(hire_date, 'DDTH "of" Month YYYY')
FROM employees;
B. SELECT TO_CHAR(hire_date, 'ddth "of" Month YYYY')
FROM employees;
C. SELECT TO_CHAR(hire_date, 'DDspth 'of' Month RRRR')
FROM employees;
D. SELECT enroll_date(hire_date, 'DDspth "of" Month YYYY')
FROM employees;
15. Which statement is true about SQL functions?
A. Functions can convert values or text to another data type.
B. Functions can round a number to a specified decimal place.
C. Functions can convert upper case characters to lower case characters.
D. a, b and c are true.
E. None of the above statements are true.
3. Table aliases MUST be used with columns referenced in the JOIN USING clause. True or False?
A. benar
B. Palsu
4. What types of joins will return the unmatched values from both tables in the join?
A. Full outer joins
B. Left outer joins
C. Natural joins
D. Right outer joins
5. Which syntax would be used to retrieve all rows in both the EMPLOYEES and DEPARTMENTS
tables, even when there is no match?
A. LEFT OUTER JOIN AND RIGHT OUTER JOIN
B. FULL OUTER JOIN
C. FULL INNER JOIN
D. Use any equijoin syntax
6. You need to join the EMPLOYEE_HIST and EMPLOYEES tables. The EMPLOYEE_HIST table
will be the first table in the FROM clause. All the matched and unmatched rows in the
EMPLOYEES table need to be displayed. Which type of join will you use?
A. A left outer join
B. A right outer join
C. An inner join
D. A cross join
11. Hierarchical queries can walk both Top-Down and Bottom-Up. True or False?
A. benar
B. Palsu
14. Hierarchical queries MUST use the LEVEL pseudo column. True or False?
A. benar
B. Palsu
True or False?
A. benar
B. Palsu
True or False?
A. benar
B. Palsu
4. 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?
A. It is not possible to join these two tables.
B. A non-equijoin
C. An equijoin
D. A full outer join
5. To perform a valid outer join between DEPARMENTS and EMPLOYEES to list departments
without employees, select the correct WHERE clause for the following select statement:
SELECT d.department_name, e.last_name
FROM employees e, departments d
WHERE
A. e.department_id(+) = d.department_id
B. e.department_id = d.department_id
C. e.department_id(+) = d.department_id(+)
D. e.department_id = d.department_id(+)
8. Which statement about the join syntax of an Oracle Proprietary join syntax SELECT statement is
true?
A. The ON keyword must be included.
B. The FROM clause represents the join criteria.
C. The JOIN keyword must be included.
D. The WHERE clause represents the join criteria.
10. When must column names be prefixed by table names in join syntax?
A. When the same column name appears in more than one table of the query
B. Only when query speed and database performance is a concern
C. When the more than two tables participate in the join
D. Never
11. When joining 3 tables in a SELECT statement, how many join conditions are needed in the
WHERE clause?
A. 2
B. 1
C. 0
D. 3
12. You need to provide a list of the first and last names of all employees who work in the Sales
department who earned a bonus and had sales over $50,000. The company president would like
the sales listed starting with the highest amount first. The EMPLOYEES table and the
SALES_DEPT table contain the following columns:
EMPLOYEES
EMPLOYEE_ID NUMBER(10) PRIMARY KEY
LAST_NAME VARCHAR2(20)
FIRST_NAME VARCHAR2(20)
DEPTARTMENT_ID VARCHAR2(20)
HIRE_DATE DATE
SALARY NUMBER(10)
SALES_DEPT
SALES_ID NUMBER(10) PRIMARY KEY
SALES NUMBER(20)
QUOTA NUMBER(20)
MANAGER VARCHAR2(30)
BONUS NUMBER(10)
EMPLOYEE_ID NUMBER(10) FOREIGN KEY
13. If table A has 10 rows and table B has 5 rows, how many rows will be returned if you perform a
cartesian join on those two tables?
A. 5
B. 50
C. 15
D. 10
14. Oracle proprietary JOINS can use the WHERE clause for conditions other than the join-condition.
True or False?
A. benar
B. Palsu
15. You have two tables named EMPLOYEES and SALES. You want to identify the sales
representatives who have generated at least $100,000 in revenue. Which query should you issue?
A. SELECT first_name, last_name, sales
FROM employees e, sales s
WHERE e.employee_id = s.employee_id AND revenue > 100000;
B. SELECT e.first_name, e.last_name, s.sales
FROM employees e, sales s
WHERE e.employee_id = s.employee_id AND revenue >= 100000;
C. SELECT e.first_name, e.last_name, s.sales
FROM employees, sales
WHERE e.employee_id = s.employee_id AND revenue >= 100000;
D. SELECT e.first_name, e.last_name, s.sales
FROM employees e, sales s
WHERE e.employee_id = s.employee_id AND revenue > 100000;
Section 8 – Group Functions Part I
1. Evaluate this SELECT statement:
SELECT COUNT(*)
FROM products;
4. 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)
8. You need to calculate the average salary of employees in each department. Which group function
will you use?
A. AVERAGE
B. MEAN
C. MEDIAN
D. AVG
9. Examine the data in the PAYMENT table:
PAYMENT_ID CUSTOMER_ID PAYMENT_DATEPAYMENT_TYPE PAYMENT_AMOUNT
You need to determine the average payment amount made by each customer in January, February,
and March of 2003.
Which SELECT statement should you use?
A. SELECT SUM(payment_amount)
FROM payment
WHERE payment_date BETWEEN '01-Jan-2003' and '31-Mar-2003';
B. SELECT AVG(payment_amount)
FROM payment;
C. SELECT AVG(payment_amount)
FROM payment WHERE payment_date
BETWEEN '01-Jan-2003' AND '31-Mar-2003';
D. SELECT AVG(payment_amount)
FROM payment
WHERE TO_CHAR(payment_date) IN (Jan, Feb, Mar);
Which SELECT statement will return the average price for the 4x4 model?
A. SELECT AVG(price), model FROM trucks
WHERE model IS '4x4';
B. SELECT AVG(price) FROM trucks
WHERE model IS 4x4;
C. SELECT AVG(price) FROM trucks
WHERE model = '4x4';
D. SELECT AVG(price) FROM trucks
WHERE model IS '4x4';
11. 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)
12. The following statement will work, even though it contains more than one GROUP function:
SELECT AVG(salary), MAX(salary), MIN(salary), SUM(salary)
FROM employees;
True or False?
A. benar
B. Palsu
13. Which group function would you use to display the average price of all products in the
PRODUCTS table?
A. MAX
B. COUNT
C. AVG
D. SUM
15. What two group functions can be used with any datatype?
A. MIN, MAX
B. COUNT, SUM
C. SUM, AVG
D. STDDEV, VARIANCE
Section 9 – Group Functions Part II
1. When using SET operators, the names of the matching columns must be identical in all of the
SELECT statements used in the query. True or False?
A. True
B. False
3. When using SET operators, the number of columns and the data types of the columns must be
identical in all of the SELECT statements used in the query. True or False.
A. True
B. False
6. CUBE will cross-reference the columns listed in the ______ clause to create a superset of groups.
A. WHERE
B. GROUP BY
C. SELECT
7. GROUPING SETS is another extension to the GROUP BY clause and is used to specify multiple
groupings of data but provide a single result set. True or False?
A. True
B. False
Select the correct GROUP BY GROUPING SETS clause from the following list:
A. GROUP BY GROUPING SETS ((department_id, manager_id), (department_id,
SUM(salary), (manager_id, job_id))
B. GROUP BY GROUPING SETS (department_id, salary), (department_id, job_id),
(department_id, manager_id)
C. GROUP BY GROUPING SETS ((department_id, manager_id), (department_id,
job_id), (manager_id, job_id))
D. GROUP BY GROUPING SETS (department_id, AVG(salary)), (department_id, job_id),
(department_id, manager_id)
9. If you want to include subtotals and grand totals for all columns mentioned in a GROUP BY
clause, you should use which of the following extensions to the GROUP BY clause?
A. HAVING
B. GROUP BY ALL COLUMNS
C. ROLLUP
D. CUBE
12. If a select list contains both a column as well as a group function then what clause is required?
A. GROUP BY clause
B. HAVING clause
C. ORDER BY clause
D. JOIN clause
13. Evaluate this SELECT statement:
SELECT MAX(salary), department_id
FROM employees
GROUP BY department_id;
Section 10 – Subqueries
1. The WITH clause enables a SELECT statement to define the subquery block at the start of the
query, process the block just once, label the results, and then refer to the results multiple times.
True or False?
A. True
B. False
2. In a correlated subquery, the outer and inner queries are joined on one or more columns. (True or
False?)
A. benar
B. Palsu
3. When creating a report of all employees earning more than the average salary for their
department, a __________ ____________ can be used to first calculate the average salary of each
department, and then compare the salary for each employee to the average salary of that
employee's department.
A. GROUP BY
B. CORRELATED SUBQUERY
C. WITH CLAUSE
CLASS_ASSIGNMENTS
CLASS_ID NUMBER (5) Primary Key
TEACHER_ID NUMBER (5)
DATE
MAX_CAPACITY NUMBER (3)
All MAX_CAPACITY values are greater than 10. Which two SQL statements correctly use
subqueries? (Choose two.)
A. SELECT * FROM teachers
WHERE teacher_id LIKE
(SELECT teacher_id FROM class_assignments WHERE max_capacity > 1000);
B. SELECT * FROM teachers
WHERE teacher_id = (SELECT teacher_id, class_assignments WHERE max_capacity > 0);
C. SELECT * FROM teachers
WHERE teacher_id = (SELECT teacher_id FROM class_assignments WHERE class_id
= 45963);
D. SELECT * FROM class_assignments
WHERE max_capacity = (SELECT AVG(max_capacity) FROM class_assignments);
E. SELECT * FROM class_assignments
max_capacity = (SELECT AVG(max_capacity) FROM class_assignments GROUP BY
teacher_id);
8. You need to produce a report that contains all employee-related information for those employees
who have Brad Carter as a supervisor. However, you are not sure which supervisor ID belongs to
Brad Carter. Which query should you issue to accomplish this task?
A. SELECT * FROM employees WHERE supervisor_id =
(SELECT supervisor_id FROM employees
WHERE last_name = 'Carter');
B. SELECT * FROM supervisors WHERE supervisor_id =
(SELECT employee_id FROM supervisors
WHERE last_name = 'Carter');
C. SELECT * FROM employees WHERE supervisor_id =
(SELECT employee_id FROM employees
WHERE last_name = 'Carter');
D. SELECT * FROM supervisors WHERE supervisor_id =
(SELECT supervisor_id FROM employees
WHERE last_name = 'Carter');
11. The SQL multiple-row subquery extends the capability of the single-row syntax through the use
of which three comparison operators?
A. IN, ANY, and EQUAL
B. IN, ALL, and EVERY
C. IN, ANY, and EVERY
D. IN, ANY, and ALL
12. Group functions can be used in multiple-row subqueries in the HAVING and GROUP BY clauses.
True or False?
A. benar
B. Palsu
13. You are looking for Executive information using a subquery.
What will the following SQL statement display?
14. Which of the following statements contains a comparison operator that is used to restrict rows
based on a list of values returned from an inner query?
A. SELECT description FROM d_types
WHERE code IN (
SELECT type_code FROM d_songs);
B. SELECT description FROM d_types
WHERE code = ANY (
SELECT type_code FROM d_songs);
C. SELECT description FROM d_types
WHERE code <> ALL (
SELECT type_code FROM d_songs);
D. All of the above.
15. Group functions can be used in subqueries even though they may return many rows. True or
False?
A. benar
B. Palsu
If the RAISE_PERCENT column only contains null values, what will the statement return?
A. A null value or a zero depending on the value of the SALARY column
B. A null value or a numeric value depending on the value of the SALARY column
C. Only null values
D. Only zeroes
2. 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:
3. In the real world, databases used by businesses generally have a single table . True or False?
A. benar
B. Palsu
4. What command can be added to a select statement to return a subset of the data?
A. WHEN
B. WHERE
C. EVERYONE
D. ALL
5. What command can be used to create a new row in a table in the database?
A. CREATE
B. ADD
C. INSERT
D. NEW
Section 2
6. Which of the following WHERE clauses would not select the number 10?
A. WHERE hours <>10
B. WHERE hours BETWEEN 10 AND 20
C. WHERE hours IN (8,9,10)
D. WHERE hours <= 10
7. 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?
A. benar
B. Palsu
9. 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?
A. DISTINCT
B. UNIQUEONE
C. DISTINCTROW
D. ONLY
Section 3
12. Which clause would you include in a SELECT statement to sort the rows returned by the
LAST_NAME column?
A. WHERE
B. ORDER BY
C. HAVING
D. FROM
13. 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-1992 / 5000
Section 4
16. What does the following SQL SELECT statement return?
SELECT UPPER( SUBSTR('Database Programming', INSTR('Database Programming','P'),20))
FROM dual;
A. DATABASE
B. PROGRAMMING
C. Programming
D. Database
You query the database and return the value 79. Which script did you use?
A. SELECT INSTR(category, -2,2) FROM styles
WHERE style_id = 895840;
B. SELECT SUBSTR(category, -2,2) FROM styles
WHERE style_id = 758960;
C. SELECT INSTR(category, 2,2) FROM styles
WHERE style_id = 895840;
D. SELECT SUBSTR(category, 2,2) FROM styles
WHERE style_id = 895840;
19. Which query would return a whole number if the sysdate is 26-May-2004?
A. SELECT TRUNC(MONTHS_BETWEEN(SYSDATE,'19-Mar-1979') /12)
AS YEARS FROM DUAL;
B. SELECT TRUNC(YEARS_BETWEEN(SYSDATE,'19-Mar-1979') /12)
AS YEARS FROM DUAL;
C. SELECT MONTHS_BETWEEN(SYSDATE,'19-Mar-1979') /12 AS YEARS
FROM DUAL;
D. None of the above
Section 5
20. Which statement will return a listing of last names, salaries, and a rating of 'Low', 'Medium',
'Good' or 'Excellent' depending on the salary value?
A. 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;
B. 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;
C. 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;
D. 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;
22. Which of the following General Functions will return the first non-null expression in the
expression list?
A. COALESCE
B. NVL
C. NULLIF
D. NVL2
Section 6
26. 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?
A. SELECT worker.last_name, worker.hire_date, manager.last_name, manager.hire_date
FROM employees worker JOIN employees manager ON worker.manager_id !=
manager.employee_id
WHERE worker.hire_date < manager.hire_date
B. SELECT worker.last_name, worker.hire_date, manager.last_name, manager.hire_date
FROM employees worker JOIN employees worker ON worker.manager_id =
worker.employee_id
WHERE worker.hire_date < worker.hire_date
C. SELECT worker.last_name, worker.hire_date, manager.last_name, manager.hire_date
FROM employees worker JOIN employees manager ON worker.manager_id =
manager.employee_id
WHERE worker.hire_date > manager.hire_date
D. SELECT worker.last_name, worker.hire_date, manager.last_name, manager.hire_date
FROM employees worker JOIN employees manager ON worker.manager_id =
manager.employee_id
WHERE worker.hire_date < manager.hire_date
28. Which query represents the correct syntax for a left outer join?
A. SELECT companyname, orderdate, total
FROM customers
LEFT JOIN orders
ON customers.cust_id = orders.cust_id;
B. SELECT companyname, orderdate, total
FROM customers
LEFT OUTER orders
ON customers.cust_id = orders.cust_id;
C. SELECT companyname, orderdate, total
FROM customers
LEFT OUTER JOIN orders
ON customers.cust_id = orders.cust_id;
D. SELECT companyname, orderdate, total
FROM customers
OUTER JOIN orders
ON customers.cust_id = orders.cust_id;
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?
A. SELECT departments.department_id, employees.first_name, employees.last_name
FROM employees , departments
WHERE employees.employee_id
RIGHT OUTER JOIN departments.manager_id;
B. SELECT departments.department_id, employees.first_name, employees.last_name
FROM employees
RIGHT OUTER JOIN departments
ON (employees.employee_id = departments.manager_id);
C. SELECT departments.department_id, employees.first_name, employees.last_name
FROM employees
LEFT OUTER JOIN departments
WHERE (employees.department_id = departments.department_id);
D. SELECT departments.department_id, employees.first_name, employees.last_name
FROM employees
FULL OUTER JOIN departments
ON (employees.employee_id = departments.manager_id);
30. Which of the following conditions will cause an error on a NATURAL JOIN?
A. If it selects rows from the two tables that have equal values in all matched columns.
B. When you attempt to use two tables that have a common field.
C. When the NATURAL JOIN clause is based on all columns in the two tables that have the
same name.
D. If the columns having the same names have different data types.
31. The join column must be included in the select statement when you use the NATURAL JOIN
clause. True or False?
A. benar
B. Palsu
C.
32. Below find the structures of the PRODUCTS and VENDORS tables:
PRODUCTS
PRODUCT_ID NUMBER
PRODUCT_NAME VARCHAR2 (25)
VENDOR_ID NUMBER
CATEGORY_ID NUMBER
VENDORS
VENDOR_ID NUMBER
VENDOR_NAME VARCHAR2 (25)
ADDRESS VARCHAR2 (30)
CITY VARCHAR2 (25)
REGION VARCHAR2 (10)
POSTAL_CODE VARCHAR2 (11)
You want to create a query that will return an alphabetical list of products, including the product
name and associated vendor name, for all products that have a vendor assigned.
Section 7
33. 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?
A. Outer join
B. Self join
C. Equijoin
D. Nonequi-Join
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?
A. SELECT cust_id, company, total_sales
FROM customers c, sales s
WHERE c.cust_id = s.cust_id;
B. SELECT cust_id, company, total_sales
FROM customers, sales
WHERE cust_id = cust_id;
C. SELECT c.cust_id, c.company, s.total_sales
FROM customers c, sales s
WHERE c.cust_id = s.cust_id (+);
D. SELECT c.cust_id, c.company, s.total_sales
FROM customers c, sales s
WHERE c.cust_id = s.cust_id;
35. What is the result of a query that selects from two tables but includes no join condition?
A. A selection of rows from the first table only
B. A syntax error
C. A Cartesian product
D. A selection of matched rows from both tables
Section 8
36. Evaluate this SQL statement:
SELECT COUNT (amount) FROM inventory;
What will occur when the statement is issued?
A. The statement will replace all NULL values that exist in the AMOUNT column.
B. The statement will return the greatest value in the INVENTORY table.
C. The statement will count the number of rows in the INVENTORY table where the AMOUNT
column is not null.
D. The statement will return the total number of rows in the AMOUNT column.
37. You need to calculate the average salary of employees in each department. Which group function
will you use?
A. MEDIAN
B. AVERAGE
C. AVG
D. MEAN
38. Group functions return a value for ________________ and ________________ null values in
their computations.
A. each row, include
B. a row set, include
C. each row, ignore
D. a row set, ignore
Section 9
39. When using SET operators, the names of the matching columns must be identical in all of the
SELECT statements used in the query. True or False?
A. True
B. False
41. How would you alter the following query to list only employees where two or more employees
have the same last name?
A. SELECT last_name, COUNT(employee_id)
FROM EMPLOYEES
GROUP BY last_name;
B. SELECT last_name, COUNT(employee_id)
FROM EMPLOYEES
WHERE COUNT(*) > 1
GROUP BY last_name
C. SELECT employee_id, DISTINCT(last_name)
FROM EMPLOYEES
GROUP BY last_name
HAVING last_name > 1;
D. SELECT last_name, COUNT(last_name)
FROM EMPLOYEES
GROUP BY last_name
EXISTS COUNT(last_name) > 1;
E. SELECT last_name, COUNT(last_name)
FROM EMPLOYEES
GROUP BY last_name
HAVING COUNT(last_name) > 1;
The EMPLOYEES table contains the following columns:
You want to create a report that includes each employee's last name, employee identification
number, date of hire, and salary. The report should include only those employees who have been
with the company for more than one year and whose salary exceeds $40,000.
44. You use GROUPING functions to ______ database rows from tabulated rows.
A. COUNT
B. DISTINGUISH
C. CREATE
D. COMPUTE
Section 10
45. Which best describes a multiple-row subquery?
A. A query that returns only one row from the inner SELECT statement
B. A query that returns one or more rows from the inner SELECT statement
C. A query that returns one or more column values from the inner SELECT statement
D. A query that returns only one column value from the inner SELECT statement
47. Which of the following is a valid reason why the query below will not execute successfully?
SELECT employee_id, last_name, salary
FROM employees
WHERE department_id = (SELECT department_id FROM employees WHERE last_name like
'%u%');
A. A single, rather than a multiple value operator was used.
B. Second subquery found on the right instead of the left side of the operator.
C. First subquery not enclosed in parentheses.
D. The greater than operator is not valid.
48. You need to display all the players whose salaries are greater than or equal to John Brown's salary.
Which comparison operator should you use?
A. >=
B. <=
C. =
D. >
50. A correlated subquery is evaluated _____ for each row processed by the parent statement.
A. ONCE
B. EVERY TIME
C. COMPLETELY
Section 11 - Ensuring Quality Queries Part I
Section 12 – DML
1. You want to enter a new record into the CUSTOMERS table. Which two commands can be used
to create new rows?
A. INSERT, CREATE
B. MERGE, CREATE
C. INSERT, MERGE
D. INSERT, UPDATE
2. When the WHERE clause is missing in a DELETE statement, what is the result?
A. All rows are deleted from the table.
B. An error message is displayed indicating incorrect syntax.
C. The table is removed from the database.
D. Nothing. The statement will not execute.
3. To change an existing row in a table, you can use the UPDATE or INSERT statements. True or
False?
A. benar
B. Palsu
4. What keyword in an UPDATE statement specifies the column that you want to change?
A. WHERE
B. SET
C. HAVING
D. SELECT
6. A DEFAULT value can be specified for a column when the table is created. True or false?
A. benar
B. Palsu
8. A multi-table insert statement must have a subquery at the end of the statement. (True or False?)
A. benar
B. Palsu
9. The MERGE statement first tries to update one or more rows in a table that match the criteria; if
no row matches the criteria for the update, a new row will automatically be inserted instead. True
or False?
A. benar
B. Palsu
10. Multi-table inserts are used when the same source data should be inserted into _____________
target table.
A. More than one
B. A very large
C. Ten
D. A data warehouse
You create another table, named FT_STUDENTS, with an identical structure.You want to insert
all full-time students who have a STU_TYPE_ID value of "F" into the new table. You execute this
INSERT statement:
INSERT INTO ft_students
(SELECT stu_id, last_name, first_name, dob, stu_type_id, enroll_date
FROM students
WHERE UPPER(stu_type_id) = 'F');
12. What is the quickest way to use today's date when you are creating a new row?
A. Simply use the keyword DATE in the insert statement.
B. Use the TODAYS_DATE function.
C. Use the SYSDATE function.
D. Simply write today's date in the format 'dd-mon-rrrr'.
13. Which of the following statements will add a new customer to the customers table in the Global
Fast Foods database?
A. INSERT INTO customers
(id 145, first_name 'Katie', last_name 'Hernandez', address '92 Chico Way', city 'Los Angeles',
state 'CA', zip 98008, phone_number 8586667641);
B. 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");
C. 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);
D. INSERT IN customers (id, first_name, last_name, address, city, state, zip, phone_number);
15. To return a table summary on the customers table, which of the following is correct?
A. SHOW customers, or SEE customers
B. DISTINCT customers, or DIST customers
C. DEFINE customers, or DEF customers
D. DESCRIBE customers, or DESC customers
Section 13 – DDL
1. Which statement about a column is NOT true?
A. You can modify the data type of a column if the column contains non-null data.
B. You can increase the width of a CHAR column.
C. You can convert a CHAR data type column to the VARCHAR2 data type.
D. You can convert a DATE data type column to a VARCHAR2 column.
5. To completely get rid of a table, its contents, its structure, AND release the storage space the
keyword is:
A. KILL
B. TRUNCATE
C. DELETE
D. DROP
9. When creating a new table, which of the following naming rules apply. (Choose three)
A. Must be between 1 to 30 characters long
B. Must contain ONLY A - Z, a - z, 0 - 9, _ (underscore), $, and #
C. Can have the same name as another object owned by the same user
D. Must begin with a letter
E. Must be an Oracle reserved word
12. INTERVAL DAY TO SECOND stores a period of time in terms of days, hours, minutes, and
seconds. True or False?
A. benar
B. Palsu
13. The BLOB datatype can max hold 128 Terabytes of data. True or False?
A. benar
B. Palsu
Section 14 – Constraints
1. 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?
A. benar
B. Palsu
5. What is the syntax for removing a PRIMARY KEY constraint and all its dependent constraints?
A. ALTER TABLE table_name
DROP CONSTRAINT constraint_name;
B. DROP CONSTRAINT table_name (constraint_name);
C. ALTER TABLE table_name
DROP CONSTRAINT constraint_name CASCADE;
D. ALTER TABLE table_name
DROP CONSTRAINT FOREIGN KEY CASCADE;
6. A composite primary key may only be defined at the table level. True or False?
A. benar
B. Palsu
7. Which of the following pieces of code will successfully create a foreign key in the CDS table that
references the SONGS table?
A. CONSTRAINT d_cd_ song_id_fk FOREIGN KEY (song_id)REFERENCES d_songs(id)
B. CONSTRAINT k_cd_songid_fk FOREIGN KEY (song_id)REFERENCES d_songs(id)
C. song_id NUMBER(5) CONSTRAINT d_cd_ song_id_fk REFERENCES d_songs(id)
D. All of the above
8. An example of adding a check constraint to limit the salary that an employee can earn is:
A. ALTER TABLE employees ADD CONSTRAINT emp_salary_ck SALARY < 100000
B. MODIFY TABLE employees ADD CONSTRAINT emp_salary_ck CHECK(salary < 100000
C. ALTER TABLE employees CONSTRAINT emp_salary_ck CHECK(salary < 100000)
D. ALTER TABLE employees ADD CONSTRAINT emp_salary_ck CHECK (salary < 100000)
11. 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?
A. NOT NULL
B. UNIQUE
C. PRIMARY KEY
D. CHECK
12. A table can only have one unique key constraint defined. True or False?
A. benar
B. Palsu
13. A table must have at least one not null constraint and one unique constraint. True or False?
A. benar
B. Palsu
14. A table can have more than one UNIQUE key constraint. True or False?
A. benar
B. Palsu
Section 15 – Views
1. A Top-N Analysis is capable of ranking a top or bottom set of results. True or False?
A. benar
B. Palsu
You created a Top-n query report that displays the account numbers and new balance of the 800
accounts that have the highest new balance value. The results are sorted by payments value from
highest to lowest.
6. You administer an Oracle database. Jack manages the Sales department. He and his employees
often find it necessary to query the database to identify customers and their orders. He has asked
you to create a view that will simplify this procedure for himself and his staff. The view should
not accept INSERT, UPDATE, or DELETE operations. Which of the following statements should
you issue?
A. CREATE VIEW sales_view AS
(SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total FROM customers c, orders o
WHERE c.custid = o.custid);
B. CREATE VIEW sales_view
(SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
FROM customers c, orders o WHERE c.custid = o.custid)
WITH READ ONLY;
C. CREATE VIEW sales_view AS
(SELECT companyname, city, orderid, orderdate, total FROM customers, orders
WHERE custid = custid)
WITH READ ONLY;
D. CREATE VIEW sales_view AS
(SELECT c.companyname, c.city, o.orderid, o. orderdate, o.total
FROM customers c, orders o
WHERE c.custid = o.custid)
WITH READ ONLY;
7. You can create a view if the view subquery contains an inline view. True or False?
A. benar
B. Palsu
8. Which of the following DML operations is not allowed when using a Simple View created with
read only?
A. INSERT
B. UPDATE
C. DELETE
D. All of the above
9. You cannot insert data through a view if the view includes ______.
A. A WHERE clause
B. A column alias
C. A join
D. A GROUP BY clause
10. 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 can not
change salary values in other departments. Which clause should be included in the CREATE
VIEW statement?
A. WITH CHECK OPTION
B. OR REPLACE
C. FORCE
D. WITH READ ONLY
11. You need to create a view on the SALES table, but the SALES table has not yet been created.
Which statement is true?
A. You can create the table and the view at the same time using the FORCE option.
B. You must create the SALES table before creating the view.
C. By default, the view will be created even if the SALES table does not exist.
D. You can use the FORCE option to create the view before the SALES table has been
created.
12. Evaluate this CREATE VIEW statement:
CREATE VIEW emp_view
AS SELECT SUM(salary)
FROM employees;
14. In order to query a database using a view, which of the following statements applies?
A. Use special VIEW SELECT keywords.
B. You can retrieve data from a view as you would from any table.
C. The tables you are selecting from can be empty, yet the view still returns the original data
from those tables.
D. You can never see all the rows in the table through the view.
2. Which dictionary view would you query to display the number most recently generated by a
sequence?
A. USER_SEQUENCES
B. USER_OBJECTS
C. USER_TABLES
D. USER_CURRVALUES
4. To see the most recent value that you fetched from a sequence named my_seq you should
reference:
A. my_seq.currval
B. my_seq.(currval)
C. my_seq.(lastval)
D. my_seq.nextval
6. When creating a sequence, which keyword or option specifies the minimum sequence value?
A. CYCLE
B. MAXVALUE
C. NOMAXVALUE
D. MINVALUE
7. You created the LOCATION_ID_SEQ sequence to generate sequential values for the
LOCATION_ID column in the MANUFACTURERS table. You issue this statement:
11. What kind of INDEX is created by Oracle when you create a primary key?
A. UNIQUE INDEX
B. NONUNIQUE INDEX
C. INDEX
D. Oracle cannot create indexes automatically.
12. The EMPLOYEES table has an index named LN_IDX on the LAST_NAME column. You want to
change this index so that it is on the FIRST_NAME column instead. Which SQL statement will
do this?
A. ALTER INDEX ln_idx ON employees(first_name);
B. ALTER INDEX ln_idx TO employees(first_name);
C. ALTER INDEX ln_idx TO fn_idx ON employees(first_name);
D. None of the above; you cannot ALTER an index.
13. User Mary's schema contains an EMP table. Mary has Database Administrator privileges and
executes the following statement:
User Susan now needs to SELECT from Mary's EMP table. Which of the following SQL
statements can she use? (Choose two)
15. All tables must have indexes on them otherwise they cannot be queried. True or False?
A. benar
B. Palsu
Section 17 - Privileges and Regular Expressions
1. Which of the following simplifies the administration of privileges?
A. A role
B. An index
C. A trigger
D. A view
2. When granting an object privilege, which option would you include to allow the grantee to grant
the privilege to another user?
A. PUBLIC
B. WITH GRANT OPTION
C. WITH ADMIN OPTION
D. FORCE
3. To join a table in your database to a table on a second (remote) Oracle database, you need to use:
A. An Oracle gateway product
B. A database link
C. An ODBC driver
D. A remote procedure call
6. You need to grant user BOB SELECT privileges on the EMPLOYEES table. You want to allow
BOB to grant this privileges to other users. Which statement should you use?
A. GRANT SELECT ON employees TO bob WITH GRANT OPTION;
B. GRANT SELECT ON employees TO bob;
C. GRANT SELECT ON employees TO PUBLIC WITH GRANT OPTION;
D. GRANT SELECT ON employees TO bob WITH ADMIN OPTION;
7. Regular expressions used as check constraints are another way to ensure data is formatted
correctly prior to being written into the database table. True or False?
A. True
B. False
8. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or
False)
A. benar
B. Palsu
9. Parentheses are not used to identify the sub expressions within the expression. True or False?
A. True
B. False
10. User ADAM has successfully logged on to the database in the past, but today he receives an error
message stating that (although he has entered his password correctly) he cannot log on. What is
the most likely cause of the problem?
A. ADAM's CREATE SESSION privilege has been revoked.
B. ADAM's CREATE USER privilege has been revoked.
C. ADAM's user account has been removed from the database.
D. One or more object privileges have been REVOKEd from Adam.
12. The database administrator wants to allow user Marco to create new tables in his own schema.
Which privilege should be granted to Marco?
A. CREATE ANY TABLE
B. CREATE TABLE
C. SELECT
D. CREATE OBJECT
14. You want to grant user BOB the ability to change other users' passwords. Which privilege should
you grant to BOB?
A. The CREATE PROFILE privilege
B. The DROP USER privilege
C. The ALTER USER privilege
D. The CREATE USER privilege
15. 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
A. role_sys_privs (lists system privileges granted to roles)
B. user_tab_privs_recd (lists object privileges granted to the user)
C. role_tab_privs (lists table privileges granted to roles)
D. user_sys_privs (lists system privileges granted to the user)
Section 18 – TCL
1. Which of the following best describes the term "read consistency"?
A. It prevents other users from seeing changes to a table until those changes have been
committed
B. It ensures that all changes to a table are automatically committed
C. It prevents users from querying tables on which they have not been granted SELECT
privilege
D. It prevents other users from querying a table while updates are being executed on it
3. 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;
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:
6. You need not worry about controlling your transactions. Oracle does it all for you. True or False?
A, benar
C. Palsu
7. 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?
A. 24000
B. 78000
C. 48000
D. 30000
8. Which SQL statement is used to remove all the changes made by an uncommitted transaction?
A. ROLLBACK TO SAVEPOINT;
B. REVOKE;
C. ROLLBACK;
D. UNDO;
9. If Oracle crashes, your changes are automatically rolled back. True or False?
A. benar
B. Palsu
10. When you logout of Oracle, your data changes are automatically rolled back. True or False?
A. benar
B. Palsu
You want to retain all the employees with a salary of 15000; What statement would you execute
next?
A. ROLLBACK;
B. ROLLBACK TO SAVEPOINT upd1_done;
C. ROLLBACK TO SAVEPOINT upd2_done;
D. ROLLBACK TO SAVE upd1_done;
E. There is nothing you can do; either all changes must be rolled back, or none of them can be
rolled back.
12. 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?
A. An object privilege
B. An update statement
C. A sequence
D. A database link
E. A savepoint
14. If a database crashes, all uncommitted changes are automatically rolled back. True or False?
A. benar
B. Palsu
15. If UserB has privileges to see the data in a table, as soon as UserA has entered data into that table,
UserB can see that data. True or False?
A. benar
B. Palsu
3. If the employees table has 7 rows, how many rows are inserted into the copy_emps table with the
following statement:
4. When inserting a new row, the null keyword can be included in the values list for any column that
allows nulls. True or False?
A. benar
B. Palsu
5. You need to update the expiration date, but only for products manufactured before June 30th . In
which clause of the UPDATE statement will you specify this condition?
A. The SET clause
B. The WHERE clause
C. The ON clause
D. The USING clause
6. Which of the following represents the correct syntax for an INSERT statement?
A. INSERT VALUES INTO customers (3178 J. Smith 123 Main Street Nashville TN 37777;
B. INSERT INTO customers VALUES '3178' 'J.' 'Smith' '123 Main Street' 'Nashville' 'TN'
'37777';
C. INSERT INTO customers VALUES ('3178', 'J.', 'Smith', '123 Main Street', 'Nashville', 'TN',
'37777');
D. INSERT customers VALUES 3178, J., Smith, 123 Main Street, Nashville, TN, 37777;
7. What would happen if you issued a DELETE statement without a WHERE clause?
A. An error message would be returned.
B. Only one row would be deleted.
C. All the rows in the table would be deleted.
D. No rows would be deleted.
You need to increase the salary of each player for all players on the Tiger team by 12.5 percent.
The TEAM_ID value for the Tiger team is 5960. Which statement should you use?
A. UPDATE players (salary)
SET salary = salary * 1.125;
B. UPDATE players
SET salary = salary * .125
WHERE team_id = 5960;
C. UPDATE players
SET salary = salary * 1.125
WHERE team_id = 5960;
D. UPDATE players (salary)
VALUES(salary * 1.125)
WHERE team_id = 5960;
Section 13
9. To completely get rid of a table, its contents, its structure, AND release the storage space the
keyword is:
A. KILL
B. DELETE
C. DROP
D. TRUNCATE
Which statement should you use to increase the LAST_NAME column length to 35 if the column
currently contains 200 records?
A. ALTER TABLE employee
RENAME last_name VARCHAR2(35);
B. You CANNOT increase the width of the LAST_NAME column.
C. ALTER TABLE employee
MODIFY (last_name VARCHAR2(35));
D. ALTER employee TABLE
ALTER COLUMN (last_name VARCHAR2(35));
12. Which command could you use to quickly remove all data from the rows in a table without
deleting the table itself?
A. MODIFY
B. ALTER TABLE
C. TRUNCATE TABLE
D. DROP TABLE
13. Comments can be added to a table by using the COMMENT ON TABLE statement. The
comments being added are enclosed in:
A. Brackets { }
B. Single quotes ' '
C. Double quotes " "
D. Parentheses ( )
14. 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?
A. TRUNCATE TABLE
B. DROP TABLE
C. ALTER TABLE
D. DELETE
What will be the result in the hire_date column following this insert statement:
INSERT INTO employees VALUES (10, 'Natacha', 'Hansen', DEFAULT);
A. The column for hire_date will be null.
B. The character string SYSDATE.
C. Statement will work and the hire_date column will have the value of the date when the
statement was run.
D. Statement will fail, as you must list the columns into which you are inserting.
The above CREATE TABLE statement is acceptable, and will create a Table named bioclass that
contains a hire_date, first_name, and last_name column. True or False?
A. benar
B. Palsu
19. It is possible to create a table by using the CREATE TABLE command in conjunction with a
subquery. True or False?
A. benar
B. Palsu
Section 14
20. Which two statements about NOT NULL constraints are true? (Choose two)
A. Columns with a NOT NULL constraint can contain null values by default.
B. A NOT NULL constraint can be defined at either the table or column level.
C. The Oracle Server creates a name for an unnamed NOT NULL constraint.
D. The NOT NULL constraint requires that every value in a column be unique.
E. You CANNOT add a NOT NULL constraint to an existing column using the ALTER TABLE
ADD CONSTRAINT statement.
21. A column defined as NOT NULL can have a DEFAULT value of NULL. True or False?
A. benar
B. Palsu
23. When creating the EMPLOYEES table, which clause could you use to ensure that salary values
are 1000.00 or more?
A. CHECK CONSTRAINT (salary > 1000)
B. CHECK CONSTRAINT employee_salary_min (salary > 1000)
C. CONSTRAINT employee_salary_min CHECK salary > 1000
D. CONSTRAINT CHECK salary > 1000
E. CONSTRAINT employee_salary_min CHECK (salary >= 1000)
24. Which constraint type enforces uniqueness?
A. PRIMARY KEY
B. NOT NULL
C. FOREIGN KEY
D. CHECK
25. 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:
You need to disable the FOREIGN KEY constraint. Which statement should you use?
A. ALTER TABLE line_item
DROP CONSTRAINT product_id_fk;
B. ALTER TABLE line_item
DELETE CONSTRAINT product_id_fk;
C. ALTER TABLE line_item
ENABLE CONSTRAINT product_id_fk;
D. ALTER TABLE line_item
DISABLE CONSTRAINT product_id_fk;
Section 15
27. For a View created using the WITH CHECK OPTION keywords, which of the following
statements are true?
A. The view will allow the user to check it against the data dictionary
B. Prohibits changing rows not returned by the subquery in the view definition.
C. Prohibits DML actions without administrator CHECK approval
D. Allows for DELETES from other tables, including ones not listed in subquery
28. 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
32. Unlike tables, views contain no data of their own. True or False?
A. benar
B. Palsu
33. In order to query a database using a view, which of the following statements applies?
A. Use special VIEW SELECT keywords.
B. You can never see all the rows in the table through the view.
C. You can retrieve data from a view as you would from any table.
D. The tables you are selecting from can be empty, yet the view still returns the original data
from those tables.
34. You administer an Oracle database which contains a table named EMPLOYEES. Luke, a database
user, must create a report that includes the names and addresses of all employees. You do not want
to grant Luke access to the EMPLOYEES table because it contains sensitive data. Which of the
following actions should you perform first?
A. Create a report for him.
B. Create an index.
C. Create a subquery.
D. Create a view.
Section 16
35. Evaluate this CREATE SEQUENCE statement:
CREATE SEQUENCE line_item_id_seq INCREMENT BY -1;
36. When used in a CREATE SEQUENCE statement, which keyword specifies that a range of
sequence values will be preloaded into memory?
A. NOCYCLE
B. MEMORY
C. NOCACHE
D. LOAD
E. CACHE
37. Which statement would you use to remove the EMP_ID_SEQ sequence?
A. ALTER SEQUENCE emp_id_seq;
B. DELETE SEQUENCE emp_id_seq;
C. REMOVE SEQUENCE emp_id_seq;
D. DROP SEQUENCE emp_id_seq;
If the EMPLOYEES table is dropped, which indexes are automatically dropped at the same time?
A. EMP_ID only
B. JOB_ID only
C. DEPT_ID only
D. EMP_ID and JOB_ID
E. All Indexes
39. Barry creates a table named INVENTORY. Pam must be able to query the same table. Barry
wants to enable Pam to query the table without being required to specify the table's schema.
Which of the following should Barry create?
A. An index
B. A synonym
C. A schema
D. A view
40. Which of the following SQL statements will display the index name, table name, and the
uniqueness of the index for all indexes on the EMPLOYEES table?
A. SELECT index_name, table_name, uniqueness
FROM user_indexes
WHERE table_name = 'EMPLOYEES';
B. SELECT index_name, table_name, uniqueness
FROM user_indexes
WHERE index = EMPLOYEES;
C. SELECT index_name, table_name, uniqueness
FROM 'EMPLOYEES';
D. CREATE index_name, table_name, uniqueness
FROM user_indexes
WHERE table_name = 'EMPLOYEES';
Section 17
41. 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
42. Which of the following privileges must be assigned to a user account in order for that user to
connect to an Oracle database?
A. CREATE SESSION
B. ALTER SESSION
C. RESTRICTED SESSION
D. OPEN SESSION
43. REGULAR EXPRESSIONS does exactly the same as LIKE--no more and no less. (True or
False?)
A. benar
B. Palsu
44. REGULAR EXPRESSIONS can be used on CHAR, CLOB, and VARCHAR2 datatypes? (True or
False)
A. benar
B. Palsu
45. To take away a privilege from a user, you use which command?
A. ALTER
B. REMOVE
C. REVOKE
D. DELETE
46. What Oracle feature simplifies the process of granting and revoking privileges?
A. Role
B. Data dictionary
C. Object
D. Schema
47. Which keyword would you use to grant an object privilege to all database users?
A. ADMIN
B. ALL
C. PUBLIC
D. USERS
Section 18
48. COMMIT saves all outstanding data changes? True or False?
A. benar
B. Palsu
You want to retain all the employees with a salary of 15000; What statement would you execute
next?
A. ROLLBACK;
B. ROLLBACK TO SAVEPOINT upd1_done;
C. ROLLBACK TO SAVEPOINT upd2_done;
D. ROLLBACK TO SAVE upd1_done;
E. There is nothing you can do; either all changes must be rolled back, or none of them can be
rolled back.