You are on page 1of 7

Database Management System

Ch2 Exercise/Review questions’ Solution Guidelines


Chapter 2
1. Define the following terms: data model, database schema, database state, internal
schema, conceptual schema, external schema, data independence, DDL, DML, SDL, VDL,
query language, host language, data sublanguage, database utility, catalog, client/server
architecture, three-tier architecture, and n-tier architecture.
 Data model: a collection of concepts that can be used to describe the structure of a
database—provides the necessary means to achieve this abstraction. By structure of a
database we mean the data types, relationships, and constraints that apply to the data.
Most data models also include a set of basic operations for specifying retrievals and
updates on the database.
 Database schema: The description of a database is called the database schema, which is
specified during database design and is not expected to change frequently.
 Database State: is the data in the database at a particular moment in time
 Internal schema: describes the physical storage structure of the database. The internal
schema uses a physical data model and describes the complete details of data storage
and access paths for the database.
 Conceptual schema: describes the structure of the whole database for a community of
users. The conceptual schema hides the details of physical storage structures and
concentrates on describing entities, data types, relationships, user operations, and
constraints. Usually, a representational data model is used to describe the conceptual
schema when a database system is implemented. This implementation conceptual
schema is often based on a conceptual schema design in a high-level data model.
 External schema: The external or view level includes a number of external schemas or
user views. Each external schema describes the part of the database that a particular
user group is interested in and hides the rest of the database from that user group. As in
the previous level, each external schema is typically implemented using a
representational data model, possibly based on an external schema design in a high-
level conceptual data model.
 Data Independence: is capacity to change schema at one level without changing the
schema at higher level
 DDL Data Definition Language: used by DBA and developer to create DB With specific
Schema
 DML Data manipulation Language: Used to perform data manipulations: data addition,
retrieval, insertion, deletion, and modification
 SDL storage definition language: internal schema of the database
 VDL view definition language: specify user view and their mappings to conceptual
schema
 Query Language: is a high level data manipulation language stand alone interactive
manner
 Host Language: is general purpose programming which has either high level are low
level DML commands embedded in it.
 Data sublanguage: DML embedded in host language.

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
 Database Utility: software modules help DBA manage
 Catalog: complete description of the database structure and constraints
 Client/server architecture: Server Architecture database architecture which system
functionality: client model (application), server model (landless storage)
 Three-tier architecture: application, data, user interface
 n-tier architecture several tiers: The nth tier only has to know how to handle a request
from the n+1 tier and forward to n-1 tier

2. Discuss the main categories of data models. What are the basic differences among the
relational model, the object model, and the XML model?
 Data models:
o 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.)
o 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
o 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).
o Self-Describing Data Models:
 Combine the description of data with the data values. Examples include
XML, key-value stores and some NOSQL systems.

 Basic differences
o Relational: relations, same type data in columns
o Object: application interaction, classes, methods properties of classes
o XML Model: Hierarchical mode. Different types of data in same document. Data
no inherent ordering

3. What is the difference between a database schema and a database state?


 database schema is a description of the database and the database state (snapshot) is
the database it self
 The schema is sometimes called the intension, and a database state is called an
extension of the schema

4. Describe the three-schema architecture. Why do we need mappings among schema


levels? How do different schema definition languages support this architecture?

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
 Three-schema architecture is to separate the user applications and physical database:
o Internal schema at the internal level to describe physical storage structures and
access paths (e.g indexes).
 Typically uses a physical data model.
o 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.
o External schemas at the external level to describe the various user views.
 Usually uses the same data model as the conceptual schema.

 Mappings among schema levels are needed to transform requests and data.
o Programs refer to an external schema, and are mapped by the DBMS to the
internal schema for execution.
o Data extracted from the internal DBMS level is reformatted to match the user’s
external view (e.g. formatting the results of an SQL query for display in a Web
page)

5. What is the difference between logical data independence and physical data
independence? Which one is harder to achieve? Why?
 Logical data independence is the capacity to change the conceptual schema without
having to change external schemas are application programs. Change conceptual
schema to expand database. Only view definition and the mappings need to be changed
in a DBMS that supports logical data independence
 Physical data independence is the capacity to change the internal schema without
having to change the conceptual schema; hence the external schemas need not be
changed as well. For example, the internal schema may be changed when certain file
structures are reorganized or new indexes are created to improve database
performance

6. What is the difference between procedural and nonprocedural DMLs?


 Procedural DML is low level DML.
o Must be embedded in a general purpose language. Individual records are objects
from the database and process each separately.
o Retrieve data one record-at-a-time;
o Constructs such as looping are needed to retrieve multiple records, along with
positioning pointers.
 Non-procedural DML is called high level DML.
o May be used in a standalone way or may be embedded in a programming
language, These include the relational language SQL
o Are “set”-oriented and specify what data to retrieve rather than how to retrieve
it.

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
o Also called declarative languages.

7. Discuss the different types of user-friendly interfaces and the types of users who typically
use each.
 Menu-based (Web-based): Include list of options to choose from, popular for browsing
on the web. (End-user)
 Forms-based: designed for naïve users, used to filling in entries on a form(End-users)
 Graphics-based: Point and Click, Drag and Drop, etc. Specifying a query on a schema
