Sie sind auf Seite 1von 101

SECTION 1 LESSON 1: Introduction to the Oracle Academy

Objectives
• Give examples of jobs, salaries, and opportunities that are possible by
participating in the Academy
• Explain how your participation in the Academy can help you take
advantage of these opportunities

Try It / Solve It

1. This activity aims to develop your skills for locating, evaluating, and
interpreting IT career information. Use Internet resources provided by your
teacher to identify a specific job that interests you in the IT career field. Then,
answer the following:

a. What are the typical tasks involved in this job?


b. What kind of social, problem-solving or technical skills are required?
c. What are the physical demands of the job?
d. What kind of training/education is required for the job?
e. Where are current job openings?
f. How many different kinds of businesses use these job skills?
g. What is the salary range?
h. What other entry-level jobs are within this career field?

2. Describe how taking one of the Academy courses and earning a certification
exam could help prepare you for a job in that career field.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners. 1
Section 1 Lesson 2: Data vs. Information
Objectives
• Distinguish between data and information, and provide examples of each
• Describe and give an example of how data becomes information

Vocabulary
Identify the vocabulary word for each definition below.

A collection of data arranged for ease and speed of


search and retrieval.
Raw material, from which you can draw conclusions

Knowledge, intelligence, a particular piece of data with


a special meaning or function

Try It / Solve It

1. List specific data that the school collects about each student. What information could
be gathered using all the student data?

2. Review an online database such as:


http://www.archives.gov
http://www.ellisislandimmigrants.org
http://newdeal.feri.org/index.htm
http://www.pro.gov.uk/
http://nationalarchives.nic.in/

a. Write examples of data and information related to the site you choose.

b. State why you believe data collections of this type could be important.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. Choose a website that displays data that might be stored in a database; find 10 data
items on the site and list 5 pieces of information that could be gleaned from the data.

4. Give examples of how data becomes information for these two industries:
• film/movie

• hospital/healthcare

5. Using this Lunch Room Data Report, answer the questions that follow.

Date Student Faculty/Staff Hamburger/Taco Pizza Bar Soup/Salad


Sales Sales Bar Bar
12/02/2003 497 23 335 122 63
12/03/2003 440 19 285 126 48
12/04/2003 447 30 301 126 50
12/05/2003 442 27 325 107 37
12/06/2003 330 12 229 83 30

a. What does this report mean?

b. What data was collected?

c. What information does this table provide from the data collected?

d. How do you think this information is used by those reading the report?

e. Generate at least two conclusions based on the data provided.

f. Generate at least two questions that you would ask about the data provided.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 1 Lesson 3: History of the Database
Objectives
• Describe the evolution of the database and give an example of its role in the
business world
• Name important historical contributions in database development and design
• List and explain the three steps in the database development process

Vocabulary
Identify the vocabulary word for each definition below.

A relational database chart that is used to map the


information from the entity relationship diagram
The unique identifier for each row of data

Links data in one table to the data in a second table by


referring to the PK column in the second table
Indicates if a column must contain a value

Indicates if the value in the column is unique within the table

Refers to the format and definition of the data in each


column

Try It / Solve It

1. Complete the diagram by listing the important events in the evolution of the database.
Draw a line from each event to the era in which it falls.

2. True or False: The Personal Digital Assistant (PDA) was an important historical
contribution in database development and design

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners. 1
3. Name two important historical contributions in database development and design.

4. If Building the database is the third major task in the database development process,
then what are the first two major tasks?

5. (Optional) List at least three timeline events in the evolution of the database.

6. (Optional) To most of us, the Internet has become an essential element in the way we
communicate, the way we do business, and the way we learn. Surprisingly, few people
really know the names of the people and the events that have contributed to its
phenomenal growth.

In this activity, you and your classmates will construct a wall mural timeline of the
major historical events in Internet history. Using Internet resources, your group will be
assigned one topic from the research list below. Your group's task is to gather
information to add to the classroom timeline:

Find at least four events that illustrate your topic. Each event must have a person,
place, and/or thing associated with it. Add your group's information to the timeline.

Research List:
• Historical thinkers: people without whose inventions computers and
communication as we know it today could not be possible
• Enablers: universities, government agencies, and businesses that contributed to
the idea of the Internet and birth of the Internet
• Communicators: people who developed computer languages, computer
networks, and the technology for one computer to communicate with another
• Innovators: people and businesses that enabled the average person to be able
to use a computer and communicate on the Internet
• Movers and shakers: people and companies that transformed the Internet into a
virtual mall of information and services

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners. 2
Section 1 Lesson 4: Major Transformations in Computing
Objectives
• List the major transformations in computing that have occurred since the
1970’s
• Define and give examples of these terms: hardware, operating system,
software
• Identify examples of e-businesses that use database software and explain
how it is essential to their success
• Explain the overall mission of the Oracle Corporation

Vocabulary
Identify the vocabulary word for each definition below.

The basic framework or features of a system

A global effort to develop an environment in which


individual users can access computers, databases, and
experimental facilities simply and transparently, without
having to consider where those facilities are located
The programs, routines, and symbolic languages that
control the functioning of the hardware and direct its
operation.
A computer and the associated physical equipment
directly involved in the performance of data-processing
or communications functions.
Software designed to control the hardware of a specific
data-processing system in order to allow users and
application programs to make use of it.
A software program which carries out specific tasks on
behalf of other computer users
A workstation or desktop computer including a screen,
keyboard, and mouse; communicates directly with the
user
A more powerful computer which accepts work
requests from clients, does the work, and sends results
back to the client

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Try It / Solve It

1. Provide a definition and an example of each of these:


a. Hardware

b. Operating system

c. Software

2. How has the major transformation of cell phones impacted day-to-day


activities of a service repair company – what can the service repair person do
today that they could not do before this transformation?

3. List three e-businesses that use database software and describe how the
database software is being used.

4. Write down the steps of a simple credit-card transaction. How many places
does the information go, and what happens if the transaction is not complete
at any one of the steps? What role does a database play in this process?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Section 2 Lesson 1: Conceptual and Physical Models
Objectives
• Describe the importance of describing information requirements
• Distinguish between a conceptual model and its physical implementation
• List five reasons for building a conceptual data model
• List examples of conceptual models and physical models

Vocabulary
Identify the vocabulary word for each definition below.

A design for an object (a car, a house, a database, etc.)


which includes implementation details such as size, volume,
weight, etc.
A data model, usually represented by an entity-relationship
diagram.
A collection of facts from which conclusions may be drawn.

The process of capturing the important concepts and rules


that shape a business and depicting them visually on a
conceptual model

Try It / Solve It

1. You will be working in pairs for this activity.

• One student describes his/her “dream house” while the other student
attempts to draw it.

You can discuss specific details, but the student describing the house is
not allowed to see what is being drawn until after time is called.

• After sharing your drawing, describe the importance of accurately


describing information requirements.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
2. Review the scenario below. Identify the conceptual model and the physical
model from the scenario.

Zoe was about to go into a store to purchase drinks for the birthday party
scheduled for that evening. Zoe knows that she needs drinks for 48
people and is expecting the store to accept a check for payment and to
provide her with some assistance carrying the product to her car. Zoe
wants to have carbonated drinks, non-carbonated drinks, and sugar free
drinks. She is expecting to purchase eight six-packs. Zoe enters the store
and discovers the entire drink distribution system is automated. She also
discovers that the drinks come in varying package sizes and that she must
choose the correct vending option for the products to be disbursed. Drinks
are packaged in four-packs, six-packs, and ten-packs.

3. Provide five reasons for creating a conceptual data model.

4. List two examples of conceptual models and physical models.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Section 2 Lesson 2: Entities, Instances, Attributes, and
Identifiers
Objectives
• Define and give an example of an entity
• Distinguish between an entity and an instance of an entity
• Name and describe attributes for a given entity
• Distinguish between an attribute and its value
• Distinguish between mandatory and optional attributes, and between
volatile and nonvolatile attributes
• Select and justify a unique identifier (UID) for an entity

Vocabulary
Identify the vocabulary word for each definition below.

Required

Incapable of being perceived by the senses

Any combination of attributes and/or relationships that


serves, in all cases, to uniquely identify an instance of an
entity
An occurrence or example of an entity

A characteristic; something that describes, quantifies, or


specifies an entity
Not required

A named thing or category of things that is significant to


the business and about which data must be known
A value that is unavailable, unassigned, unknown, or
empty; however, it is neither a zero nor a space
Highly changeable

Perceptible to the senses, especially the sense of touch

A classification identifying one of various types of data,


stating the possible values for that type, the operations
that can be done on that type, and the way the values of
that type are stored
Can only have one value at any point for each instance in
the entity

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Try It / Solve It

1. Consider the entity STUDENT. You are all students in a class. However,
each one of you is a unique instance of that entity. Your teacher will lead you
through an exercise to demonstrate this.

2. Think about the last time you went to get a haircut, permanent, manicure, or
other service from a barbershop or hair salon.

Discuss the business of a barbershop or hair salon. Name the entities that are
the “main things” about this business. Give examples of instances for each
entity.

3. The goal of this activity is to learn to make a distinction between an entity, an


attribute, and an instance of an entity. List which of the following concepts you
think is an entity, attribute, or instance. If you determine that one is an entity,
then give an example of an instance. If you determine that one is an attribute
or an instance, give a sample entity name. For the last three rows, find a
concept that fits.

Concept Entity? Attribute? Example instance or


Instance? Entity
Vehicle
Diet Cola
Price
Customer number
Green
Entity Cookie
Attribute Cookie
Instance Cookie

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
4. The goal of this practice is to recognize attributes for an entity.

The three entities that play a role in a DJ business: SONG, EVENT, and
CUSTOMER are listed as the first three column headings of the table below.
The fourth column contains a collection of attributes. Use a check mark to
indicate if the attribute listed could be an attribute for the entities listed. (For
example, could Title be an attribute for Song, for Event, and for Customer?)

SONG EVENT CUSTOMER


Title
Description
Venue
First Name
Phone Number
Release date
Last Name
Type
Email address

5. From the list of attributes provided, identify which attribute could be the
unique identifier of each entity.

Entity: STUDENT
Attributes: student id, first name, last name, address

Entity: MOVIE
Attributes: title, date released, producer, director

Entity: LOCKER
Attributes: size, location, number

6. Read the given business scenario and walk through the steps below.

“I’m the owner of a small movie rental store. We have over 3,000 movies
that we need to keep track of.

“Each of our movies has a DVD or VHS tape number. For each movie, we
need to know its title and category (e.g., comedy, suspense, drama,
action, war, or sci-fi).

“Yes, we do have multiple copies of many of our movies.

“We give each movie a specific ID, and then track which DVD or VHS
contains the movie. A movie can be either DVD or VHS format.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
“We always have at least one DVD or VHS tape for each movie we track,
and each DVD or VHS tape is always a copy of a single, specific movie.

“Our DVDs and VHS tapes are very long. We don’t have any movies that
require multiple DVDs or VHS tapes.”

a. Write a list of nouns used in the scenario.


