Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts.

Similar presentations


Presentation on theme: "Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts."— Presentation transcript:

1 Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts

2 Introduction In this lesson, an introduction to the relational database model is provided. Description of the main building blocks of a relational database and its definition.

3 Learning Outcomes Understand how a relation (table) is the main organization unit of a database. Understand the main building blocks of a relational database and its definition

4 Terminology Domain A set of values that define the value range for an attribute. Attribute The basic unit in a relation (table) definition. Each attribute has a domain associated with it.

5 Terminology (Cont.) Relation Schema (Table Schema ) Defines the structure of a relation (table) which consists of a set of attributes and an association between each attribute and its domain Relational Database Schema A collection of relation (table) schemas

6 Terminology (Cont.) Tuple (record/row) A list of values with each value being an element in a domain or NULL. A tuple represent a record or row in a table (relation). Relation (Table) An instance of a relation schema which is composed of a set of tuples

7 Terminology (Cont.) Database A collection of relations (tables).

8 Introduction to the Relational Database Model As discussed in the previous lecture, the relational database model is the most widely used data model in DBMSs. It was developed by E. F. Codd at IBM in 1970.

9 Introduction to the Relational Database Model (Cont.) The relational database model is based on organizing data with the basic organization unit being a relation that is represented as a table.

10 Relational Database Concepts Domain: is a set of values that define the value range for an attribute. A domain can be considered as a data type. Examples of domains include integer, float, string, date, etc.

11 Relational Database Concepts (Cont.) Relation Schema (Table Schema): defines the structure of a relation (table) which consists of a set of attributes and an association between each attribute and its domain (specifying the possible values of an attribute). Relational Database Schema: that is a collection of relation (table) schemas.

12 Relational Database Concepts (Cont.) Attribute: is the basic unit in a relation (table) definition. Each attribute has a domain associated with it. It can be considered as a column in relational database table.

13 Relational Database Concepts (Cont.) Tuple (Record/row): that is a list of values with each value being an element in a domain or NULL. A tuple represent a record or row in a table (relation).

14 Relational Database Concepts (Cont.) Relation (Table): is one instance of a relation schema which is composed of a set of tuples. Relational Database: is a collection of relations (tables).

15

16 Figure 5.1 illustrates the definition of Library database. A database schema is defined which consists of two relation (table) schemas: Books and Members. As shown in the books table schema in Figure 5.1, the schema defines the structure of the table specifying the attributes of the table (book_Id, title, author, publisher and publication_date).

17 Each attribute is associated with a domain in the schema, e.g. attribute title has domain text which specifies that values of attribute title are of type text.

18

19 Figure 5.2 illustrates the library database instance. It can be seen that the library database consists of two relations (tables): books and members. The books table is an instance of the books table schema shown in Figure 5.1.

20 The books table consists of tuples (records/rows). Each tuple is composed of values for the attributes defined in the table schema.

21 Each value in a table tuple is part of the domain associated with the corresponding attribute in the table schema. For example, value ‘A Tale of Two Cities’ in the 1 st tuple of the book table is a value of attribute title with domain text as defined in the table schema (shown in Figure 5.1).

22 Summary An Introduction to the Relational Database Model The main relational database concepts.


Download ppt "Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts."

Similar presentations


Ads by Google