30
DBMS Database Management Systems

DBMS Database Management Systems. DBMS A collection of programs that enables you to store, modify, and extract information from a database. There are

Embed Size (px)

Citation preview

Page 1: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS

Database Management Systems

Page 2: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS

A collection of programs that enables you to store, modify, and extract information from a database. There are many different types of DBMSs, ranging from small systems that run on personal computers to huge systems that run on mainframes. The following are examples of database applications: Computerized library systems Automated teller machines Flight reservation systems Computerized parts inventory systems

Page 3: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS

One of the most important tools in business and Management Information Systems (MIS)

Changed the way computer applications are developed

Changing the way that companies are managed

Page 4: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS

The database approach begins with the premise that the most important aspect of the computer system is the data that it stores.

The purpose of a database management system is to provide shared access to data, answer questions, and create reports from the data.

Page 5: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Relational Databases

The goal of a relational DBMS is to make it easy to store and retrieve needed data. All data is stored in tables, which consist of columns with rows of data.

Each table has a name and represents objects or relationships in the data. For instance, most businesses will have tables for customers, employees, orders, and inventory.

Page 6: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Relational Databases

Phone Name Address City312-555-1234 Jones 123 Main Chicago502-555-8876 Smith 456 Oak Glasgow602-555-9987 Juarez 887 Riviera Phoenix612-555-4325 Olsen 465 Thor Minneapolis

Customer Table

Customer Date Salesperson Total_sale502-555-8876 3/3/04 2223 157.92602-555-9987 4/4/04 8876 295.53612-555-4325 4/9/04 8876 132.94502-555-8876 5/7/04 3345 183.67

Orders Table

Tables Rows Columns Primary keys

Data types Text Dates & times Numbers Objects

Page 7: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS Requests for information from a database are made in

the form of a query, which is a stylized question.

For example, the query SELECT ALL WHERE NAME = "SMITH" AND AGE > 35

Requests all records in which the NAME field is SMITH and the AGE field is greater than 35.

The set of rules for constructing queries is known as a query language.

Different DBMSs support different query languages, although there is a semi-standardized query language called SQL (structured query language).

Sophisticated languages for managing database systems are called fourth-generation languages, or 4GLs for short.

Page 8: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

QUERY

There are three general methods for posing queries: 1. Choosing parameters from a menu: In this method, the

database system presents a list of parameters from which you can choose. This is perhaps the easiest way to pose a query because the menus guide you, but it is also the least flexible.

2. Query by example (QBE): In this method, the system presents a blank record and lets you specify the fields and values that define the query.

3. Query language: Many database systems require you to make requests for information in the form of a stylized query that must be written in a special query language. This is the most complex method because it forces you to learn a specialized language, but it is also the most powerful.

Page 9: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

QUERY BY EXAMPLE

In database management systems, query by example (QBE) refers to a method of forming queries in which the database program displays a blank record with a space for each field. You can then enter conditions for each field that you want to be included in the query. For example, if you wanted to find all records where the AGE field is greater than 65, you would enter >65 in the AGE field.

*QBE systems are considered easier to learn than formal query languages.

Page 10: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Single Table Query IntroductionCID Name Phone City AccountBalance28764 Adamz 602-999-2539 Phoenix 197.5487535 James 305-777-2235 Miami 255.9344453 Kolke 303-888-8876 Denver 863.3929587 Smitz 206-676-7763 Seattle 353.76

Sample Data

Access Query Screen (QBE)

Query: Which customers have balances greater than $200?

Page 11: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Computations

Sum Avg Min Max Count StDev Var

QBE