b. Name each entity.
c. Is each instance of the entity uniquely identifiable? Which attribute or
attributes could serve as the unique attribute to identify the entity?

7. Identify the business rules contained in the following scenario.

“We are frequently asked for movies starring specific actors. John Wayne
and Julia Roberts are always popular. So we’d like to keep track of the
star actors appearing in each movie. Not all of our movies have star
actors. Customers like to know each actor’s “real” birth name and date of
birth. We track only actors who appear in the movies in our inventory.”

8. Identify the business rules contained in the following scenario.

“We have lots of customers. We rent videos only to people who have
joined our ‘video club.’ To belong to our club, they must have good credit.
For each club member, we’d like to keep their first and last name, current
phone number, and current address. And, of course, each club member
has a membership number.

“Then we need to keep track of what movie each customer currently has
checked out. A customer may check out multiple video tapes at any given
time. We just track current rentals. We don’t keep track of any rental
histories.”

9. Age is an example of what type of attribute?

10. Birth date is an example of what type of attribute?

11. Read the business scenario of a fast-food restaurant below:

We are a small fast food business. Our menu features food items that can
be ordered by a customer. A customer places an order at the counter and
indicates what food items he/she would like on that order.

Lately we've noticed that we have some regular customers, so we started


asking them for information -- such as name and address, so we can mail
them coupons when we have specials.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
a. Using the restaurant entities ORDER, FOOD ITEM, AND CUSTOMER,
identify the attributes for each entity.
b. Where possible, indicate whether the attribute is mandatory or optional.
c. Where possible, pick out the UIDs for each entity

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Section 2 Lesson 3: Entity Relationship Modeling and ERDs
Objectives
• Define the meaning of implementation-free as it relates to data models and
database design implementation
• List the four goals of entity relationship modeling
• Identify an entity relationship diagram (ERD)

Vocabulary
Identify the vocabulary word for each definition below.

Not dependent on the physical model.

A drawing that is used to represent a data model.

Try It / Solve It

1. True or False: To be described as implementation-free, a data model must be


changed to accommodate the database system onto which it is built.

2. True or False: To be described as implementation-free, a data model must not change


to accommodate the database system onto which it is built.

3. List four goals of entity relationship modeling.


4. An __________ is a consistent tool that can be used to represent data requirements


regardless of the type of database used.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 3 Lesson 1: Identifying Relationships
Objectives
• Interpret and describe relationship optionality
• Interpret and describe relationship cardinality
• Relate entities by applying the rules of cardinality and optionality

Vocabulary
Identify the vocabulary word for each definition below.

A property of an end of a relationship between X and Y that


describes how many of X is related to Y.
A connection or association between objects.

A property of an end of a relationship between X and Y that


describes whether X must be or may be related to Y.

Try It / Solve It

1. Read the given business scenario. Name the relationships between EMPLOYEE
and JOB. Include appropriate optionality and cardinality.

“We have a lot of employees who handle one or more different jobs. We’d like to
keep track of who is working on which job. Although employees can help each
other, a job is assigned to one employee and is the ultimate responsibility of that
employee. All of our employees have at least one job. However, jobs exist that
are not yet assigned to anyone.”

2. Read the given business scenario. Name the relationships between ORDER and
WAITER. Include the appropriate optionality and cardinality.

“We assign our waiters to certain areas, except for our trainees who just observe
and are not responsible for taking any orders yet. A waiter takes the orders for
the tables in his area. All areas have one assigned waiter. A customer places an
order with a waiter. If the customer has a question or wants to make a change to
the order, he needs to request this with the assigned waiter.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. Read the given business scenario. Name the relationships between PARENT
and CHILD. Include the appropriate optionality and cardinality.

“At the end of each day, parents need to pick up their children at our day-care
center. All children must be picked up by 6 p.m. A child may have two parents,
but we need only one of them to come and pick up the child. We cannot release
a child to anyone but that child’s parent.”

4. Read the given business scenario. Name the relationships between TEACHER
and STUDENT. Include the appropriate optionality and cardinality.

“Some students request remedial help in certain subjects, such as math. We can
assign a tutor who can work with the student after class. Some of our teachers
agree to be tutors. If several students need tutoring in one subject, then we
assign them to the same teacher. If a student needs tutoring in several subjects,
then he will probably be assigned to several different tutors.”

5. Draw two entities that you are familiar with from your own experience (use
colored pens and markers on hand). Write down the relationships between these
two entities, including cardinality and optionality. Share your entities with the
class.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 3 Lesson 2: ER Diagramming Conventions
Objectives
• Construct ER diagram components that represent entities and attributes according
to diagramming conventions

Vocabulary
Identify the vocabulary word for the definition below.

A four-sided visual element with rounded corners, used to


represent an entity in an ERD.

Try It / Solve It

1. Read the given business scenario. Draw the entities HAIRSTYLIST and CLIENT. List
the attributes associated with each entity and specify whether they are mandatory or
optional. Identify the UIDs. Write out the relationship in English, including optionality
and cardinality. Follow the diagramming conventions discussed.

“In our salon, we have a number of hairstylists. They are all salaried employees, so
we keep a record of their first name, last name, address, phone number, social-
security number, and salary. During the course of a day, a hairstylist may see
several clients. On a slow day, a hairstylist may not work on anyone at all. We have
several walk-in clients, and they each get assigned to one hairstylist. We just ask
for their first name. We also have customers who call to make an appointment.
When they do this, we ask for their first name, last name, and phone number. We
also ask if they would like a specific hairstylist. If they have no preference, we
assign one for them. Of course, they are allowed to switch to another hairstylist for
their next visit to the salon. We are interested in tracking the daily appointments --
which stylist works on which client during a given day.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Read the given business scenario. Draw the entities BAND and MUSICIAN. List the
attributes underneath each entity. Specify whether they are mandatory or optional.
Identify the UIDs. Write out the relationship in English, including optionality and
cardinality.

“I am an agent for several musicians and bands. A musician may be a solo


performer or may belong to a band. A band will always have one or more musicians
in it. Some musicians are a one-man band. However, a musician can belong to only
one band. Since I schedule them for concerts and events, I need to keep track of
certain information: the musician’s first name, last name, address, phone number,
and hourly rate. If it’s a band, I need to know the band name in addition to the
information I already keep for the member musicians. I’ve handled bands with the
same name, so just to make sure I book the right band, I assign an ID to each one.
The hourly rate for a band is the total of the hourly rates of its members.”

3. Read the given business scenario. Draw the entities TEACHER and COURSE and
CLASS. List the attributes underneath each entity. Specify whether they are mandatory
or optional. Identify the UIDs. Write out the relationship in English, including optionality
and cardinality.

“We have several teachers at our school. A teacher can be assigned up to three
classes per semester. If a teacher is on sabbatical, he doesn’t teach that semester.
We keep a record of the teacher’s first name, last name, address, phone number,
and email address.”

“Our school offers many courses -- such as Data Modeling, Introduction to SQL,
Trigonometry, Physics, and Biology. Each course has a code. For example: Data
Modeling would be DM001, Trigonometry would be TR004, etc. During each
semester, a course may be taught in several classes -- so there could be two
classes of Physics, three classes of Biology, etc. Each class can be taught by only
one teacher. We assign a unique ID for each class, and we also keep track of the
day it is taught, the time, and the classroom.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 3 Lesson 3: Speaking ERDish and Drawing Relationships
Objectives
• State relationships between entities in precise words (ERDish)
• Draw and label relationships correctly on an ERD

Vocabulary
Identify the vocabulary word for the definition below.

The language or statements used to describe relationships


between entities in an entity-relationship diagram.

Try It / Solve It

1. The goal of this practice is to read a relationship. Which text corresponds to the diagram?

a. Each EMPLOYEE may be assigned to one or more DEPARTMENTs.


Each DEPARTMENT must be responsible for one or more EMPLOYEEs.

b. Each EMPLOYEE must be assigned to one and only one DEPARTMENT.


Each DEPARTMENT must be responsible for one or more EMPLOYEEs.

c. Each EMPLOYEE must be assigned to exactly one DEPARTMENT.


Each DEPARTMENT may be responsible for exactly one EMPLOYEE.

2. In the diagram for #1 identify the symbols for cardinality.

3. In the diagram for #1 identify the symbols for optionality.

4. Read the relationship in the diagram below. Write the ERD statement for the relationship.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
5. Read each relationship in the model below. For each relationship, write the ERD
statement and your comments. Use your knowledge of normal people and towns in your
comments.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 3 Lesson 4: Matrix Diagrams
Objectives
• Identify relationships using a matrix diagram
• Draw an ERD from a matrix diagram

Vocabulary
Identify the vocabulary word for the definition below.

A grid-like drawing that can be used to discover and record


relationships between entities in an entity- relationship model

Try It / Solve It

1. Read the business scenario and review the ERD. Using the matrix diagram, make up two
or more possible relationships between PHOTOGRAPH and the other entities that make
sense for the business.

“I’m an amateur photographer. I own several cameras and am always taking pictures
of different subjects. I’m trying to keep track of which camera and type of film perform
best under certain conditions—indoor light, outdoor light, etc.—so when I have my
films developed, I note down which camera I used. When the pictures come back, I
note the subject and conditions. Each picture always features one subject. A subject
could be a view, a person or group of persons, or an object or group of objects.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
CAMERA PHOTOGRAPH SUBJECT

CAMERA

PHOTOGRAPH

SUBJECT

Two possible relationships are:

2. Complete the matrix diagram below, and construct an ERD from it.

Runner City For Race Type Running


Race Event
Runner

City For
Race
Race Type

Running
Event

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Section 4 Lesson 1: Supertypes and Subtypes
Objectives
• Define and give an example of a subtype
• Define and give an example of a supertype
• State the rules relating to entities and subtypes; give examples of each
• Apply the rules of supertype and subtype by evaluating the accuracy of ER diagrams
that represent them
• Apply the rules of supertype and subtype and include them in a diagram when
appropriate

Vocabulary
Identify the vocabulary word for each definition below.

All subtypes are listed without omission.

A means of classifying an entity that has subtypes.

Something an entity may be split into based on common


attributes and/or relationships.
Each instance of a supertype is an instance of only one possible
subtype.

Try It / Solve It

1. Identify the supertype and the subtypes of the entity listed below.

Amputation = _____________________
Visual Impairment = _____________________
Hearing Impairment = _____________________
Disability = _____________________
Paralysis = _____________________

2. For each rule, indicate whether the rule is applicable to supertypes or subtypes.

__________ They share common attributes


__________ They inherit all attributes and relationships of the entity
__________ It never exists alone
__________ It contains the attributes held in common by all instances

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
3. Name three things you consider when modeling supertypes and subtypes.

4. Find the incorrect subtypes in the illustration. Explain why you think the subtype is
incorrect. Adjust the model to improve it.

5. Read the following scenario and construct an ERD that contains at least two subtypes of
the entity PRODUCT. Show clearly which attributes belong to the entity supertype, and
which belong to the subtypes. Identify a UID for the entity.