diagram
 Natural language: requests in written English
 Combinations of the above: For example, both menus and forms used extensively in
Web database interfaces
 Speech: Input query and Output response
 Interfaces for parametric users: e.g., bank tellers using function keys.
 Interfaces for the DBA
o Creating user accounts, granting authorizations
o Setting system parameters
o Changing schemas or access paths

8. With what other computer system software does a DBMS interact?


 CASE(Computer-aided software engineering) tools for design of db
 Data dictionary, also called information repository for storing description decisions for
catalog data, schema and constraints.
 Directly accessed by DBA
 Application Development environment

9. What is the difference between the two-tier and three-tier client/server architectures?
 Two Tier: client (UI) and query server/transaction server. Upon connection transaction
and query request sent using Open Databases Connectivity's, API’s processed server
side. Specialized Servers with Specialized functions, Clients can access the specialized
servers as needed
 Three-tier architectures:
o Application or web layer between client and database.
o Application or web layer stores the web connectivity software and the business
logic part of the application used to access the corresponding data from the
database server
o Application or web layer acts like a conduit for sending partially processed data
between the database server and the client.

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
10. Discuss some types of database utilities and tools and their functions.
 Loading data stored in files into a database. Includes data conversion tools.
 Backing up the database periodically on tape.
 Reorganizing database file structures.
 Performance monitoring utilities.
 Report generation utilities.
 Other functions, such as sorting, user monitoring, data compression, etc.
 CASE tools: design phase

11. What is the additional functionality incorporated in n-tier architecture (n>3)?


 It is possible to divide the layers between the user and the stored data further into finer
components, thereby giving rise to n-tier architectures; where n may be four or five
tiers.
o Typically, the business logic layer is divided into multiple layers.
o Besides distributing programming and data throughout a network, n-tier
applications afford the advantage that any one tier can run on an appropriate
processor or operating system platform and can be handled independently.
o Vendors of ERP (enterprise resource planning) and CRM (customer relationship
management) packages often use a middleware layer, which accounts for the
front-end modules (clients) communicating with a number of back-end
databases (servers).

12. Think of different users for the database shown in Figure 1.2. What types of applications
would each user need? To which user category would each belong, and what type of
interface would each need?
 Different types of users for the database are:
o STUDENT can access into the student portal and can check their personal data
and can have their ID numbers, course name, course code, data and time for
classes and exams, and their grades.
o PROFESSOR can access into his account and can see the data of all students. Can
see their subjects and courses. Professors can give the grades to the students
and he can change the details of student if necessary. Professor can only change
enrolment of the student. And the data will be updated.
o ADMINISTRATOR can have all rights to access to every student data and can
change their data if student requested. But Administrator cannot change the
grade of a student given by the Professor.
o Users of admission office
o Users of Transcripts office
o Front Office users

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
13. Choose a database application with which you are familiar. Design a schema and show a
sample database for that application, using the notation of Figures 1.2 and 2.1. What
types of additional information and constraints would you like to represent in the
schema? Think of several users of your database, and design a view for each.

Consider Flight Reservation system


 Each flight is identified by Number, and consists of one or more FLIGHT_LEGs with
Leg_no. And flies on certain weekdays.

PIPFA Teacher: Mr. Bilal Munir Mughal


Database Management System
Ch2 Exercise/Review questions’ Solution Guidelines
 Each FLIGHT_LEG has scheduled arrival and departure time and arrival and departure
airport and one or more LEG_INSTANCEs – one for eachDate on which flight travels.
 FARE is kept for each flight and there are certain set of restrictions on FARE.
 For each FLIGHT_LEG instance, SEAT_RESERVATIONs are kept, as are AIRPLANE used on
each leg and the actual arrival and departure times and airports.
 AIRPLANE is identified by an airplane id, and is of a particular AIRPLANE_TYPE. It has a
fixed no. of seats.
 CAN_LAN relates AIRPLANE_TYPE to the AIRPORTS at which they can land.
 AIRPORT is identified by airport code.

14. If you were designing a Web-based system to make airline reservations and sell airline
tickets, which DBMS architecture would you choose from Section 2.5? Why? Why would
the other architectures not be a good choice?
 Designing a web-based system to make airline reservations and sell airline tickets with
Basic Client/Server Architecture is more secured than using Centralized DBMSs
Architecture. In case of using Client architecture we can have individual details of the
each client. Their database can access with client permission. If any request is sent to
the Client architecture it immediately responds to the request.
 And in centralized architecture any client can see other clients’ details. This will effect
on the original client details such as their surnames, payment details, and phone
numbers etc. This is why Client/Server is good choice of architecture than DBMSs
architecture.

15. Consider Figure 2.1. In addition to constraints relating the values of columns in one table
to columns in another table, there are also constraints that impose restrictions on values
in a column or a combination of columns within a table. One such constraint dictates that
a column or a group of columns must be unique across all rows in the table. For example,
in the STUDENT table, the Student_number column must be unique (to prevent two
different students from having the same Student_number). Identify the column or the
group of columns in the other tables that must be unique across all rows in the table.

 In the Course table the COURSE_NUMBER should be unique.


 In the Section table SECTION_IDENTIFIER should be unique.

PIPFA Teacher: Mr. Bilal Munir Mughal

You might also like