0% found this document useful (0 votes)
16 views1 page

Attachment 1

Uploaded by

Anh Hoai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

Attachment 1

Uploaded by

Anh Hoai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

234

Problems and Exercises


5-27. Consider the following two relations for Millennium College: What opportunities might exist for denormalizing these
relations when defining the physical records for this
STUDENT(StudentID, StudentName, database? Under what circumstances would you consider
CampusAddress, GPA) creating such denormalized records?
REGISTRATION(StudentID, CourseID, Grade) 5-35. Consider the following set of normalized relations from
a database used by a mobile service provide to keep track
Following is a typical query against these relations: of its users and advertiser customers.

SELECT Student_T.StudentID, StudentName,


CourseID, Grade USER(UserID, UserLName, UserFName, UserEmail,
FROM Student_T, Registration_T UserYearOfBirth, UserCategoryID, UserZip)
WHERE Student_T.StudentID = ADVERTISERCLIENT(ClientID, ClientName,
Registration_T.StudentID ClientContactID, ClientZip)
AND GPA > 3.0 CONTACT(ContactID, ContactName, ContactEmail,
ORDER BY StudentName; ContactPhone)
USERINTERESTAREA(UserID, InterestID,
a. On what attributes should indexes be defined to speed up UserInterestIntensity)
this query? Give the reasons for each attribute selected. INTEREST(InterestID, InterestLabel)
b. Write SQL commands to create indexes for each attri- CATEGORY(CategoryID, CategoryName,
bute you identified in part a. CategoryPriority)
Problems and Exercises 5-28—5-31 have been written assum- ZIP(ZipCode, City, State)
ing that the DBMS you are using is Oracle. If that is not the
case, feel free to modify the question for the DBMS environment
that you are familiar with. You can al--so compare and contrast Assume that the mobile service provider has frequent
answers for different DBMSs. need for the following information:
List of users sorted by zip code
5-28. Choose Oracle data types for the attributes in the normal-
Access to a specific client with the client’s contact per-
ized relations in Figure 5-4b.
son’s name, e-mail address, and phone number
5-29. Choose Oracle data types for the attributes in the normal-
List of users sorted by interest area and within each
ized relations that you created in Problem and Exercise 4-47
interest area user’s estimated intensity of interest
in Chapter 4.
List of users within a specific age range sorted by their
5-30. Explain in your own words what the precision (p) and scale
category and within the category by zip code.
(s) parameters for the Oracle data type NUMBER mean.
Access to a specific user based on their e-mail address.
5-31. Say that you are interested in storing the numeric value
Based on these needs, specify the types of indexes you
3,456,349.2334. What will be stored, with each of the
would recommend for this situation. Justify your deci-
following Oracle data types:
sions based on the list of information needs above.
a. NUMBER(11)
5-36. Consider the relations in Problem and Exercise 5-35.
b. NUMBER(11,1)
Please identify possible opportunities for denormal-
c. NUMBER(11,-2)
izing these relations as part of the physical design of
d. NUMBER(11,6)
the database. Which ones would you be most likely to
e. NUMBER(6)
implement?
f. NUMBER
5-37. Consider the following normalized relations for a sports
5-32. Suppose you are designing a default value for the age
league:
field in a student record at your university. What possible
values would you consider, and why? How might the de-
fault vary by other characteristics about the student, such
TEAM(TeamID, TeamName, TeamLocation,
as school within the university or degree sought?
TeamManager)
5-33. When a student has not chosen a major at a university,
PLAYER(PlayerID, PlayerFirstName, PlayerLastName,
the university often enters a value of “Undecided” for the
PlayerDateOfBirth, PlayerSpecialtyCode)
major field. Is “Undecided” a way to represent the null
SPECIALTY(SpecialtyCode, SpecialtyDescription)
value? Should it be used as a default value? Justify your
Salary)
answer carefully.
LOCATION(LocationID, CityName, CityState,
5-34. Consider the following normalized relations from a data-
CityCountry, CityPopulation)
base in a large retail chain:
MANAGER(ManagerID, ManagerName)
STORE (StoreID, Region, ManagerID, SquareFeet)
EMPLOYEE (EmployeeID, WhereWork, EmployeeName,
What recommendations would you make regarding
EmployeeAddress)
opportunities for denormalization? What additional in-
DEPARTMENT (DepartmentID, ManagerID, SalesGoal)
formation would you need to make fully informed denor-
SCHEDULE (DepartmentID, EmployeeID, Date)
malization decisions?

You might also like