“Our shops sell several kinds of women’s clothing, including dresses, skirts and
blouses. Of course each product has a name, a description, and a price. Oh, and
sizes too: all products have a waist size. Dresses and skirts have a hem length but
blouses don’t. Dresses and blouses have a chest size, but skirts don’t.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Section 4 Lesson 2: Documenting Business Rules
Objectives
• Define and compose a structural business rule
• Define and compose a procedural business rule
• Recognize that some business rules will require programming
• Diagram business rules when they can be represented in an ER model

Vocabulary
Identify the vocabulary word for each definition below.

A type of business rule that indicates the types of information to


be stored and how the information elements interrelate.
A formalized statement of the usual, customary, or generalized
course of action or behavior for a business.
A type of business rule that is workflow or business process
related. (e.g., A has to happen before B, and then C has to
happen at the same time as D.) This is also called a process
business rule.

Try It / Solve It

1. Members of your design team have been working with the local hospital to develop a data
model for their need to store information about patients, the patient's room number, the
patient's doctor, drug prescriptions given, and specific drug information.

However, they all went on vacation and left you to figure out the model. They also failed to
give you any of their documentation other than the entities and attributes illustrated here.
Instead of going back to the hospital, which could reflect poorly on your company, you’re
going to have to think about everything you know about hospitals!

Your task is to generate a list of business rules you think were used to arrive at the
information shown here. Use your imagination. List 10 structural rules, 5 procedural rules,
and 2 programmatic rules (rules to be addressed by computer applications in the future).
State each rule as a single sentence.

Based on your set of business rules, draw the ERD.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Section 5 Lesson 1: Relationship Transferability
Objectives
• Describe and give an example of relationship transferability
• Understand the difference between transferable and nontransferable relationships
• Illustrate nontransferable relationships on ERDs

Vocabulary
Identify the vocabulary word for each definition below.

Description of a relationship where an instance of A is related to


an instance of B, and the association can be moved to another
instance of B.
Description of a relationship where an instance of A is related to
an instance of B, and the association cannot be moved to another
instance of B

Try It / Solve It

1. Draw ERDs for each of the following. Draw softboxes, relationship lines, and labels for
each relationship in both directions. Indicate non-transferability when appropriate.

a. Each town may be the birthplace of many people. Each person must be born in one
and only one town.

b. Each room may house one or more guests. Each guest may stay in one and only one
room.

c. Each employee must work for one and only one department. Each department may
have one or more employees.

d. Each hotel may be the host of one or more guests. Each guest may be hosted in one
or more hotels.

e. Each message must be addressed to one or more persons. Each person may be the
addressee of one or more messages.

f. Each garment must have one and only one price. Each price may be for one or more
garments.

g. Each airline coupon must be used for one and only one destination. Each destination
may be visited with one or more coupons.

h. Each automobile must use one and only one tire size. Each tire size may be used by
one or more automobiles.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
i. Each child must have one and only one mother. Each mother must be the parent of
one or more children.

j. Each person must be of one and only one blood type. Each blood type may classify
one or more persons.

k. A person may be on one or more junk-mail lists. Each junk list may contain one or
more persons.

l. Each student may learn from one or more teachers. Each teacher may educate one or
more students.

m. Each school may be attended by one or more honor students. Each honor student
must attend one and only one school.

n. Each fingerprint must belong to one and only one person. Each person must have one
and only one fingerprint.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 5 Lesson 2: Relationship Types
Objectives
• Recognize and give examples of a one-to-one relationship
• Recognize and give examples of a one-to-many relationship
• Recognize and give examples of a many-to-many relationship
• Recognize redundant relationships and remove them from the ERD

Vocabulary
Identify the vocabulary word for each definition below.

A relationship where each record in Table A can be related to


one, and only one, record in Table B, and each record in Table B
relates to one, and only one, record in Table A.
A relationship where a single record in Table A can be related to
one or more records in Table B, but a single record in Table B
can only be related to one record in Table A.
A relationship in which many records in one table match many
records in another table
Unnecessarily repetitive

Try It / Solve It

1. Identify the relationship types of the statements below

Type Statement
A snowboard instructor may instruct one or more
snowboarders
A bicycle may be owned by a child
Classroom crayons may be used by students in a classroom
A passport belongs to a person
A female elephant gives birth to an elephant

2. Provide two examples for each relationship type.

Relationship Type Example


One-to-one
One-to-one
One-to-many
One-to-many
Many-to-many
Many-to-many

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. Draw an entity relationship diagram to represent the following:

a. Each CLUB must be assigned to one and only one DEPARTMENT


b. Each DEPARTMENT may be responsible for one or more CLUBs
c. Each STUDENT may join one or more CLUBs
d. Each CLUB may be composed of one or more STUDENTs

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 5 Lesson 3: Resolving Many-to-Many Relationships
Objectives
• Identify attributes which belong to many-to-many relationships
• Demonstrate the steps to resolve a many-to-many relationship using an intersection
entity
• Identify the UID of an intersection entity and represent it in the entity relationship
diagram

Vocabulary
Identify the vocabulary word for each definition below.

A relationship that participates in an entity's unique identifier.

The product of the resolution of a many to many relationship.

Try It / Solve It

1. Resolve the M:M between TEACHER and CLASS as well as INTERPRETER and
LANGUAGE. For each intersection entity, think of additional attributes like a UID.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 5 Lesson 4: Understanding CRUD Requirements
Objectives
• Create ER models that reflect all business rules gathered during the interview process
• Identify the create, retrieve, update, and delete (CRUD) requirements of the business
• Validate your ER model by performing a CRUD analysis

Vocabulary
Part One: Define the vocabulary words below.

1. Consultant
2. Functions
3. Obsolete
4. CRUD analysis

One who gives expert or professional advice

The practice of checking a data model for create, retrieve, update


and delete functions that the business requires
Used to perform calculations on data, modify individual data items,
manipulate output for groups of rows, format dates and numbers
for display, convert column datatypes.
No longer in use

Part Two: Based on the lecture, list the tasks that will apply to the parts of CRUD analysis.
(Examples: bring up, find, modify, read, etc.)

1. Create
2. Retrieve
3. Update
4. Delete

Alter
Bring up
Change
Discard
Enter
Find
Import
Input
Load
Look up
Modify
Print
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Purge
Read
Record
Remove
Report
Trash
View

Try It / Solve It

1. Relate CRUD analysis to a school enrollment environment. Consider the data or


information used in a school and identify at least one example for each CRUD function.
a. Create:

b. Retrieve:

c. Update:

d. Delete:

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 6 Lesson 1: Artificial, Composite, and Secondary UIDs
Objectives
• Define the different types of unique identifiers (UIDs)
• Define a candidate UID and explain why an entity can sometimes have more than one
candidate UID
• Analyze business rules and choose the most suitable primary UID from the candidates
• Recognize and discuss the issues of identification in the real world

Vocabulary
Identify the vocabulary word for each definition below.

Unique identifier

A UID that is a single attribute

A UID that is a combination of attributes

A UID that does not occur in the natural world but is created for
identification purposes in a system
One of several UIDs that could identify something

A candidate UID that is the primary identifier of something

A candidate UID that also identifies something, but is not the


primary UID

Try It / Solve It

1. Match the type of Unique Identifier to the entity.


a. Simple UID
b. Composite UID
c. Composite UID comprising an attribute and a relationship
d. Primary Key & Secondary Key

_____ _____ _____ ____

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Consider an entity for Library Member. Sometimes an entity can have more than one
candidate UID. Describe a scenario where you would want more than one candidate UID
for a Library Member – why would you want to find the member in the database using
alternative information?

3. Describe how you would identify the entities listed below, making up any attributes and
relationships you consider appropriate. For example, for the Student entity you may say
that the UID is comprised of the first name, last name, and address. Or you might suggest
that the Student entity contains an artificial UID called student number.

a. A city
b. A contact person for a customer
c. A train
d. A road
e. A financial transaction (for example: transfer funds)
f. An award (for example: movies)
g. A painting

4. Identify one of the issues with respect to a national identification system. Provide your
point of view on the issue.

5. You have previously reviewed the video store business requirements stated below:

“I’m the owner of a small video store. We have over 3,000 DVDs that we need to keep
track of.

“Each of our DVDs has a disk number. For each movie, we need to know its title and
category (e.g., comedy, suspense, drama, action, war, or sci-fi). Yes, we do have
multiple copies of many of our movies. We give each movie a specific ID, and then we
track which movie a disk contains. A disk may be either High Definition (HD) or
BlueRay format. We always have at least one disk for each movie we track, and each
disk is always a copy of a single, specific movie. Our disks are very big, although we
don’t have any movies that require multiple disks.”

For this activity read the new business requirements below and resolve the M:M
relationship. Identify UIDs for all the entities that require multiple tapes.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
“We are frequently asked for movies starring specific actors. John Wayne and
Katherine Hepburn are always popular. So we’d like to keep track of the star actors
appearing in each movie. Not all of our movies have star actors. Customers like to
know each actor’s “real” birth name and date of birth. We track only actors who appear
in the movies in our inventory.

“We have lots of customers. We only rent DVDs to people who have joined our DVD
club. To belong to our club, they must have good credit. For each club member, we’d
like to keep the first and last name, current phone number, and current address. And,
of course, each club member has a membership number.

“Then we need to keep track of what DVDs each customer currently has checked out.
A customer may check out multiple DVDs at any given time. We just track current
rentals. We don’t keep track of any rental histories.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 6 Lesson 2: Normalization and First Normal Form
Objectives
• Define the purpose of normalization in database models
• Define the rule of First Normal Form in the normalization process
• Determine if an entity conforms to the rule of First Normal Form
• Convert an entity to First Normal Form if needed

Vocabulary
Identify the vocabulary word for each definition below.

The outcome of the first step of database normalization. 1NF


eliminates repeating groups by putting each into a separate table
and connecting them with a 1:M relationship
A series of steps followed to obtain a database design that allows
for efficient access and storage of data in a relational database.
These steps reduce data redundancy and the chances of data
becoming inconsistent.

Try It / Solve It

1. When checking a database model for first normal form, what are you doing exactly?

2. What is the rule of 1NF in the normalization process?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. Check to see if each ERD is in 1NF. If not, make the necessary changes to correct it.

a.

b.

c.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 6 Lesson 3: Second Normal Form
Objectives
• Define the rule of Second Normal Form in the normalization process
• Examine a nonnormalized entity and determine which rule, or rules of normalization
are being violated.
• Apply the rule of Second Normal Form to resolve a violation in the model

Vocabulary
Identify the vocabulary word for the definition below.

The outcome of the second step of database normalization

Try It / Solve It

1. The UID of a library book includes its BOOK number and SHELF number. Does this ERD
follow the rules of Second Normal Form? If you spot a violation, correct it.

