presentation dbms (1)

32

Upload: ali-raza

Post on 22-Jul-2015

220 views

Category:

Technology


0 download

TRANSCRIPT

Database Management SystemTopic :

Presented to: Sir Waqar.

Presented by:Umer Hassan.

Ali Raza.

Nauman Sarfaraz.

Talal Mir.

Imran Ali.

Contents: Introduction of Database.

Basic terms of Database.

Flat file Database structures.

Working with Database. How to create a Database.

Forms and filters.

SQL (Structured query language).

Examples of queries.

RDBMS.

Normalization.

Database at work.

Common Corporate DBMS.

Data warehouse.

Data Mining.

• People need data so people create kinds of lists to store and organize it.

• A database is a collection of information that is organized so that it can

easily be accessed, managed, and updated.

• Previously, different departments in a company would design their own

databases with their own copies of data.

• Reduced data redundancy (copies of data).

• Improved data access to users.

• Improved data security.

• Reduced data entry, storage, and retrieval costs.

• Entity: An entity is a piece of an object about which data is stored. i.e. Student,

Employee.

• Fields: A field is a combination of one or more related characters or bytes and it is

the smallest of data fields also called attribues or column. i.e. studentID, studentname,

studentsaddress, employeename,emloyeemailaddress.

• Records: Is a group of related fields.

• Tables: Is a complete collection of records make a table.

• The most basic way to organize data is as a flat file

• In databases a flat file refers to data files that contain records with

no structured relationships. Flat files may contain only basic

formatting, have a small fixed number of fields, and it may or may

not have a file format.

• A flat file database is a database that stores data in a plain text file.

• Flat file database for certain single user for small group situation.

• A data model is a collection of concepts and rules for the

description of the structure of the database.

• Database systems can be based on different data models or

database models respectively.

• Structure of the database means the data types, the constraints

and the relationships for the description or storage of data

respectively.

There are four basic types of database:-

• Hierarchical Model

• Network Model

• Relational Model

• Object-oriented Model

• Hierarchical Model: A hierarchical database model is a data model in

which the data is organized into a tree-like structure. The data is stored as records

which are connected to one another through links.

• Network Model: The network model is a database model conceived as a

flexible way of representing objects and their relationships.

• Relational Model :The relational model for database management is

a database model based on

first-order predicate logic

• Object-oriented Model:• Object Oriented DBMS Database that stores data elements as objects. Uses of

object-oriented concepts. The term object oriented is abbreviated by OO or O-O

• An object database (also object-oriented database management system) is a

database management system .

Relational Database Structures:

• RDBMS are most important database system used in the software

industry today. It was exclusively used to establish the relation the

relationship between two-database objects. One of the database

objects is one table.

The BDMS:

• A database management system (DBMS) is system software for

creating and managing databases. The DBMS provides users and

programmers with a systematic way to create, retrieve, update and

manage data in a database.

• The DBMS is perhaps most useful for providing a centralized view

of data that can be accessed by multiple users, from multiple

locations, in a controlled manner.

• When you have a lot of data to organize, putting it into a

database can be a big help.

• The DBMS interface present the user with data and the tools

required to work with the data.

• You work with the interface’s tools to perform these data

management functions:

• Creating tables

• Sorting records

• Creating Queries

• Generating reports

Querying a Database

• Queries are the primary mechanism for retrieving

information from a database and consist of questions

presented to the database in a predefined format.

• Allow the DBMS to locate records.

• Establish relationship or linked b/w tables to update records.

• List a subset of records.

• Perform calculations.

• Delete obsolete records.

• Perform other data management tasks.

• For example, you might only want to see how many individuals in your

database live in a given city. Or you might only want to see which

individuals have registered with your database within a given time

period.

SQL

• SQL stands for Structured query language.

• SQL is used to write query.

• SQL ( Structured Query Language) is a special-purpose programming

language designed for managing data held in a relational database

management system (RDBMS).

