0% found this document useful (0 votes)
18 views

Lec 2

Uploaded by

Aly Hosni
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)
18 views

Lec 2

Uploaded by

Aly Hosni
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/ 19

• The Table : is the vessel that contains a set of data of a certain

topic where data are stored with the aim of retrieving them in
the time of need, in a number of ways.
• For example, the table of the data for the students or the
table of a certain Course in a university.

Figure 1-4 examples of a table


• The Record: the place (row) where the integrated data are
stored.
• For example, all the data of a certain student (Name,
number, class, and major).

A record

A record

Figure 1-5 an example of a record


• The Field: the place (column) where one kind of data is stored
such as the data of (student Name - number ... etc).

A field

Figure 1-6 an example of a field


• Now, it is clear that the table or the file consists of a group of
records and the single record consists of a group of fields where
data are stored. So, what is a database?
• Database: a group of organized data associated with a certain
topic inside a table or tables with the purpose of retrieving
them to make the required decisions.
• For example: the data of student in a university (personal
history file, financial file, and course file).
Figure 1-7 data hierarchy
• Database technology can cut through many of the
problems a traditional file organization creates.
• A more precise definition of a database is a collection of
data organized to serve many applications efficiently by
centralizing the data and controlling redundant data.
• Rather than storing data in separate files for each
application, data are stored so as to appear to users as
being stored in only one location. A single database
services multiple applications.
• For example, instead of a corporation storing employee
data in separate information systems and separate files for
personnel, payroll, and benefits, the corporation could
create a single common human resources database
Figure 1-8 Database Environment

• Single human resources database servers multiple applications and


also enables a corporation to easily draw together all the
information for various applications.
• The Database Management System acts as the interface between the
application programs and the data.
• A (DBMS) is simply the software that permits an organization to
centralize data, manage them efficiently, and provide access to the
stored data by application programs.
• The DBMS acts as an interface between application programs and
the physical data files.
• When the application program calls for a data item, such as
gross pay, the DBMS finds this item in the database and
presents it to the application program.
• The most popular type of DBMS today for PCs as well as for larger
computers and mainframes is the Relational DBMS.
• The relational data model store data in a form of tables.
• Each table is concerned with a certain topic.
• There are relationships between these tables.

• Tables may be referred to as files. Information in more than one file


can be easily extracted and combined.
• In each table, the rows represent unique records or in very technical
terms, as tuples and the columns represent fields, or the attributes that
describe the entities.
• Often a user needs information from a number of relations to produce a
report or answer a query.
• Here is the strength of the relational model: It can relate data in any
one file or table to data in another file or table as long as both tables
share a common data element (which is called Foreign Key discussed
in details later).
Figure 1.09 Relational Database Model Example
Answer this question: find the names and addresses of suppliers who could
provide us with part number 137 and part number 152.
Figure 1.10 Relational Database Model Request Example
Database Example
Let us consider a simple example that most readers may be
familiar with: a UNIVERSITY database for maintaining
information concerning students, courses, and grades in a
university environment.
Figure 1.11 shows the database structure and a few sample data
for such a database.
The database is organized as five files, each of which stores
data records of the same type (Record Type):
The STUDENT file stores data on each student,
the COURSE file stores data on each course,
the SECTION file stores data on each section of a course,
the GRADE_REPORT file stores the grades that students
receive in the various sections they have completed, and
the PREREQUISITE file stores the prerequisites of each
course.
Figure 1-11
A database that stores
student and course
information.
To define this database, we must specify the structure of the
records of each file by specifying the different types of data
elements to be stored in each record.
In Figure 1.11 ,
each STUDENT record includes data to represent the student’s
Name, Student_number, Class (such as freshman or ‘1’,
sophomore or ‘2’, and so forth), and Major (such as
mathematics or ‘MATH’ and computer science or ‘CS’);
Each COURSE record includes data to represent the
Course_name, Course_number, Credit_hours, and Department
(the department that offers the course); and so on.
We must also specify a data type for each data element within a
record. For example, we can specify that:
Name of STUDENT is a string of alphabetic characters,
Student_number of STUDENT is an integer, and
Grade of GRADE_REPORT is a single character from the set {‘A’,
‘B’, ‘C’, ‘D’, ‘F’, ‘I’}.
We may also use a coding scheme to represent the values of a data
item.
For example, in Figure 1.11 we represent the Class of a STUDENT
as 1 for freshman, 2 for sophomore, 3 for junior, 4 for senior, and 5
for graduate student.
To construct the UNIVERSITY database, we store data to represent
each student, course, section, grade report, and prerequisite as a
record in the appropriate file.
Notice that records in the various files may be related. For
example:
the record for Smith in the STUDENT file is related to two
records in the GRADE_REPORT file that specify Smith’s
grades in two sections.
Similarly, each record in the PREREQUISITE file relates two
course records: one representing the course and the other
representing the prerequisite.
Most medium-size and large databases include many types of
records and have many relationships among the records.
Design of a new application for an existing database or design of a
brand new database starts off with a phase called (1) Requirements
Specification and Analysis.
These requirements are documented in detail and transformed into a (2)
conceptual design that can be represented and manipulated using
some computerized tools so that it can be easily maintained, modified,
and transformed into a database implementation.
The conceptual design is then translated to a (3) logical design that can
be expressed in a data model implemented in a commercial DBMS.
In this course we will study a data model known as the Relational
Data Model. (Figure 1.9, 1.10)
It is currently the most popular approach for designing and
implementing databases using relational DBMSs.
The final stage is (4) physical design, during which further
specifications are provided for storing and accessing the database.
The database design is implemented, and populated with actual data,
and continuously maintained to reflect the state of the mini world.
Figure 1.12 Stages of database design Figure 1.13 Conceptual and Logical design

Figure 1.14 Different Schemas are Based on Different Concepts


End of Lecture_2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy