Uploaded by sanchitashah012

394350182-Homework

advertisement
Review Questions
1-1. Define each of the following terms:
a. Data - Data is a stored representation of objects and events that have meaning and
importance in the user's environment.
b. Information - Information is data that have been processed in such a way that the
knowledge of the person who uses the data
c. Metadata - Metadata is data that describe the properties or characteristics of end-user data
and the context of those data.
d. Enterprise resource planning - Enterprise resource planning (ERP) is a business
management system that integrates all functions of the enterprise, such as manufacturing,
sales, finance, marketing, inventory, accounting. and human resources. ERP systems are
software programs that provide the data for an organization to examine and manage its
operations.
e. Data warehouse - Data warehouse is an integrated decision support database whose
content is derived from the various operational databases
f. Constraint - A constraint is a rule that cannot be violated by database users.
g. Database - A database is an organized collection of logically related data, usually designed
to meet the information needs of multiple users in an organization.
h. Entity - Entity describes a person, a place, an object, an event, or a concept in the business
environment for which information must be recorded and retained.
i. Database management system - A database management system (DBMS) is a software
system that is used to create, maintain, and provide controlled access to user databases.
j. Data lake - Data lake is a large integrated repository for internal and external data that does
not follow a predefined schema.
k. Systems development life cycle - Systems development life cycle (SDLC) is the
traditional methodology used to develop, maintain, and replace information systems.
l. Prototyping - Prototyping is an iterative process of systems development in which
requirements are converted to a working system that is continually revised through close
work between analysts and users.
m. Enterprise data model - Enterprise data model is the first step in database development,
in which the scope and general contents of organizational databases are specified.
n. Conceptual data model - Conceptual data model is a detailed technology-independent
specification of the overall structure of organizational data.
o. Logical data model - Logical data model is the representation of a database for a
particular data management technology.
p. Physical data model - Physical data model Specifications for how data from a logical
schema are stored in a computer's secondary memory by a database management system.
1-2. Match the following terms and definitions:
1. agile software
2. database application
3. constraint
4. repository
5. metadata
6. data warehouse
a. data placed in context or development
summarized (5)
b. application program(s) (9)
c. iterative, focused on working software and
customer collaboration (1)
d. a graphical model that shows the high-level
entities for the organization and the
relationships among those entities (15)
7. information
8. user view
e. a real-world person or object about which
the organization wishes to maintain data (11)
9. database management system
f. includes data definitions and constraints (7)
10. data independence
g. centralized storehouse for all data definition
(4)
11. entity
12. enterprise resource planning
13. systems development life cycle
h. separation of data description from
programs (10)
14. prototyping
i. a business management system that
integrates all functions of the enterprise (12)
15. enterprise data model
J· logical description of portion of database (8)
16. conceptual schema
k. a software application that is used to create,
maintain, and provide controlled access to user
databases (2)
17. internal schema
18. external schema
I. a rule that cannot be violated by database
users (3)
m. integrated decision support database (6)
n. consist of the enterprise data model and
multiple user views (18)
o. a rapid approach to systems development
(14)
p. consists of two data models: a logical model
and a physical model (17)
q. a comprehensive description of business
data (16)
r. a structured, step-by-step approach to
systems development (13)
1-7. List the nine major components in a database system environment
1. Data modeling and design tools
2. Repository
3. DBMS
4. Database
5. Application programs
6. User interface
7. Data and database administrators
8. System developers
9. End users
1-8. How are relationships between tables expressed in a relational database?
Tables are the basic building blocks of a relational database which is the database style for
Microsoft Access. The tables are created using SQL. It is customary to add the suffix _T to a
table name. Access does not allow for spaces between names, so the individual words in the
attributes from the data model have now been concatenated. Hence, Product Description in
the data model has become ProductDescription in the table. Each table had an attribute, called
the table's "primary key," which will be distinct for each row in the table. The other major
properties of each table are that there is only one value for each attribute in each row; if the
value of the identifier is known, there can be only one value for each of the other attributes.
For example, for any product line, there can be only one value for the current year's sales
goal. A final key characteristic of the relational model is that it represents relationships
between entities by values stored in the columns of the corresponding tables.
For example, notice that CustomerID is an attribute of both the Customer table and the Order
table. As a result, it can easily link an order to its associated customer. The key physical
database design decision that SQL allows a database designer to make is on which attributes
to create indexes. All primary key attributes those with unique values across the rows of the
table-are indexed.
By using primary and foreign keys, relational databases establish relationships between
tables. These relationships can be categorized into three main types:
One-to-One (1:1): Each record in one table is associated with only one record in another
table.
One-to-Many (1:N): Each record in one table can be associated with multiple records in
another table, but each record in the second table is associated with only one record in the
first table.
Many-to-Many (N:M): Multiple records in one table can be associated with multiple records
in another table, creating a many-to-many relationship. This is typically implemented using
an intermediary table that contains foreign keys from both tables.
By establishing these relationships using keys, relational databases can efficiently store and
retrieve related data from multiple tables, providing a foundation for data integrity and data
consistency.
1-13. Figure 1-5 specifies categories for Operational and Informational data
management systems. Describe the main difference between these two categories.
There are three key classes: Analytical-Big Data falls under the informational category, while
transactional falls under the operational category.
A significant contrast between enormous information frameworks contrasted with the two
information warehousing and functional, exchange centered frameworks is that designs of the
last option are regularly expected to be painstakingly planned before information are put
away in them ("diagram on compose"), though large numbers of the huge information
examination advancements are expected to be utilized in the "mapping on read" mode. In the
last option approach, the construction of the information and the connections between the
information components will be resolved later, either just previously or at the hour of the
utilization of the information.
Infrastructure is a further distinction between the data management systems. Relational
databases are physically designed as part of operational design; Security; The use of the
cloud. On the other hand, big data technologies like Hadoop and NoSQL exist.
1-14. Based on Figure 1-5, what are the four perspectives from which you will explore
transactional systems in this book? What are the main competencies associated with
each of these perspectives?
The four perspectives from which you will explore transactional systems in this book are
Modeling, Design, Infrastructure and Access.
Modeling: Conceptual data modeling with (E)ER
Design: Logical data modeling with the relational model, Normalization
Infrastructure: Physical design of relational databases, Security, Cloud computing
Access: SQL, Applications with SQL
Problems and Exercises
1-27. For each of the following pairs of related entities, indicate whether (under typical
circumstances) there is a one-to-many or a many-to-many relationship. Then, using the
shorthand notation introduced in the text, draw a diagram for each of the relationships.
a. STUDENT and COURSE (students register for courses)
b. BOOK and BOOK COPY (books have copies)
c. COURSE and SECTION (courses have sections)
d. SECTION and ROOM (sections are scheduled in rooms)
e. INSTRUCTOR and COURSE
f. COURSE and SEMESTER
g. MEAL and COURSE
STUDENT
BOOK
COURSE
COURSE
BOOK COPY
SECTION
SECTION
INSTRUCTOR
ROOM
MEAL
COURSE
COURSE
COURSE
SEMESTER
a. STUDENT and COURSE - Typically, there is a one-to-many relationship between STUDENT
and COURSE, where a student can register for multiple courses, but each course has multiple
students.
b. BOOK and BOOK COPY - Typically, there is a one-to-many relationship between BOOK and
BOOK COPY, where a book can have multiple copies, but each copy belongs to only one book
c. COURSE and SECTION - Typically, there is a one-to-many relationship between COURSE and
SECTION, where a course can have multiple sections, but each section belongs to only one
course.
d. SECTION and ROOM - Typically, there is a one-to-many relationship between SECTION and
ROOM, where a section is scheduled in one room, but each room can host multiple sections.
e. INSTRUCTOR and COURSE - Typically, there is a many-to-many relationship between
INSTRUCTOR and COURSE, where an instructor can teach multiple courses, and each course
can have multiple instructors.
f. COURSE and SEMESTER - Typically, there is a one-to-many relationship between COURSE
and SEMESTER, where a course can be offered in multiple semesters, but each semester
contains multiple courses.
g. MEAL and COURSE - Typically, there is a many-to-many relationship between MEAL and
COURSE, where a meal can contain multiple courses, and each course can be part of multiple
meals.
1-29. Table 1-1 shows example metadata for a set of data items. Identify three other
columns for these data (i.e., three other metadata characteristics for the listed
attributes) and complete the entries of the table in Table 1-1 for these three additional
columns.
Name
Type
Length
Course
Alphanumeric
30
Section
Integer
1
Semester
Alphanumeric
10
Name
Alphanumeric
30
ID
Integer
9
Major
Alphanumeric
4
GPA
Decimal
3
Min
1
0.0
Max
9
4.0
Descript
ion
Course ID
and name
Section
number
Semester
and year
Student
name
Student
ID (SSN)
Student
major
Student
grade
point
average
Source
Required
Student
grade point
average
Registrar
Yes
Data entry
Date
01/06/2023
Yes
01/06/2023
Good
Registrar
Yes
01/06/2023
Good
Student IS
Yes
02/06/2023
Good
Student IS
Yes
02/06/2023
Good
Student IS
Yes
02/06/2023
Good
Academic
Unit
Yes
02/06/2023
Good
Additional three columns are: Required, Data entry Date and Data Quality
Data
Quality
Good
1-34. Figure 1-22 shows an enterprise data model for a music store.
a. What is the relationship between Album and Store (one-to-one, many-to-many, or
one-to-many)?
b. What is the relationship between Artist and Album?
c. Do you think there should be a relationship between Artist and Store? Describe at
least one possible scenario that could justify such a relationship.
STORE
Has
Sold by
Produces
ARTIST
ALBUM
Produced by
Fig 1-22
a. The relationship between Album and Store is One-to-many
b. the relationship between Artist and Album One-to-many
c. It is possible to have a relationship between Artist and Store, such as a many-to-many
relationship where an artist can have multiple albums sold in multiple stores, and a store can
sell albums from multiple artists.
This relationship may be justified in scenarios where the store specializes in selling music
from a particular artist or group of artists, or when the artist has an exclusive merchandising
agreement with the store. Additionally, if the store allows customers to purchase digital
downloads of the artist's music, it may be useful to link the artist to the store in order to
facilitate digital rights management and royalty payments.
1-46. Answer the following questions concerning Figures 1-18 and 1-19:
a. What will be the field size for the ProductLineName field in the Product table? Why?
b. In Figure 1-19, how is the ProductID field in the Product table specified to be
required? Why is it a required attribute?
c. In Figure 1-19, explain the function of the FOREIGN KEY definition.
d. In Figure 1-19, explain the purpose of the NOT NULL specification associated with
ProductID.
a. The field size for the ProductLineName field in the Product table is not explicitly specified
in the figure.
b. The ProductID field in the Product table is specified to be required by the NOT NULL
constraint that is associated with its definition. This means that every record in the Product
table must have a value in the ProductID field.
This is a required attribute because it is the primary key for the Product table, which means it
uniquely identifies each record in the table. Without a primary key, the table cannot enforce
data integrity or perform efficient queries.
c. The FOREIGN KEY definition in the Product table specifies a referential constraint that
ensures that the value in the ProductlineID column of each record in the Product table
matches a value in the Productline_T table. This is accomplished by referencing the primary
key of the Productline_T table (i.e., ProductlineiD) as a foreign key in the Product table. The
FOREIGN KEY definition enforces referential integrity between the two tables, ensuring that
every value in the ProductlineID column of the Product table refers to an existing record in
the Productline_T table.
d. The NOT NULL specification associated with the ProductID field ensures that every
record in the Product table has a value for this field. Since ProductID is the primary key for
the Product table, it cannot have a null value. If the ProductID field is not specified as NOT
NULL, then it would be possible to insert records into the Product table with null values for
this field, which would violate data integrity rules and prevent the table from being efficiently
queried.
1-47. Consider the SQL query in Figure 1-20.
a. How is Sales to Date calculated?
b. How would the query have to change if Helen Jarvis wanted to see the results for all
of the product lines, not just the Home Office product line?
c. The part of the query starting with WHERE (the so called WHERE clause) has two
different types of conditions-the last one is clearly different from the first three. Explain
how.
a. Sales to Date is calculated by multiplying the Order Quantity by the Product Price for each
record in the Order line and then summing the resulting values for all records that satisfy the
conditions specified in the WHERE clause. This is accomplished by using the multiplication
operator (*) and the SUM aggregation function in the SELECT clause.
This expression calculates the total sales amount for each order line.
b. To see the results for all of the product lines, not just the Home Office product line, the
WHERE clause would need to be modified to remove the condition that restricts the Product.
Productline Name to 'Home Office'. The modified query would look like this:
SELECT Product.ProductID, Product.ProductDescription, Product.PRCurrentYearSalesGoal,
(order Quantity * ProductPrice) AS SalesToDate
FROM Order.Orderline, Product.ProductUne
WHERE Order.OrderNumber = Orderline.OrderNumber
AND Product.ProductID = OrderedProduct.ProductID
AND Product.ProductID = Productline.ProductID;
c. The first three conditions in the WHERE clause use equality operator (=) to compare
specific fields from different tables. These conditions specify the relationships between tables
by comparing the corresponding fields (OrderNumber, ProductID, and ProductlineName) to
determine which records should be included in the result. These conditions filter the records
based on the matching values between the tables.
The last condition in the WHERE clause is a comparison condition. It uses the comparison
operator to compare the value of Product.ProductID with Productline.ProductID. This
condition is used to further filter the result set based on the matching ProductID values
between the Product and Productline tables. It ensures that only the records with matching
Product ID values from both tables are included in the result.
In summary, the first three conditions establish relationships between tables using equality
operators, while the last condition filters the result set based on a comparison of ProductID
values.
Download