2. Class Enrollment is the intersection entity that resolves the M:M between STUDENT and
CLASS. Does the ERD follow the rules of Second Normal Form? If you spot a violation,
correct it.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. A store can be located in several shopping malls, and a shopping mall may house several
stores. To locate a particular store in a specific neighborhood, you will need to know the
name and address of the nearby shopping mall, plus the name of the store. Does the
ERD follow the rules of Second Normal Form? If you spot a violation, correct it.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 6 Lesson 4: Third Normal Form
Objectives
• Identify transitive dependencies in a data model
• Define the rule of Third Normal Form in the normalization process
• Examine a non-normalized entity and determine which rule, or rules of normalization
are being violated
• Apply the rule of Third Normal Form to resolve a violation in the model

Vocabulary
Identify the vocabulary word for each definition below.

The form of database normalization where all non-key fields are


dependent on the key, the whole key, and nothing but the key.
A condition that exists when any attribute in an entity is
dependent upon any other non-UID attribute in that entity.

Try It / Solve It

1. Identify the transitive dependency in the model below. State which attributes violate Third
Normal Form.

2. Define the rule of Third Normal Form.

3. A color scheme for a car includes specifications for paint color for the body and the
interior colors and materials. For example: The “Desert” color scheme includes silver paint
and gray leather interior; the “Sunburst” color scheme includes gold paint and cream
leather interior. Does the model below follow the rules of Third Normal Form? If you spot
a violation, correct it.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
4. Assume the following business rules:

An athlete employs one agent.


An agent may work for one or more athletes.
An athlete may play for one team.
A team may have one or more players

Does the model below contain one or more transitive dependencies? Identify the
attributes involved in the transitive dependencies.

5. Now that you have an idea of what makes a good UID, you need to be aware of the
controversy, benefits, and difficulty of uniquely identifying someone. Consider the idea of
a national ID card. What kinds of problems would the card create and what kinds of
problems would it solve? If your country already uses a national ID card, what are the
benefits and issues associated with this? In your opinion, could DNA mapping become
the national ID card? Why or why not?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 7 Lesson 1: Arcs
Objectives
• Define the term “constraint” as it applies to data modeling
• Identify an exclusive OR relationship in a business scenario
• Diagram an arc constraint to represent an exclusive OR relationship
• Distinguish between the use of an arc and a subtype in the data model

Vocabulary
Identify the vocabulary word for each definition below.

A curved line used to represent an exclusive relationship in an


entity-relationship diagram
A logical operator that returns a true value if one, but not both, of
its operands is true.
A relationship between one entity and two (or more) other entities
when only one of the relationships can exist at a time.
A restriction that applies to data, which is often dictated by the
business rules.

Try It / Solve It

1. A show ticket is purchased from an agent, the box office, or the Internet. A ticket has a
description, an event, a date and a price. An agent has a name and a phone number. The
box office has an address and a phone number. The Internet has a URL address.

Draw the entities and represent the mutually exclusive relationship.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Draw the MENU entity as a supertype of the PROMOTIONAL, REGULAR, and OTHER
entities. The UID of MENU is code. MENU is related to FOOD ITEM through this
relationship: each MENU may contain one or more FOOD ITEMs, and each FOOD ITEM
must be listed on one and only one MENU. The UID of FOOD ITEM is a barred UID using
its attribute “number”. Add appropriate attributes to the other entities and be ready to
defend your choices.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 7 Lesson 2: Hierarchies and Recursive Relationships
Objectives
• Define and give an example of a hierarchical relationship
• Identify the UIDs in a hierarchical model
• Define and give an example of a recursive relationship
• Represent a recursive relationship in an ERD given a scenario
• Construct a model using both recursion and hierarchies to express the same
conceptual meaning

Vocabulary
Identify the vocabulary word for each definition below.

A relationship between an entity and itself.

A series of relationships that reflect entities organized into


successive levels.

Try It / Solve It

1. Develop two ER diagrams to represent the following situation. Develop one using a
hierarchical structure and one using a recursive structure.

“Our company sells products throughout the United States. So we’ve divided the U.S.
into four major sales regions: the Northern, Eastern, Southern, and Western regions.
Each sales region has a unique region code. Each sales region is then divided into
sales districts. For example, the Western region is divided into the Rocky Mountain,
Northwest, Pacific Coast, and Pacific districts. Each district has a unique district code.
Each district is made up of sales territories. The Rocky Mountain district is composed
of three territories: Wyoming-Montana, Colorado, and Utah-New Mexico. The
Northwest district is made up of two territories: the Washington and Oregon-Idaho
territories. The Pacific Coast district is composed of two territories: the California and
Nevada territories. The Pacific District includes the Hawaii territory and the Alaska
territory. Each territory has a unique territory code.

Then each sales territory is broken down into sales areas. For example, Colorado is
made up of two sales areas: the Front Range and the Western Slope sales areas.
Each sales area has a unique sales-area code.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Each salesperson is responsible for one or more sales areas and has a specific sales
quota. We also have sales managers who are responsible for one or more sales
districts, and sales directors who are responsible for one or more sales regions. Each
sales manager is responsible for the territories with his/her districts. We don’t overlap
our employees’ responsibilities. Each sales area is always the responsibility of a single
salesperson, and our managers' and directors' responsibilities don’t overlap.
Sometimes our salespersons, managers, and directors will have special assignments
and will not be responsible for sales. We identify all our sales personnel by their
employee IDs.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 7 Lesson 3: Modeling Historical Data
Objectives
• Identify the need to track data that changes over time
• Construct ERD models that incorporate elements of “data over time”
• Identify the UID of an entity that stores historical data; explain and justify the choice of
UID
• Construct a conceptual model based on a given scenario
• Apply the rules of entity-relationship diagramming to create an ERD that reflects the
business rules
• Present and interpret the data model to an audience
• Compose written documentation to accompany the oral presentation and an ERD

Try It / Solve It

1. In the scenario below, what words or phrases indicate to you the need to track data that
changes over time?

Actors at the local theater sign contracts that specify their pay and working conditions.
These contracts are renewed annually. Each year the contracts may change through new
language and pay rates. In order to resolve labor disputes, the theater must sometimes go
back several years in order to see the contract provisions in place on a particular date.

2. Given the scenario below, construct a conceptual model.

The Seville, Spain soccer association is renovating their soccer arena. They are adding
luxury boxes that will be offered to companies. These boxes contain varying numbers of
seats. Each box is assigned a section number and level. The boxes are leased by the
year, and the prices are set individually according to the location and number of seats in
the box. The soccer association needs to keep track of the company name, address,
phone, and contact person. Sometimes the companies also provide a logo. Companies
that lease a box have the right to renew their leases each year, but they often do not.
When a lease for a box opens up, the association contacts companies that previously
held leases to see if they want to lease one again.

3. Modify the Video Store ER model below to accommodate the following additional
requirements:

“You know, we really need to keep a history of all our rentals. Each time a customer
rents a DVD, we would like to keep the rental date/time and the return date/time. All
our DVDs are due back the next day, so we don’t need to keep a due date. Keeping
this rental history will allow us to analyze the pattern of our rentals. We will be able to
determine how many DVDs each customer rents and how many times a customer has
returned a DVD late. We will also know how many times a particular DVD has been
used and will then know when to retire each DVD. We will also be able to analyze our
customers’ movie preferences.”
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
4. Read through the IOUG Case Study listed below. As a group develop an ER diagram for
the situation. Be sure to tag each attribute with its optionality. Each group will be given 10
minutes to present its solution in the next Section. You will be required to prepare each of
the following:

• Statement of the problem: Why has the IOUG approached you? What help do they
need?
• Statement of the proposed solution: How can you help them solve their problem?
What are your recommendations?
• The information requirements of the business/organization clearly stated: What data
do they need to track and what information do they need to get out of the data?
• The business rules as they apply to the information requirements of the
company/organization stated as single sentences: What business rules can you
formulate from the given scenario?
• The assumptions clearly stated that had to be considered in developing the solution:
What assumptions did you have to make in developing your solution?
• Entity relationship model
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
IOUG CASE STUDY
Our regional Oracle User’s Group has grown to include over 200 members.
We’re an all-volunteer organization of working adults and secondary-school
students, and our records are a mess. We need an information system to help
us keep track of our business.
We definitely need to automate our membership records. For each member, we
need to keep the member’s name, title, mailing address, office or home phone
number, type of membership (individual or corporate), and whether or not the
member has paid the dues (is the member “current”?). We collect dues on a
yearly basis, and they are due in January.

We also like to know which company a member works for or which school he
attends, but keeping this information current is difficult because our members
are always changing companies or addresses or graduating from school. We
track only the current employer for each member. Our members come from
many different companies, including Sony, EG&G, and Storage Tech, as well
as several different local high schools. A few of our members are unemployed.
For each company, we keep the company name, address, and type of
business. For each secondary school, we keep the school name and address.
We have a standard set of types of businesses and high-school codes. We
keep only the main company address for each company.

We hold various events during the year, and we’d like to track information about
each event. Some of our annual events include the September Meeting, the
November Meeting, the annual Training Day in January, and our April Meeting.
We also hold special events each year.

For example, we held a special CASE (Computer Aided Systems Engineering)


day last May, and Richard Barker from Oracle U.K. came and spoke. We hold
our events at several different locations around town, including AT&T, Redrocks
Community College, and Skyline University. We’d like to track each event’s
date, optional description of the event, number of attendees, where it was held,
how much money we spent on it, and any comments on the event. We treat all
comments as if they came from an anonymous submitter. A set of comments is
a free-form text statement of any length. We number each set of comments,
and we frequently get multiple sets of comments for an event.

We also track which members attended which events. Some of our members
are really active, and others attend very infrequently or just enjoy receiving our
newsletter.

We also need to track what type of computer platforms our members are using.
We have a unique, three-digit system identification tag for each type of platform.
For example, 001 is for UNIX; 002 is for RAC & HA; 003 is for Oracle on
Windows; 020 is for Oracle Spatial; 030 is for Oracle & .NET; 050 is for DBMS;
and 080 is for Business Intelligence & Reporting Tools.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
We also like to track which application areas each member is interested in.
Sample application areas include accounting, human resources, entertainment,
oil and gas, pharmaceuticals, and health systems. The applications should be
portable, so we don’t need to know which platforms they run on.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 8 Lesson 1: Presentation of the ERD to the Client
Objectives
• Share and translate the ER model with the client in an engaging way
• Use non-technical terms when describing the ER model to the client
• Document design revisions requested by the client

Vocabulary
Identify the vocabulary word for each definition below.

One who gives expert or professional advice

The party for which professional services are rendered.

Part Two: Identify which step of the interview process each action is associated with.
(Preparation, interview, end of interview, follow-up)

1. Ask for clarification

2. Determine and gather materials needed

3. Look for missing information

4. Prepare a question list

5. Review notes

6. Set goals

7. Summarize key points

8. Take notes

9. Thank the interviewee

Try It / Solve It

1. Produce a format you could use to document design revisions uncovered during a
presentation. Detail what would be included in each section of the document.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 9 Lesson 1: Modeling Change: Time
Objectives
• Distinguish between using date as an attribute and DAY as an entity in a data model,
depending on business requirements
• Solve the problem of keeping characteristics of a date by constructing a model that
uses DAY as an entity
• Identify at least three time-related constraints that can result from a time-sensitive
model
• Define and give an example of conditional non-transferability in a time-constrained
model