SELECT Count(C#), AVG(AccountBalance)FROM Customers ;

SQL

Page 12: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

RECORD

In database management systems, a record is a complete set of information.

• Records are composed of fields, each of which contains one item of information.

• A set of records constitutes a file. For example, a personnel file might contain records that have three fields: a name field, an address field, and a phone number field.

Page 13: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

RECORD

Page 14: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

FIELD

A space allocated for a particular item of information.

A tax form, for example, contains a number of fields: one for your name, one for your Social Security number, one for your income, and so on.

Fields are the smallest units of information you can access.

In spreadsheets, fields are called cells. Most fields have certain attributes associated with them. For example, some fields are numeric whereas others are

textual, some are long, while others are short. In addition, every field has a name, called the field name.

Page 15: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

FIELDS

In database management systems, a field can be required, optional, or calculated. A required field is one in which data must be

entered. An optional field may be left blank. A calculated field is one whose value is derived

from some formula involving other fields. You do not enter data into a calculated field; the system automatically determines the correct value.

A collection of fields is called a record.

Page 16: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Multiple Tables

CID Name Phone City AccountBalance12345 Jones 312-555-1234 Chicago $197.5428764 Adams 602-999-2539 Phoenix $526.7629587 Smitz 206-656-7763 Seattle $353.7644453 Kolke 303-888-8876 Denver $863.3987535 James 305-777-2235 Miami $255.98

Customers

SID Name DateHired Phone Commission225 West 5/23/75 213-333-2345 5452 Zeke 8/15/94 213-343-5553 3554 Jabbar 7/15/91 213-534-8876 4663 Bird 9/12/93 213-225-3335 4887 Johnson 2/2/92 213-887-6635 4

ItemID Description Price1154 Corn Broom $1.002254 Blue Jeans $12.003342 Paper Towels--3 rolls $1.007653 Laundry Detergent $2.008763 Men's Boots $15.009987 Candy Popcorn $0.50

OrderID CID SID Odate Amount117 12345 887 3/3/2004 $57.92125 87535 663 4/4/2004 $123.54157 12345 554 4/9/2004 $297.89169 29587 255 5/5/2004 $89.93178 44453 663 5/1/2004 $154.89188 29587 554 5/8/2004 $325.46201 12345 887 5/28/2004 $193.58211 44453 255 6/9/2004 $201.39213 44453 255 6/9/2004 $154.15215 87535 887 6/9/2004 $563.27280 28764 663 5/27/2004 $255.32

OID ItemID Quantity117 1154 2117 3342 1117 7653 4125 1154 4125 8763 3157 7653 2169 3342 1169 9987 5178 2254 1

Salespeople

Items

Orders

ItemsSold

Page 17: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Linking Tables

The Orders to ItemsSold relationship enforces referential integrity.

One Order can list many ItemsSold.

Page 18: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

CELLS

In spreadsheet applications, a cell is a box with a single piece of data. The data is usually text, a numeric value, or a

formula. The entire spreadsheet is composed of rows and columns of cells.

A spreadsheet cell is analogous to a field in database management systems. Individual cells are usually identified by a column

letter and a row number. For example, D12 specifies the cell in Column D and Row 12.

Page 19: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

FORMULAS

In spreadsheet applications, a formula is an expression that defines how one cell relates to other cells. For example, you might define Cell C5

(Column C, Row 5) with the formula =A4*D7 which means multiply the value in Cell A4 by the value in Cell D7

Page 20: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

DBMS

The information from a database can be presented in a variety of formats. Most DBMSs include a report writer program that enables the output of data in the form of a report.

Many DBMSs also include a graphics component that enables the output of information in the form of graphs and charts.

Page 21: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Sample Report with Groups

Page 22: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

QUERY LANGUAGE

Query - a specialized language for requesting information from a database. For example, the query SELECT ALL

WHERE age > 30 AND name = "Smith" requests all records in which the Name field is "Smith" and the Age field has a value greater than 30.

The de facto standard for query languages is SQL

Page 23: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

E-Business Databases

Internet

Customer

Web Server

Web program script<HTML>Text<%Database connection%>

Order Form

DescriptionsPrices

Page request

Que

ries

and

data

Web page

Page 24: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Database Servers

Specially designed computers that hold the actual databases and run only the DBMS and related software

Usually multiprocessor computers, with RAID disk arrays used for stable storage

Connected to one or more servers via a high-speed channel

Hardware database accelerators are also used in large volume transaction processing environments

Page 25: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Database Servers

A database server is a computer or program running on a computer which provides database services to other programs or computers. They typically provide a complete database management system of some sort, even if limited to only basic database creation, repair and deletion.

An alternative approach is to build the support for the information storage directly into the programs which are using it. This is common on less powerful computer systems or for applications which don't have complex requirements.

In the Internet context, it's very common for web sites to have web servers delivering pages which have their core content stored in a database server.

Page 26: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

Database Programs Used at ECU

MVS (for registering students), SQL (Structured Query Language), DB2 (Database 2), Oracle, Access, and more

ITCS is in charge of programming databases and keeping them up and running.

Network support is in charge of keeping the databases connected to the network.

Student, faculty, and staff data are automatically updated on server at input.

Page 27: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

What is SQL?

SQL stands for Structured Query Language Allows access to a database Is an ANSI standard computer language Can execute queries against a database Can retrieve data from a database Can insert new records in a database Can delete records from a database Can update records in a database Is easy to learn

Page 28: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

SQL

SQL is an ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems.

SQL statements are used to retrieve and update data in a database. SQL works with database programs like MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, etc.

There are many different versions of the SQL language To be in compliance with the ANSI standard, they must

support the same major keywords in a similar manner (such as SELECT, UPDATE, DELETE, INSERT, WHERE, and others).

Page 29: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

ACCESS

Access 2003 provides a powerful set of tools that are sophisticated enough for professional developers, yet easy to learn for new users.

Create or use powerful database solutions that make organizing, accessing, and sharing information easier than ever.

MICROSOFT ACCESS TOUR

Page 30: DBMS Database Management Systems. DBMS  A collection of programs that enables you to store, modify, and extract information from a database. There are

REFERENCES

http://www.bambooweb.com/articles/d/a/Database_management_system.html

http://www.webopedia.com/TERM/D/database_management_system_DBMS.html

Management Information Systems. Post/Anderson. 3rd Edition.

Rick Lupton, ECU ITCS, Computer Consultant, Brody School of Medicine

http://www.w3schools.com/sql/sql_intro.asp