chap no: 04 advanced relational database course title: database-ii 1

20
Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

Upload: morgan-sims

Post on 02-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

1

Chap No: 04 Advanced Relational Database

Course Title:Database-ii

Page 2: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

2

Relational Database

• A relational database is a method of storing data in tables containing information grouped by entity or object which the data describes.

• The database is called relational because each table can have relationships with other tables based on a shared piece of information.

• The relationship can be simply a reference or a parent/child association.

Page 3: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

3

Relational Database Schema

• There are different kinds of databases. One is a flat file database, which similar to a spreadsheet with rows and columns. A phone book is a flat file database. Another kind of database is a relational database. This has a structure of smaller, interrelated parts called tables. Common elements join the tables together.

• For example, a medical database can have a patient table, an insurance table and a diagnosis table. However, a common schema, such as the patient and medical condition, ties them together.

Page 4: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

4

Relational Database Schema

• A relational database schema specifies a collection of tables.

• This provides a working structure for the data housed in the database instance.

• Each table references another table like a chain by having a common element between the tables.

• The schema does not exist through one table, but from all of them together acting to describe the data for building a database.

Page 5: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

5

Benefits of the Relational Database

• A relational database is one of the most popular ways to store large amounts of data.

• The method in which the data is organized in a relational database makes it much easier for users to understand that data.

• It allows information to be easily grouped or compared by type, such as year or name.

Page 6: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

6

Functions

• Relational databases offer a wide array of functions that create advanced data manipulation techniques.

• They support relational algebra as well as set operations.• This includes operations to select, join and divide. Many

of these operations are possible only with relational databases.

• This data manipulation is possible with the use of queries, generally in Structured Query Language (SQL), to manage the data and give users the information they are looking for.

Page 7: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

7

Efficiency• Efficiency is one of the benefits to a relational

database. Because of the ways in which data can be compared and combined, each piece of data needs to be saved in only one place.

• This is related to the process of normalizing the database, which eliminates the need for duplicate data. Since each piece of data is saved in only one location, it is much easier and quicker to update.

• The language used to create the database, SQL, can also validate date entry.

Page 8: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

8

Views• Because relational databases are highly customizable,

users can present data in any way they wish.• One of the most important concepts of the database is

known as a view.• Although the data is stored in tables, which may never

change attributes, users can customize or delete a view easily without affecting the data.

• Views manipulate the data to present the important pieces that users would like to see, while removing the unnecessary data that is not used.

• This is similar to copying and pasting the important parts of documents into one file.

Page 9: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

9

User-Friendly

• Relational databases store data in tables, which are linked together with key values that give a clear relationship between the tables. The linking of tables by key values makes it easy to diagram those tables so that users can see all relationships. The support for SQL, which is similar to writing statements in English, also makes relational databases user-friendly. As stated in the article "Introduction to SQL" from Devarticles, "SQL statements look like simple English sentences, making SQL easy to learn and understand. This is in part because SQL statements describe the data to be retrieved, rather than specifying how to find the data.”

Page 10: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

10

FeaturesOf

advanced relational database management systems

Page 11: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

11

Query ability• Querying is the process of requesting attribute

information from various perspectives and combinations of factors.

• Example: "How many 2-door cars in Texas are green?" A database query language and report writer allow users to interactively interrogate the database, analyze its data and update it according to the users privileges on data.

Page 12: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

12

Backup and replication• Backup and replication Copies of attributes need to be

made regularly in case primary disks or other equipment fails.

• A periodic copy of attributes may also be created for a distant organization that cannot readily access the original.

• DBMS usually provide utilities to facilitate the process of extracting and disseminating attribute sets.

• When data is replicated between database servers, so that the information remains consistent throughout the database system and users cannot tell or even know which server in the DBMS they are using, the system is said to exhibit replication transparency.

Page 13: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

13

Rule enforcement• Rule enforcement Often one wants to apply rules to

attributes so that the attributes are clean and reliable.• For example, we may have a rule that says each car can

have only one engine associated with it (identified by Engine Number).

• If somebody tries to associate a second engine with a given car, we want the DBMS to deny such a request and display an error message.

• However, with changes in the model specification such as, in this example, hybrid gas-electric cars, rules may need to change.

• Ideally such rules should be able to be added and removed as needed without significant data layout redesign.

Page 14: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

14

Security

• Security For security reasons, it is desirable to limit who can see or change specific attributes or groups of attributes.

• This may be managed directly on an individual basis, or by the assignment of individuals and privileges to groups, or (in the most elaborate models) through the assignment of individuals and groups to roles which are then granted entitlements.

Page 15: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

15

Advanced DBMS• An example of an advanced DBMS is

Distributed Data Base Management System (DDBMS), a collection of data which logically belong to the same system but are spread out over the sites of the computer network.

Page 16: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

16

Advanced DBMS

• The two aspects of a distributed database are distribution and logical correlation:

• Distribution: The fact that the data are not resident at the same site, so that we can distinguish a distributed database from a single, centralized database.

• Logical Correlation: The fact that the data have some properties which tie them together, so that we can distinguish a distributed database from a set of local databases or files which are resident at different sites of a computer network.

Page 17: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

17

Concurrency control• Concurrency control in

Database management systems ensures that database transactions are performed concurrently without violating the data integrity of the respective databases.

• In information technology and computer science, especially in the fields of computer programming , operating systems , multiprocessors, and databases, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.

Page 18: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

18

Concurrency control

• The general area of concurrency control provides rules, methods, design methodologies, and theories to maintain the consistency of components operating concurrently while interacting, and thus the consistency and correctness of the whole system.

• Introducing concurrency control into a system means applying operation constraints which typically result in some performance reduction.

Page 19: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

19

Transaction

• Every database transaction obeys the following rules (by support in the database system;

• A transaction must transform a relational database from one consistent state to another consistent state.

• Consistency - Every transaction must leave the relational database in a consistent (correct) state, i.e., maintain the predetermined integrity rules of the database (constraints upon and among the database's objects).

Page 20: Chap No: 04 Advanced Relational Database Course Title: Database-ii 1

20

Transaction

• Isolation - Transactions cannot interfere with each other.

• Moreover, usually (depending on concurrency control method) the effects of an incomplete transaction are not even visible to another transaction.

• Providing isolation is the main goal of concurrency control.