Vocabulary
Identify the vocabulary word for each definition below.

A constraint or data restriction that results from the time


dimension.
Refers to a relationship that may or may not be transferable,
depending on time.
Property of a relationship where an instance of A is related to an
instance of B, and the association cannot be moved to another
instance of B

Try It / Solve It

1. Speeding Tickets

Each police officer may issue speeding tickets to motorists in an assigned area. Originally,
the attribute date was modeled as part of the SPEEDING TICKET entity. However, the
city police department wants to see if there is a relationship between weather and the
frequency of speeding tickets -- do people drive faster on nice sunny days? Are there
more tickets in hot weather or cool weather?

Modify the ERD to address this new requirement.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Examine the ERD that represents classroom assignments for different exams.

a. Why is start time part of the UID of ASSIGNMENT?


b. Name at least three time-related constraints. For example: End time must be later than
start time. Indicate if the constraint represents conditional non-transferability.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 9 Lesson 2: Modeling Change: Price
Objectives
• Solve the business requirement of tracking changes in price or values by constructing
a model that uses a historical entity
• Describe the meaning of journaling/logging
• Identify the business need for journaling/logging and construct a model that addresses
this requirement

Vocabulary
Identify the vocabulary word for each definition below.

Keeping an on-going record of transactions.

A rise in value or price, especially over time

A decrease or loss in value, because of age, wear, or market


conditions.

Try It / Solve It

1. Comic-book collectors need to know the price history of different types of comics. This
helps them decide what to purchase/collect and how much to sell their collection for.

Create an ERD (two or three entities) to model this.

2. When a student’s grade is changed, we need to record information on the teacher who
changed the grade and the reason for the change.

Start with the ENROLLMENT entity, which is the resolution of the M:M between
STUDENT and CLASS.

3. (Optional) When vintage-car aficionados shop for additions to their collections, it helps to
know the price history of the cars they are interested in. It may also make them consider
selling one of their cars if it has greatly increased in value since they bought it.

Create an ERD (at least two entities) to model this.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 9 Lesson 3: Adding the Time Element to an ERD
Objectives
• Successfully apply the rule of using DATE as an entity
• Modify the animal-shelter ERD to accommodate new design requirements
• Identify and design possible reports that can be produced from the data; explain
how the information from these reports could be useful to the business

Try It / Solve It

1. Examine the following table, and answer the following questions:

CONTAINER
ID LOCATION CONTENTS DESTINATION DEPARTURE ARRIVAL
32215 Singapore fabric Hong Kong 23-Mar-2006 28-Mar-2006
21187 Seattle lumber Taiwan 18-Apr-2006 02-May-2006
11007 Los Angeles medical Cape Town 23-Mar-2006 18-Apr-2006
32200 Singapore lumber Barcelona 23-May-2006 02-Jun-2006
21187 Taiwan fireworks Seattle 01-May-2006
11007 Cape Town food Barcelona 18-Jul-2006

a. List 2 ways this data could be used to provide useful information to the shipping
company (2 reports that could be made using the data)

b. Based on the business rules inferred from the table, identify one piece of data that
must be in error.

c. Based on this data, how many containers were in transit on April 10th?

d. Where was container 32200 on June 1, 2006?

e. Assuming no gaps in the data, where was container 11007 on July 1, 2006?

f. What were the contents of container 11007 on April 1, 2006?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 10 Lesson 1: Drawing Conventions for Readability
Objectives
• Apply the Oracle drawing conventions to a data-model diagram
• Identify high-volume entities in a data-model diagram and explain their significance to
the business
• Redraw a given data-model diagram to increase clarity and readability
• Recognize the usefulness of dividing a complex ERD into a number of functional sub-
diagrams

Vocabulary
Identify the vocabulary word for each definition below.

Space on a page or poster not covered by print or graphic matter.

An entity that will have a large number of instances.

Try It / Solve It

1. Create an ERD based on the following Summit Sporting Goods scenario. Be sure to
follow drawing conventions for readability and clarity.

“I’m a manager of a sporting-goods wholesale company that operates worldwide to fill


orders from retail sporting-goods stores. The stores are our customers (some of our
people prefer to call them our clients). Right now we have 15 customers worldwide,
but we’re trying to expand our customer base by about 10% each year starting this
year. Our two biggest customers are Big John’s Sports Emporium in San Francisco
and Womansports in Seattle. For each customer, we must track an ID and a name.

We may track an address (including the city, state, zip code, and country) and phone
number. We maintain warehouses in different regions to best fill the orders of our
customers. For each order, we must track an ID. We may track the date ordered, date
shipped, and payment type when the information is available.”

2. Add on to the Summit Sporting Goods ERD.

“Right now we have the world divided into five regions: North America, South America,
Africa/Middle East, Asia, and Europe. That’s all we track; just the ID and name. We try
to assign each customer to a region so we’ll generally know the best location from
which to fill each order. Each warehouse must have an ID. We may track an address
(including the city, state, zip code, and country) and phone number. We currently have
only one warehouse per region, but we’re hoping to have more soon.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
I manage the order-entry functions for our wholesale sporting-goods business. My
department is responsible for placing and tracking the orders when our customers call.
For each department, we must track the ID and name. Sometimes, our customers just
mail us the orders when they are not in a rush, but most often they call us or fax us an
order. We are hoping to expand our business by providing immediate turnaround of
order information to our clients. Do you think we can put this application on the Web?”

3. (Optional) Add on to the Summit Sporting Goods ERD.

“We can promise to ship by the next day as long as the goods are in stock (or
inventory) at one of our warehouse locations. When the information is available, we
track the amount in stock, the reorder point, maximum stock, a reason as to why we
are out of stock, and the date we restocked the item. When the goods are shipped, we
fax the shipping information automatically through our shipping system. No, I don’t
manage that area. My department just ensures that our customers have the correct
billing information and verifies that their accounts are in good credit standing. We also
record general comments about a customer.

We do make sure that all the items they have requested are in stock. For each item,
we track an ID. We may also track the item price, quantity, and quantity shipped if the
information is available. If they are in stock, we want to process the order and tell our
clients what the order ID is and how much their order total is. If the goods are not in
stock, the customer tells us whether we should hold the order for a full shipment or
process the partial order.”

4. (Optional) Add on to the Summit Sporting Goods ERD.

“The accounting department is responsible for maintaining the customer information,


especially for assigning new customer IDs. My department is allowed to update the
customer information only when an order is placed and the billing or ship-to address
has changed. No, we are not responsible for collections. That’s all handled by
accounts receivable. I also think that the sales reps get involved because their
commission depends on customers who pay! For each sales rep, or employee, we
must know the ID and last name. Occasionally we need to know the first name, user
ID, start date, title, and salary. We may also track the employee’s commission percent
and any comments about the individual.

Our order-entry personnel are well versed in our product line. We hold frequent
meetings with marketing so they can inform us of new products. This results in greater
customer satisfaction because our order-entry operators can answer a lot of questions.
This is possible because we deal with a few select customers and maintain a specialty
product line. For each product, we must know the ID and name. Occasionally we must
also know the description, suggested price, and unit of sale. We would also like the
ability to track very long descriptions of our products and pictures of our products,
when it is necessary.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 10 Lesson 2: Generic Modeling

Objectives
• Define generic modeling
• Evaluate and describe the advantages and disadvantages of generic modeling
• Construct a generic version of a more specific data model

Vocabulary
Identify the vocabulary word for each definition below.

Point of view.

Relating to or descriptive of an entire group or class.

Try It / Solve It

1. Describe one advantage and disadvantage of generic modeling.

2. Recall the STAFF entity in the Global Fast Foods model. Create two generic models: one using
recycling of attributes and the other using attributes modeled as property instances.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 11 Lesson 1: Introduction to Relational Database Concepts
Objectives
• Define a primary key
• Define a foreign key
• Define a column-integrity rule
• Identify row, column, primary key, unique key, and foreign key given a diagram of a
table containing these elements
• Identify violations of data-integrity rules

Vocabulary
Identify the vocabulary word for each definition below.

A constraint which ensures that the column contains no null


values and uniquely identifies each row of the table.
A column or set of columns that refer to a primary key in the
same table or another table.
An entry in a table, consisting of values for each appropriate
column
An implementation of an attribute or relationship in a table

An integrity constraint that requires every value in a column or set


of columns be unique.
Collections of objects or relations, set of operators to act on those
relations and data integrity for accuracy and consistency.
More than one column or combination of columns that could
serve as the table’s primary key

Part Two: Identify the integrity rules below.

1. A column must contain only values consistent


with the defined data format of the column
2. Define the relationally correct state for a
database; they ensure that users can perform
only those operations that leave the database in
a correct, consistent state
3. A primary key must be unique and no part of the
primary key can be null
4. A foreign key must match an existing primary
key value (or else be null)
5. The data stored in a database must comply with
the rules of the database

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Try It / Solve It

1. Data Integrity in the DJs Database

Examine the sample data for these tables in the DJs on Demand database. Check for
entity, referential, and column integrity. Identify any data-integrity violations. Assume that
all date columns should have a date format and all amount (cost) columns should have a
number format.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 11 Lesson 2: Basic Mapping: The Transformation Process
Objectives
• Distinguish entity relationship models from database models
• Describe the terminology mapping between a conceptual model and a physical model
• Understand and apply the Oracle naming conventions for tables and columns used in
physical models
• Transform an entity into a table diagram

Vocabulary
Identify the vocabulary word for each definition below.

To change the elements of an ERD into database elements

To associate the elements of an ERD with database elements

Try It / Solve It

1. Transform the following entities into table definitions using suitable naming conventions.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Match the ERD elements to their corresponding database elements.

Analysis Design
Attribute Column
Entity Foreign key
ER Model Physical design
Instance Primary key
Primary UID Row
Relationship Table
Secondary UID Unique key

3. Identify the table diagram notations listed below.

• “pk”
• “fk”
• “uk”
• “*”
• “o”

4. Create short names for the terms below based on the naming conventions rules.

• Academic major
• Undergraduate
• Class

5. Identify what is wrong with each of the table names below.

• 1997classes
• Schedule_of_classes_spring_2003
• Financial Aid deadlines!

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 11 Lesson 3: Relationship Mapping
Objectives
• Apply the rule of relationship mapping to correctly transform 1:M and barred
relationships
• Apply the rule of relationship mapping to correctly transform M:M relationships
• Transform 1:1 relationships
• Apply the rule of relationship mapping to correctly transform relationships in an arc

Vocabulary
Identify the vocabulary word for each definition below.

A relationship in a database where the foreign key column in the


database table cannot be updated
A series of relationships implying that the unique identifier of each
entity in the chain is carried down to the entity on the next level
The product of the resolution of a many to many relationship.

Try It / Solve It

Relationship Mapping

The following entities were mapped to tables in the previous lesson: SHIFT, REGULAR
MENU, PROMOTIONAL MENU, FREQUENT DINER CARD.