• The SQL statements can be used for both interactive queries and

collecting data for reports from relational database.

• There are four common and main queries 1. Select

2. Insert into

3. Delete

4. Update

Creating tables

• A table is a collection of related data held in a structured format within

a database.

• It consists of fields (columns), and rows.

• This is the first step in building any database.

• Define each field in the table by following three step:

1.Name the field

2.Specify the field type

3.Specify the field size

• After the table has been set up , now

data can enter in a Table.

Sorting Records:

• DBMS is the ability to sort a table of Data, either for a

printed report or for display on the screen.

• For example, a product catalog that lists the products in

alphabetical order or on the basis of unit price is much

easier to use than one that lists the items in random

order.

• When you sort records, you are putting them into

a logical order, with similar data grouped together.

Generating Reports

• Not all DBMS operations have to occur on screen.

• A report is printed information that, like a query result, is

assembled by gathering database on user-supplied

criteria.

• In fact, reports generators is most DBMSs create reports

from queries.

• Reports are also similar to forms because their layout can

be customized with object representing fields and other

controls

RDBMS

• RDBMS stands for Relational Database Management System.

• A relational database management system (RDBMS) is a

program that lets you create, update, and administer

a relational database.

• Each RDBMS table consists of database table rows. Each

database table row consists of one or more database table

fields.

RDBMS store the data into collection of tables, which might

be related by common fields

(database table columns).

• A relationship is a link b/w two tables of

database.

• When a relationship created , a record in one table is

connected to one or many records in another table.

• There are three types of Relationship:

1. One-To-One Relationship

2. One-To-Many Relationship

3. Many-To-Many Relationship

Relationships in RDBMS

One-To-One Relationship

• A one-to-one relationship in a relational database occurs when one

parent record or field has either zero or one child record only.

These relationships are the easiest to represent in databases

• In relational databases, a one-to-many relationship occurs

when a parent record in one table can potentially reference

several child records in another table.

One-To- Many Relationship:

• A many-to-many relationship refers to a relationship between tables

in a database when a parent row in one table contains several child

rows in the second table, and vice versa. Many-to-many

relationships are often tricky to represent.

Many-To- Many Relationship:

Keys in Database

• Primary key: is a candidate key that is most appropriate to be the main reference

key for the table.

• Foreign key: is generally a primary key from one table that appears as a field in

another where the first table has a relationship to the second.

• Secondary Key or Alternative Key: A table may have one or more choices for the

primary key. Collectively these are known as candidate keys as discuss earlier. One

is selected as the primary key. Those not selected are known as secondary keys or

alternative keys.

• Candidate Key: A candidate is a subset of a super key. A candidate key is a single

field or the least combination of fields that uniquely identifies each record in the

table.

Database normalization

• Database normalization: Database normalization is the process of

organizing the attributes and tables of a relational database to minimize

data redundancy.

• In other words normalization is used to purify database.

• There are 3 form of normalization.

• 1st Normal Form.

• 2nd Normal Form.

• 3rd Normal Form.

First Normal Form

• As per First Normal Form, no two Rows of data must contain repeating

group of information.

• Each set of column must have a unique value.

• After Normal 1st form.

2nd Normal Form

• Second Normal Form there must not be any partial dependency of

any column on primary key.

Third Normal Form

• Third Normal form applies that every non-prime attribute of table

must be dependent on primary key.

Common Corporate DBMS.

• MySQL

• Microsoft SQL Server

• Microsoft Office Access

• Microsoft Visual FoxPro

• PostgreSQL

• SQLite

• Firebird

Data warehouse

• In computing, a data warehouse (DW or DWH), also known as an

enterprise data warehouse (EDW), is a system used for reporting

and data analysis. DWs are central repositories of integrated data from one

or more disparate sources.

Data Mining

• Data mining is a powerful new technology with great potential

• Data mining, is the computer-assisted process of digging through

and analyzing enormous sets of data and then extracting the

meaning of the data.