some question on chapter one and two

advertisement
1.7 Give some informal queries and updates that you would expect to apply to the
database shown in Figure 1.2.
Answer:
(a) (Query) List the names of all students majoring in Computer Science.
(b) (Query) What are the prerequisites of the Database course?.
(c) (Query) Retrieve the transcript of Smith. This is a list of <CourseName,
SectionIdentifier, Semester, Year, Grade> for each course section that Smith has
completed.
(d) (Update) Insert a new student in the database whose Name=Jackson,
StudentNumber=23, Class=1 (freshman), and Major=MATH.
(e) (Update) Change the grade that Smith received in Intro to Computer Science section
119 to B.
1. 8 What is the difference between controlled and uncontrolled redundancy?
Answer:
Redundancy is when the same fact is stored multiple times in several places in a
database. For example, in Figure 1.5(a) the fact that the name of the student with
StudentNumber=8 is Brown is stored multiple times . Redundancy is controlled when the
DBMS ensures that multiple copies of the same data are consistent; for example, if a new
record with StudentNumber=8 is stored in the database of Figure 1.5(a), the DBMS will
ensure that StudentName=Smith in that record. If the DBMS has no control over this, we
have uncontrolled redundancy.
1. 9 Give all the relationships among the records of the database shown in Figure 1.2.
Answer:
(a) Each SECTION record is related to a COURSE record.
(b) Each GRADE_REPORT record i s related to one STUDENT record and one SECTION
record.
(c) Each PREREQUISITE record relates two COURSE records: one in the role of a course
and the other in the role of a prerequisite to that course.
1.10 Give some additional views that may be needed by other user groups for the
database shown in Figure 1.2.
Answer:
A view that groups all the students who took each section and gives each student's grade. This may
be useful for printing the grade report for each section for the
university administration's use.
(b) A view that gives the number of courses taken and the GPA (grade point average) for
each student. This may be used to determine honors students.
1.11 Give some examples of integrity constraints that you think should hold on the
database shown in Figure 1.2.
Answer:
We give a few constraints expressed in English. Following each constraint, we give its
type in the relational database terminology that will be covered in Chapter 6, for
reference purposes.
(a) The StudentNumber should be uni que for each STUDENT record (key constraint).
(b) The CourseNumber should be unique for each COURSE record (key constraint).
(c) A value of CourseNumber in a SECTION record must also exist in some COURSE
record (referential integrity constraint).
(d) A value of StudentNumber in a GRADE_REPORT record must also exist in some
STUDENT record (referential integrity constraint).
(e) The value of Grade in a GRADE_REPORT record must be one of the values in the set
{A, B, C, D, F, I, U, S} (domain constraint).
(f) Every record in COURSE must have a value for CourseNumber (entity integrity
constraint).
(g) A STUDENT record cannot have a value of Class=2 (sophomore) unless the student
has completed a number of sections whose total course CreditHours is greater th at 24
credits (general semantic integrity constraint).
2.2.What is data model, Discuss the main categories of data models?
 Data Model:
A set of concepts to describe the structure of a database, the operations for manipulating these
structures, and certain constraints that the database should obey.
 Conceptual (high-level, semantic) data models:
 Provide concepts that are close to the way many users perceive data.
 (Also called entity-based or object-based data models.)
 Physical (low-level, internal) data models:
 Provide concepts that describe details of how data is stored in the computer. These
are usually specified in an ad-hoc manner through DBMS design and administration
manuals
 Implementation (representational) data models:
 Provide concepts that fall between the above two, used by many commercial DBMS
implementations (e.g. relational data models used in many commercial systems).
2.3. What is the difference between a database schema and a database state?
 Database Schema:
 The description of a database.
 Includes descriptions of the database structure, data types, and the constraints on
the database.
 Schema Diagram:
 An illustrative display of (most aspects of) a database schema.
 Schema Construct:
 A component of the schema or an object within the schema, e.g., STUDENT,
COURSE.
 Database State:
 The actual data stored in a database at a particular moment in time. This includes
the collection of all the data in the database.
 Also called database instance (or occurrence or snapshot).
The term instance is also applied to individual database components, e.g. record instance, table
instance, entity instance
2.4. Describe the three-schema architecture. Why do we need mappings between
schema levels? How do different schema definition languages support this architecture?
 Defines DBMS schemas at three levels:
 Internal schema at the internal level to describe physical storage structures and
access paths (e.g indexes).
 Typically uses a physical data model.
 Conceptual schema at the conceptual level to describe the structure and constraints
for the whole database for a community of users.
 Uses a conceptual or an implementation data model.
 External schemas at the external level to describe the various user views.
 Usually uses the same data model as the conceptual schema.
2.5. What is the difference between logical data independence and physical data
independence?
 Logical Data Independence:
 The capacity to change the conceptual schema without having to change the
external schemas and their associated application programs.
 Physical Data Independence:
 The capacity to change the internal schema without having to change the
conceptual schema.
For example, the internal schema may be changed when certain file structures are
reorganized or new indexes are created to improve database performance
2.6. What is the difference between procedural and nonprocedural DMLs?
 Data Manipulation Language (DML)
 High-Level or Non-procedural Languages: These include the relational language
SQL
 May be used in a standalone way or may be embedded in a programming
language
 Low Level or Procedural Languages:
 These must be embedded in a programming language
2.9. What is the difference between the two-tier and three-tier client/server architectures?
In Basic 2-tier Client-Server Architectures
 Specialized Servers with Specialized functions
 Print server
 File server
 DBMS server
 Web server
 Email server
 Clients can access the specialized servers as needed

 Three Tier Client-Server Architecture
 Common for Web applications
 Intermediate Layer called Application Server or Web Server:
 Stores the web connectivity software and the business logic part of the application used to
access the corresponding data from the database server
 Acts like a conduit for sending partially processed data between the database server and
the client.
 Three-tier Architecture Can Enhance Security:
 Database server only accessible via middle tier
 Clients cannot directly access database server

Download