Refer to the completed Global Fast Foods model and map the following entities:

FOOD ITEM
ORDER
ORDER LINE

1. Transform relationships into foreign-key columns.

Use as many rows as necessary in the following table diagram.

Key Type Optionality (“*” or Column


(pk, uk, “o”) Name
fk)

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
2. Indicate if a check constraint or additional programming is needed to enforce the
relationship in the database. Under each table diagram, write the conditions that the
check constraint or program has to ensure.

For example:

“To enforce exclusive relationships, a check constraint is needed to make sure that
(column A is not null and column B is null) OR (column A is null and column B is not
null).”

“To enforce a nontransferable relationship, additional programming is needed to make


sure that the <foreign key column> cannot be updated.”

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 11 Lesson 4: Subtype Mapping
Objectives
• State and apply the table, column, identifiers, relationship, and integrity constraint
rules for mapping:
o supertype implementations
o subtype implementations
o supertype and subtype arc implementations

Try It / Solve It

1. Transform the PARTNER supertype in the DJs model, using the supertype or single-table
implementation.

2. Transform the STAFF supertype in the Global Fast Foods model, using the subtype or
two-table implementation.

3. Identify the database rules for each part of the database implementations below.

Supertype implementations
• Table
• Column
• Identifiers
• Relationship
• Integrity constraint rules

Subtype implementations
• Table
• Column
• Identifiers
• Relationship
• Integrity constraint rules

Arc implementations
• Table
• Column
• Identifiers
• Relationship
• Integrity constraint rules

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 12 Lesson 1: Introduction to Oracle Application Express
Objectives
• Log-in to Oracle Application Express
• Create the music table using the script provided
• Enter some sample data into the music table created in this lesson
• Query the music table to view the new data
• Refine the query

Try It / Solve It

Creating the MUSIC table

You will be using an application called Oracle Application Express to log-in to the database,
create tables, and insert data. Your instructor will walk you through the process of logging in
and using the application.

1. You will be creating a database table called MUSIC. The table data is provided here.
Can you identify the column names? How many rows does the table have? What is the
unique identifier of this table? Can you give an example of an instance of the MUSIC
table?

MUSIC_ID ARTIST_NAME TYPE


1 BOB MARLEY REGGAE
2 BRITNEY SPEARS POP
3 NSYNC POP
4 SHAGGY REGGAE
5 JIMMY CLIFF REGGAE
6 KID ROCK RICJ
7 THIRD WORLD REGGAE
8 LENNY KRAVITZ ROCK
9 YELLOW MAN REGGAE

Your instructor will step you through the process of creating the MUSIC table using Oracle
Application Express. You can use the music.sql script that your instructor will provide or
enter the CREATE TABLE statement yourself.

SQL statement:

CREATE TABLE MUSIC


( MUSICID NUMBER(2) NOT NULL,
ARTIST_NAME VARCHAR2(20),
TYPE VARCHAR2(13),
CONSTRAINT MUSIC_PRIMARY_KEY PRIMARY KEY (MUSICID));

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
After you create your table, you will populate it with data. You can use the music.sql script
that your instructor provides or enter the INSERT statements yourself.

What did we just do? We used SQL to create a table in the database and to insert data
into the table.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 12 Lesson 2: SQL Introduction: Querying the Database
Objectives
• Query the MUSIC table; apply the rules of SQL to display all columns and a subset of
columns specified by criteria
• Add new data with a different value in the “type” column to the MUSIC table
• Refine the SQL query to display only those rows in the MUSIC table that have the new
type

Vocabulary
Identify the vocabulary word for each definition below.

A set contained within another set.

A change or revision.

The rules governing the formation of statements in a


programming language.

Try It / Solve It

Basic SQL Commands

1. Your instructor will give you a copy of some basic SQL commands and will discuss them
with the class. Enter the commands in Oracle Application Express to see the results.

a. Enter two or three rows of data with a new type (CLASSICAL, NEW AGE, JAZZ – your
choice). Then retrieve only the rows of data with this new music type.

b. Experiment on your own with variations of the command – retrieve different columns
and different rows (specific artists, types, etc.).

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 12 Lesson 3: Basic Table Modifications
Objectives
• Add a new column to the MUSIC table
• Use the DELETE and ALTER TABLE commands to correct mistakes or make
revisions to a table

Try It / Solve It

1. Add at least five new rows and two new columns to the MUSIC table. If you make
mistakes, use the DELETE and ALTER commands to correct them.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 12 Lesson 4: System Development Life Cycle
Objectives
• List and describe the different stages of the system development life cycle
• Identify the role of data modeling in the system development life cycle
• Relate the project tasks to the different stages of the system development life cycle

Vocabulary
Identify the vocabulary word for each definition below.

To enter data into a table.

The process of developing information systems through a multi-


step process.
The type of testing where monitored users determine whether a
system meets all their requirements, and will support the
business for which it was designed.
The simultaneous execution of two different operations.

Try It / Solve It

Work with your groups to answer the following questions as they apply to your project:

1. Which parts of the system development life cycle have you been through so far? What
tasks took the most time to complete? (Getting business requirements, creating the
data model, validating the model, documenting business rules, or others.)

2. Once you are done with the analysis stage, what are the next two stages? What will
you do in these stages?

3. How much time does it take to fix an error in the data model compared to fixing the
error when the tables have already been built? What about when the tables have
already been populated? Try to imagine how long it would take to fix an error if the
application (reports, web pages, etc.) have already been built. What does this tell you
about the importance of the early stages of the system development life cycle?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 13 Lesson 1: Project Overview and Getting Started
Objectives
• Identify a data-modeling project to solve a business information need
• Demonstrate essential skills in solving business problems using technology and
professionally presenting these solutions

Try It / Solve It

1. Decide on a topic for your group.


2. Discuss the specific business problems that you want to solve.
3. Start creating a first-cut ERD.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 13 Lesson 2: Presentation Project Management
Objectives
• Track responsibility and progress on a project by using a project-management
document
• Show evidence of progress on the final presentation project by filling in the final project
tracking grid

Try It / Solve It

1. Final Presentation Progress Report

Use the class time to make progress on your final presentation. Revise and finalize
your ERD. Make sure you have all attributes defined, UIDs identified, relationships
named, and so on. Use subtypes, arcs, and hierarchies, if applicable.

2. Obtain a copy of the Final Presentation Project Tracking Form from your teacher. Fill
in the project tracking grid to document your current progress.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 13 Lesson 3: Final Presentation Components
Objectives
• Organize the final oral presentation content in logical outline order
• Identify appropriate content for each part of the presentation
• Assign presentation roles to each group member

Try It / Solve It

Presentation Sequence

1. Review the Final Presentation Rubric. This lists all of the elements that you need for
your presentation. Review the presentation sequence and discuss what you need to
write or produce for each step. Assign roles to each member of the team. Develop a
document that outlines the presentation sequence and identifies which team member
will be responsible for each part. Also indicate who will be responsible for writing or
producing each part.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 14 Lesson 1: Creating Tables for the Final Presentation
Objectives
• Create sample tables from the final project presentation ERD
• Add sample data to the created tables
• Produce query output using Oracle Application Express

Try It / Solve It

Creating Presentation Tables

1. Map your ERD to an initial database design. Complete the table instance chart for
each table mapped.

Use Oracle Application Express to:


• Create your tables
• Add sample data to created tables
• Write and save queries that will be needed for the final presentation project

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 14 Lesson 2: Preparing Written Documentation
Objectives
• Compose well-organized written documentation to accompany your presentation
• Create a rough draft of, review, and finalize the written documentation

Try It / Solve It

Prepare Written Documentation

1. Compose written documentation for the final project that meets the requirements outlined
in the Final Presentation Rubric.

2. Create a first draft and present to your instructor for feedback. Then, revise and finalize.

3. Update the relevant tasks in the final project-tracking grid.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 14 Lesson 3: Preparing Visual Materials
Objectives
• Construct entity relationship diagrams that demonstrate industry conventions
• Prepare tables and visuals that support the database documentation
• Demonstrate and provide examples of table formatting for database documentation

Try It / Solve It

Preparing Visual Materials

1. Take time to reflect on the progress of your group activity. In one paragraph describe your
group efforts to this point. Include information on the roles of each group member. Provide
feedback on group member activity and the impact it is having on the success of the
group’s visual material development.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 14 Lesson 4: Final Presentations
Objectives
• Present the final presentation project demonstrating use of arguments to persuade the
client
• Present a central message and supporting arguments
• Demonstrate logical analysis of the business rules, operations, and processes in a
way that is clear and easy for the client to understand
• Demonstrate appropriate business attire
• Demonstrate eye contact, upright posture, gestures, and other nonverbal
communication
• Compose answers to all questions using clear, concise communication
• Complete observation feedback for each presenter
• Deliver a successful presentation according to the rubric

Try It / Solve It

1. Activity: Final Presentation

Presenting Team:
• Deliver a successful presentation according to the rubric.

Audience (Observers):
• Write down three effective presentation techniques exhibited by each presenter.
• Identify one area for improvement.
• Participate in the question-and-answer part of the presentation. Write down at least
one question for the presenter.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 15 Lesson 1: Anatomy of a SQL Statement
Objectives
• Match projection, selection, and join with their correct functions capabilities
• Create a basic SELECT statement
• Use the correct syntax to display all rows in a table
• Use the correct syntax to select specific columns in a table, modify the way data is
displayed, and perform calculations using arithmetic expressions and operators
• Formulate queries using correct operator precedence to display desired results
• Define a null value
• Demonstrate the effect null values create in arithmetic expressions
• Construct a query using a column alias

Vocabulary
Identify the vocabulary word for each definition below.

Display data from two or more related tables.

A symbol used to perform an operation on some values.

An implementation of an attribute or relationship in a table.

The capability in SQL to choose the columns in a table that you


want returned from a query.
A value that is unavailable, unassigned, unknown, or
inapplicable.
Renames a column heading.

A mathematical equation.

The capability in SQL to choose the rows in a table returned from


a query.
Retrieves information from the database

Specifies the columns to be displayed

Specifies the table containing the column listed in the select


clause
An individual SQL statement

Part of a SQL statement

A combination of the two clauses

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Try It / Solve It

Now you know the basics of a SELECT statement.


It's time to practice what you've learned.

1. Write a SQL statement that demonstrates projection.

2. Write a query that displays the last_name and email addresses for all the people in the
DJs on Demand d_client table. The column headings should appear as “Client” and
“Email Address.”

3. The manager of Global Fast Foods decided to give all employees at 5%/hour raise + a
$.50 bonus/hour. However, when he looked at the results, he couldn't figure out why the
new raises were not as he predicted. Ms. Doe should have a new salary of $7.59, Mr.
Miller's salary should be $11.00, and Monique Tuttle should be $63.50. He used the
following query. What should he have done?

SELECT last_name, salary *.05 +.50


FROM f_staffs;

4. Which of the following would be the easiest way to see all rows in the d_songs table?
a. SELECT id, title, duration, artist, type_code
b. SELECT columns
c. SELECT *
d. SELECT all

5. If tax = 8.5% * car_cost and license = car_cost * .01%, which value will produce the
largest car payment?
a. Payment = (car_cost * 1.25) + 5.00 - (tax) - (license)
b. Payment = car_cost * 1.25 + 5.00 - (tax - license)

6. In the example below, identify the keywords, the clause(s), and the statement(s):

SELECT employee_id, last_name


FROM employees

7. Label each example as SELECTION, PROJECTION, or JOIN.


a. Please give me Mary Adam's email address.
b. I will need each customer's name and the order_total for their order.
c. I would like only the manager_id column, and none of the other columns.

8. Which of the following statements are true?


a. null * 25 = 0;
b. null * 6.00 = 6.00
c. null * .05 = null
d. (null + 1.00) + 5.00 = 5.00

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
9. How will the column headings be labeled in the following example?

SELECT bear_id bears, color AS Color, age “age”


FROM animals;

a. bears, color, age


b. BEARS, COLOR, AGE
c. BEARS, COLOR, age
d. Bears, Color, Age

10. Which of the following words must be in a SELECT statement in order to return all rows?
a. SELECT only
b. SELECT and FROM
c. FROM only
d. SELECT * only

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 15 Lesson 2: Oracle Database Environment
Objectives
• Explain the features and benefits that the Oracle 11g Database Environment provides
for businesses
• Locate information about Oracle Corporation and its products and services
• Relate the steps in the system development life cycle (SDLC) to the development and
design of the Oracle 11g Database product and the data-modeling process

Try It / Solve It

1. Use the Internet to access the following sites and answer the questions below.

Oracle Technology Network


Oracle Glossary of Terms
Oracle Grid Computing Information
Oracle 11g Information
TechWeb Tech Encyclopedia

a. Compare and contrast Oracle's grid database design to that of the local power
company or the phone company.

b. Record two ways in which they are the same and two ways in which they are different.

2. The SDLC is a step-by-step, systematic way for “getting the job done.” Because the SDLC
is such an effective way to solve problems, the process can be applied to many situations
other than database design. For the businesses listed, give an example of how each
might incorporate the SDLC.

Fast-food company
Airplane manufacturer
Bridge-building company
Rock-star concert promoter
Clothing designer

3. (Optional) The Oracle site http://www.oracle.com/solutions/index.html lists industries that


Oracle has helped to revolutionize their data needs. Choose an industry to explore
specific companies. Choose a company and write a brief report answering the questions:
a. What is the company's primary business?
b. What problems did this business seek to solve?
c. How did Oracle help this business?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 15 Lesson 3: Using Applications
Objectives
• Distinguish between application software and system software and give an example of
each
• Demonstrate use of Oracle Application Express to enter SQL statements that retrieve
data

Vocabulary
Identify the vocabulary word for each definition below.

Program that interacts with the user by providing tools to


accomplish a task
Program that interacts with the hardware in the computer

Part Two: Identify each software program below as an application program or a system
program.

1. Windows Media Player


2. Microsoft Office
3. Windows XP
4. AOL
5. Sound card drivers
6. System utilities

Try It / Solve It

1. Log into Oracle Application Express and complete the following tasks. Write a check mark
next to each task once you’ve reached success in completing the task.

 Show the drop-down menu for the Schema window and the schema name.
 Locate the SQL statement window to enter SQL commands.
 Enter the following command
SELECT *
FROM d_cds;
 Click the SAVE button and enter a name for the file.
 Notice the Archive tab is highlighted, and saved SQL commands appear in the window.
 Click the History tab to view the past 200 SQL commands.

2. Name one application software package and one system software package. Then provide
an example of each.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
3. (Optional) Research the job titles of analyst, designer, programmer, and a user-support
manager. These are jobs associated with application design, development, and
maintenance. Search the Internet using the keywords “software applications jobs” or
http://www.monster.com with search keyword “application software designer.” List your
findings.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 15 Lesson 4: Relational Database Technology
Objectives
• Define and give an example of a relational database
• Identify table-key terms, including row, column, field, primary key, and foreign key
• Relate the importance of databases to everyday life

Vocabulary
Identify the vocabulary word for each definition below.

An entry in a table, consisting of values for each appropriate


column.
The set of mandatory columns within a table that is used to
enforce uniqueness of rows, and that is normally the most
frequent means by which rows are accessed.
An arrangement of data in rows and columns.

A column or set of columns that refers to a primary key in the


same table or another table.
Collections of objects or relations, set of operators to act on those
relations, and data integrity for accuracy and consistency
Intersection of a row and column

Used to modify the table data by entering, changing, or removing


rows
Creates, changes, and removes data structures from the
database
Used to manage the changes made by DML statements

Used to give or remove access rights to the database and the


structures within it

Try It / Solve It

1. The Global Fast Foods database consists of how many tables? ____ tables

2. How is the F_SHIFTS table related to the F_STAFFS table?

3. What are the names of the columns in the F_CUSTOMERS table?

4. How many rows of data have been entered in the F_PROMOTIONAL_MENUS table?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
5. In the F_FOOD_ITEMS table, column _________ is a foreign-key column. What table and
column is this key referencing?

6. List the primary key to foreign key relationships required to go from the F_SHIFTS table to
the F_REGULAR_MENUS table.

7. Which table(s) contains null values?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 16 Lesson 1: Working with Columns, Characters, and Rows
Objectives
• Apply the concatenation operator to link columns to other columns, arithmetic
expressions, or constant values to create a character expression
• Use Column Aliases to rename columns in the query result
• Enter literal values of type character, number, or date into a SELECT statement
• Define and use DISTINCT to eliminate duplicate rows
• Display the structure of a table using DESCRIBE or DESC
• Edit, execute, and save SQL statements in Oracle Application Express

Vocabulary
Identify the vocabulary word for each definition below.

A command that suppresses duplicates

Links two columns together to form one character data column

A group of character data

An SQL plus command that displays the structure of a table

Try It / Solve It

1. The manager of Global Fast Foods would like to send out coupons for the upcoming sale.
He wants to send one coupon to each household. Create the SELECT statement that
returns the customer last name and a mailing address.

2. Each statement below has errors. Correct the errors and execute the query in Oracle
Application Express.

a.
SELECT first name
FROM f_staffs;

b.
SELECT first_name |" " | last_name AS "DJs on Demand Clients"
FROM d_clients;

c.
SELECT DISCTINCT f_order_lines
FROM quantity;

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
d.
SELECT order number
FROM f_orders;

3. Sue, Bob, and Monique were the employees of the month. Using the f_staffs table, create
a SELECT statement to display the results as shown in the Super Star chart.

Super Star
*** Sue *** Sue ***
*** Bob *** Bob ***
*** Monique *** Monique ***

4. Which of the following is TRUE about the following query?


SELECT first_name, DISTINCT birthdate
FROM f_staffs;

a. Only two rows will be returned.


b. Four rows will be returned.
c. Only Fred 05-JAN-1988 and Lizzie 10-NOV-1987 will be returned.
d. No rows will be returned.

5. Global Fast Foods has decided to give all staff members a 5% raise. Prepare a report that
presents the output as shown in the chart.

EMPLOYEE LAST NAME CURRENT SALARY SALARY WITH 5% RAISE

6. Create a query that will return the structure of the Oracle database EMPLOYEES table.
Which columns are marked “nullable”? What does this mean?

7. The owners of DJs on Demand would like a report of all items in their D_CDs table with
the following column headings: Inventory Item, CD Title, Music Producer, and Year
Purchased. Prepare this report.

8. True/False -- The following SELECT statement executes successfully:


SELECT last_name, job_id, salary AS Sal
FROM employees;

9. True/False -- The following SELECT statement executes successfully:


SELECT *
FROM job_grades;

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
10. There are four coding errors in this statement. Can you identify them?
SELECT employee_id, last_name
sal x 12 ANNUAL SALARY
FROM employees;

11. In the arithmetic expression salary*12 - 400, which operation will be evaluated first?

12. Which of the following can be used in the SELECT statement to return all columns of data
in the Global Fast Foods f_staffs table?
a. column names
b. *
c. DISTINCT id
d. both a and b

13. Using SQL to choose the columns in a table uses which capability?
a. selection
b. projection
c. partitioning
d. join

14. SELECT last_name AS "Employee". The column heading in the query result will appear
as:
a. EMPLOYEE
b. employee
c. Employee
d. "Employee:

15. Which expression below will produce the largest value?


a. SELECT salary*6 + 100
b. SELECT salary* (6 + 100)
c. SELECT 6(salary+ 100)
d. SELECT salary+6*100

16. Which statement below will return a list of employees in the following format?
Mr./Ms. Steven King is an employee of our company.

a. SELECT "Mr./Ms."||first_name||' '||last_name 'is an employee of our company.' AS


"Employees"
FROM employees;
b. SELECT 'Mr./Ms. 'first_name,last_name ||' '||'is an employee of our company.'
FROM employees;
c. SELECT 'Mr./Ms. '||first_name||' '||last_name ||' '||'is an employee of our company.' AS
"Employees"
FROM employees ;
d. SELECT Mr./Ms. ||first_name||' '||last_name ||' '||"is an employee of our company." AS
"Employees"
FROM employees
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
17. Which is true about SQL statements?
a. SQL statements are case-sensitive
b. SQL clauses should not be written on separate lines.
c. Keywords cannot be abbreviated or split across lines.
d. SQL keywords are typically entered in lowercase; all other words in uppercase.

18. Which queries will return three columns each with UPPERCASE column headings?
a. SELECT "Department_id", "Last_name", "First_name"
FROM employees;
b. SELECT DEPARTMENT_ID, LAST_NAME, FIRST_NAME
FROM employees;
c. SELECT department_id, last_name, first_name AS UPPER CASE
FROM employees
d. SELECT department_id, last_name, first_name
FROM employees;

19. Which statement below will likely fail?


a. SELCT * FROM employees;
b. Select * FROM employees;
c. SELECT * FROM EMPLOYEES;
d. SelecT* FROM employees;

20. Click on the History link at the bottom of the SQL Commands window. Scroll or use the
arrows at the bottom of the page to find the statement you wrote to solve problem 3
above. (The one with the column heading SuperStar). Click on the statement to load it
back into the command window. Execute the command again, just to make sure it is the
correct one that works. Once you know it works, click on the SAVE button in the top right
corner of the SQL Commands window, and enter a name for your saved statement. Use
your own initials and “_superstar.sql”, so if your initials are CT then the filename will be
CT_superstar.sql.

Log out of OAE, and log in again immediately. Navigate back to the SQL Commands
window, click the Saved SQL link at the bottom of the page and load your saved SQL
statement into the Edit window. This is done by clicking on the script name. Edit the
statement, to make it display + instead of *. Run your amended statement and save it as
initials_superplus.sql.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 16 Lesson 2: Limit Rows Selected
Objectives
• Apply SQL syntax to restrict the rows returned from a query
• Demonstrate application of the WHERE clause syntax
• Explain why it is important, from a business perspective, to be able to easily limit data
retrieved from a table
• Construct and produce output using a SQL query containing character strings and
date values

Vocabulary
Identify the vocabulary word for each definition below.

Restricts the rows returned by a select statement

Compares one expression to another value or expression

Try It / Solve It

1. Using the Global Fast Foods database, retrieve the customer’s first name, last name, and
address for the customer who uses ID 456.

2. Show the name, start date, and end date for Global Fast Foods' promotional item “ballpen
and highlighter” giveaway.

3. Create a SQL statement that produces the following output:

Oldest
The 1997 recording in our database is The Celebrants Live in Concert

4. The following query was supposed to return the CD title “Carpe Diem" but no rows were
returned. Correct the mistake in the statement and show the output.

SELECT produce, title


FROM d_cds
WHERE title = 'carpe diem' ;

5. The manager of DJs on Demand would like a report of all the CD titles and years of CDs
that were produced before 2000.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
6. Which values will be selected in the following query?

SELECT salary
FROM employees
WHERE salary < = 5000;

a. 5000
b. 0 - 4999
c. 2500
d. 5

For the next three questions, use the following table information:

TABLE NAME: students


COLUMNS: studentno NUMBER(6)
fname VARCHAR2(12)
lname VARCHAR(20)
sex CHAR(1)
major VARCHAR2(24)

7. Write a SQL statement that will display the student number (studentno), first name
(fname), and last name (lname) for all students who are female (F) in the table named
students.

8. Write a SQL statement that will display the student number (studentno) of any student
who has a PE major in the table named students. Title the studentno column Student
Number.

9. Write a SQL statement that lists all information about all male students in the table named
students.

10. Write a SQL statement that will list the titles and years of all the DJs on Demand CDs that
were not produced in 2000.

11. Write a SQL statement that lists the Global Fast Foods employees who were born before
1980.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 16 Lesson 3: Comparison Operators
Objectives
• Apply the proper comparison operator to return a desired result
• Demonstrate proper use of BETWEEN, IN, and LIKE conditions to return a desired
result
• Distinguish between zero and the value of NULL as unavailable, unassigned,
unknown, or inapplicable
• Explain the use of comparison conditions and NULL

Vocabulary
Identify the vocabulary word for each definition below.

This option identifies that the escape characters should be


interpreted literally
Condition tests for null values

Displays rows based on a range of values

Including the specified limits and the area between them; the
numbers 1-10, inclusive
Selects rows that match a character pattern

Tests for values in a specified list of values

Try It / Solve It

1. Display the first name, last name, and salary of all Global Fast Foods staff whose salary is
between $5.00 and $10.00 per hour.

2. Display the location type and comments for all DJs on Demand venues that are Private
Home.

3. Using only the less than, equal, or greater than operators, rewrite the following query:

SELECT first_name, last_name


FROM f_staffs
WHERE salary BETWEEN 20.00 and 60.00;

4. Create a list of all the DJs on Demand CD titles that have “a” as the second letter in the
title.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
5. Who are the partners of DJs on Demand who do not get an authorized expense amount?

6. Select all the Oracle database employees whose last names end with “s”. Change the
heading of the column to read Possible Candidates.

7. Which statement(s) are valid?


a. WHERE quantity <> NULL;
b. WHERE quantity = NULL;
c. WHERE quantity IS NULL;
d. WHERE quantity != NULL;

8. Write a SQL statement that lists the songs in the DJs on Demand inventory that are type
code 77, 12, or 1.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 17 Lesson 1: Logical Comparisons and Precedence Rules
Objectives
• Evaluate logical comparisons to restrict the rows returned based on two or more
conditions
• Apply the rules of precedence to determine the order in which expressions are
evaluated and calculated

Vocabulary
Identify the vocabulary word for each definition below.

Inverts the value of the condition

Both conditions must be true for a record to be selected

Rules that determine the order in which expressions are


evaluated and calculated
Either condition can be true for a record to be selected

Try It / Solve It

1. Execute the two queries below. Why do these nearly identical statements produce two
different results? Name the difference and explain why.

SELECT code, description


FROM d_themes
WHERE code >200 AND description IN('Tropical', 'Football', 'Carnival');

SELECT code, description


FROM d_themes
WHERE code >200 OR description IN('Tropical', 'Football', 'Carnival');

2. Display the last names of all Global Fast Foods employees who have “e” and “i” in their
last names.

3. “I need to know who the Global Fast Foods employees are that make more than
$6.50/hour and their position is not order taker.”

4. Using the employees table, write a query to display all employees whose last names start
with “D” and have “a” and “e” anywhere in their last name.

5. In which venues did DJs on Demand have events that were not in private homes?

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
6. Which list of operators is in the correct order from highest precedence to lowest
precedence?
a. AND, NOT, OR
b. NOT, OR, AND
c. NOT, AND, OR

For questions 7 and 8, write SQL statements that will produce the desired output.

7. Who am I?
I was hired by Oracle after May 1998 but before June of 1999. My salary is less than
$8000 a year and I have an “en” in my last name.

8. What's my email address?


Because I have been working for Oracle since the beginning of 1996, I make more than
$9000 per month. Because I make so much money, I don't get a commission.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 17 Lesson 2: Sorting Rows
Objectives
• Construct a query to sort a result set in ascending or descending order
• State the order in which expressions are evaluated and calculated based on the rules
of precedence
• Construct a query to order a result set using a column alias
• Construct a query to order a result set for single or multiple columns

Vocabulary
Identify the vocabulary word for each definition below.

Orders the rows in ascending order (the default order); A-Z

Orders the rows in descending order: Z-A

To arrange according to class, kind, or size

Try It / Solve It

1. In the example below, assign the employee_id column the alias of “Number.” Complete
the SQL statement to order the result set by the column alias.

SELECT employee_id, first_name, last_name


FROM employees;

2. Create a query that will return all the DJs on Demand CD titles ordered by year with titles
in alphabetical order by year.

3. Order the DJs on Demand songs by descending title. Use the alias “Our Collection” for
the song title.

4. Write a SQL statement using the ORDER BY clause that could retrieve the information
needed. Do not run the query.

Create a list of students who are in their first year of school. Include the first name, last
name, student ID number, and parking place number. Sort the results alphabetically by
student last name and then by first name. If more than one student has the same last
name, sort each first name in Z to A order. All other results should be in alphabetical order
(A to Z).

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
5. Write a SQL statement using the employees table and the ORDER BY clause that could
retrieve the information in the following table. Return only those employees with
employee_id<125.

DEPARTMENT_ID LAST_NAME MANAGER_ID


90 Kochhar 100
90 King (null)
90 De Haan 100
60 Lorentz 103
60 Hunold 102
60 Ernst 103
50 Mourgos 100

Extension Activities

1. Limiting values with the WHERE clause is an example of:


a. Projection
b. Ordering
c. Joining
d. Grouping
e. Selection

2. You want to sort your CD collection by title, and then by artist. This can be accomplished
using:
a. WHERE
b. SELECT
c. ORDER BY
d. DISTINCT

3. Which of the following are SQL keywords?


a. SELECT
b. ALIAS
c. COLUMN
d. FROM

4. Which of the following are true?


a. Multiplication and division take priority over addition.
b. Operators of the same priority are evaluated from left to right.
c. Parentheses can be used to override the rules of precedence.
d. None of the above are true.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
5. The following query was written:
SELECT DISTINCT last_name
FROM students

a. To select all the outstanding students


b. To choose last names that are duplicates
c. To select last names without duplicates
d. To select all last names

6. The following string was created using which SELECT clause?


Abby Rogers is an order taker for Global Fast Foods
a. SELECT first_name ||' ' ||last_name ||' is an ' staff_type ' for Global Fast Foods'
b. SELECT Abby Rogers is an ||staff_type||' for Global Fast Foods'
c. SELECT first_name,last_name '||staff_type||' for Global Fast Foods'
d. SELECT first_name ||' ' ||last_name ||' is an '||staff_type||' for Global Fast Foods'

7. Which of the following SELECT clauses will return uppercase column headings?
a. SELECT id, last_name, address, city, state, zip, phone_number;
b. SELECT ID, LAST_NAME, ADDRESS, CITY, STATE, ZIP, PHONE_NUMBER;
c. SELECT Id, Last_name, Address, City, State, Zip, Phone_number;
d. SELECT id AS ID, last_name AS NAME, address AS ADDRESS, city AS CITY, state
AS STATE, zip AS ZIP, phone_number AS PHONE_NUMBER;

8. Which SELECT clause will return the last names in alphabetical order?
a. SELECT last_name AS ALPHABETICAL
b. SELECT last_name AS ORDER BY
c. SELECT last_name
d. SELECT ASC last_name

9. Which SELECT clause will return a column heading for employee_id called “New
Employees”?
a. SELECT last_name AS "New Employees"
b. SELECT employee_id AS New Employees
c. SELECT employee AS "New Employees"
d. SELECT employee_id AS "New Employees"

10. Examine the following query:


SELECT last_name, job_id, salary
FROM employees
WHERE job_id = 'SA_REP' OR job_id = 'AD_PRES' AND salary >15000;

Which results could not have been returned from this query?

a. Joe Everyone, sales representative, salary 15000


b. Jane Hendricks, sales manager, salary 15500
c. Arnie Smithers, administration president, 20000
d. Jordan Lim, sales representative, salary 14000
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
11. Finish this query so it returns all employees whose last names start with “St”.
SELECT last_name
FROM employees

12. What salary values will not be returned from this query?
SELECT last_name, first_name, salary
FROM employees
WHERE salary BETWEEN 1900 AND 2100;

13. Correct each WHERE clause:


a. WHERE department_id NOT IN 101,102,103;
b. WHERE last_name = King
c. WHERE start date LIKE "05-MAY-1998"
d. WHERE salary IS BETWEEN 5000 AND 7000
e. WHERE id =! 10

14. SELECT prefix


FROM phone
WHERE prefix BETWEEN 360 AND 425
OR prefix IN (206,253,625)
AND prefix BETWEEN 315 AND 620;

Which of the following values could be returned?


625, 902, 410, 499

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.
Section 17 Lesson 3: Introduction to Functions - Single Row Functions
Objectives
• Identify appropriate applications of single-row functions in query statements
• Classify a function as a single-row or multi-row function
• Differentiate between single-row functions and multirow functions and the result
returned by each

Try It / Solve It

1. For each task, choose whether a single-row or multiple row function would be most
appropriate:

a. Showing all of the email addresses in upper case letters


b. Determining the average salary for the employees in the sales department
c. Showing hire dates with the month spelled out (September 1, 2004)
d. Finding out the employees in each department that had the most seniority (the earliest
hire date)
e. Displaying the employees’ salaries rounded to the hundreds place
f. Substituting zeros for null values when displaying employee commissions.

2. The most common multiple-row functions are: AVG, COUNT, MAX, MIN, and SUM. Give
your own definition for each of these functions.

3. Test your definitions by substituting each of the multiple-row functions into this query.

SELECT FUNCTION(salary)
FROM employees

Write out each query and its results.

Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their
respective owners.