Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database management system (DBMS)

Similar presentations


Presentation on theme: "Database management system (DBMS)"— Presentation transcript:

1 Database management system (DBMS)
General Concepts Database Organized collection of logically related data Data Known facts Types: text, figures, graphics, images, sound, videos… Database management system (DBMS) Software package for defining and managing a database

2 Usually a database contains more than one table.
A table is the primary unit of physical storage for data in a database. Usually a database contains more than one table.

3 Field Record Primary key

4 Databases and DBMS Metadata Data that describes the properties or characteristics of other data Allows database designers and users to understand the meaning of the data Name Type Size Description REL_NUM Integer 2 Relevé number R_LOCATION Text 255 Location R_SURV_DATE Date/Time 8 Date R_SURVEYORS 50 Initials of surveyors R_LATITUDE Double Northing, UTM R_LONGITUDE Easting, UTM R_PHOTO_N 10 Aerial photo # R_TOPOG_MAP 20 Topographic map

5 Relational Database Data are organized into two or more tables Relationships between entities are represented by values stored in the columns of the corresponding tables (keys) Schema: a view that inter-relates tables to each other Accessible through Standard Query Language (SQL) Query: set of instructions to a database “engine” to retrieve, sort and format returning data

6 Schema

7 Schema

8 SQL Structured Query Language
SQL statements are used to retrieve and update data in a database Syntax for executing queries, updating, inserting, and deleting records. SELECT - extracts data from one or more table INSERT INTO - inserts new data UPDATE - updates data DELETE FROM - deletes data

9 ON tab_releve.REL_NUM = tab_site.REL_NUM
Example SELECT tab_releve.* FROM tab_releve INNER JOIN tab_site ON tab_releve.REL_NUM = tab_site.REL_NUM WHERE tab_site.SG_ELEVATION > 2000 SELECT tab_releve.* FROM tab_releve INNER JOIN tab_site ON tab_releve.REL_NUM = tab_site.REL_NUM WHERE tab_site.SG_ELEVATION > 2000

10 DBMS Software package for defining and managing a database (aka DB “engine”) Examples: Proprietary: MS SQL Server, DB2, Oracle, Sybase Open source: MySql, PostgreSQL

11 What is Microsoft Access?
“It is a Database” No! Microsoft Access is an application development tool, not a Database Management System (DBMS) Access has some DBMS-like features Strictly, these are the features of a software component called Jet, which happens to be bundled with Access and other Microsoft products

12 Increased productivity of application development
DBMS Advantages Enforced standards Increased productivity of application development centralization availability Minimal data redundancy Improved data consistency and quality access control transaction control data independence

13 A method for organizing data elements into tables
Normalization A method for organizing data elements into tables Done in order to avoid Duplication of data Insert anomaly Delete anomaly Update anomaly

14 Database normalization
Inconsistency Name Country Sport1 Fee1 Sport2 Fee2 Sport3 Fee3 Total Amado Adalberto LOPEZ BAUTISTA Guatemala Football 35 Golf 80 115 Sabil Damiao MANDALA Mozambique Swimming 60 Tennis 50 110 Ahmed Mohamed Harb RABIA Egypt Basket 30 Marta RONCHI Italy Alfred Kouly TINE Senegal Hockey 75 185 Cinzia LANFREDI SOFIA Redundancy Ambiguity

15 Database normalization
Name Country Sport1 Fee1 Sport2 Fee2 Sport3 Fee3 Total Amado Adalberto LOPEZ BAUTISTA Guatemala Football 35 Golf 80 115 Sabil Damiao MANDALA Mozambique Swimming 60 Tennis 50 110 Ahmed Mohamed Harb RABIA Egypt Basket 30 Marta RONCHI Italy Alfred Kouly TINE Senegal Hockey 75 185 Cinzia LANFREDI SOFIA Fee3 Sport3 Fee2 Sport2 Fee1 Sport1 Country Name Family Name Second Name First Name Unpack the data Reduce elements to non-decomposable (atomic) values

16 Database normalization
First Name Second Name Family Name Country Sport1 Fee1 Sport2 Fee2 Sport3 Fee3 Total Amado Adalberto LOPEZ BAUTISTA Guatemala Football 35 Golf 80 115 Sabil Damiao MANDALA Mozambique Swimming 60 Tennis 50 110 Ahmed Mohamed Harb RABIA Egypt Basket 30 Marta RONCHI Italy Alfred Kouly TINE Senegal Hockey 75 185 Cinzia LANFREDI SOFIA First Name Second Name Family Name Country Sport1 Fee1 Sport2 Fee2 Sport3 Fee3 Total Sport Fee First Normal Form (1NF) Eliminate duplicative columns from the same table. Create separate tables for each group of related data and identify each row with a unique column or set of columns (the primary key).

17 Database normalization
Id_student First Name Second Name Family Name Country Total 1 Amado Adalberto LOPEZ BAUTISTA Guatemala 115 2 Sabil Damiao MANDALA Mozambique 110 3 Ahmed Mohamed Harb RABIA Egypt 80 4 Marta RONCHI Italy 30 5 Alfred Kouly TINE Senegal 185 6 Cinzia LANFREDI SOFIA Id_student Id_sport Id_sport Sport Fee 1 Football 30 2 Swimming 60 3 Tennis 50 4 Golf 80 5 Basket 6 Hockey 75 Second Normal Form (2NF) Remove subsets of data that apply to multiple rows of a table and place them in separate tables. Create relationships between these new tables and their predecessors through the use of foreign keys.

18 Database normalization
Id_student First Name Second Name Family Name Country Total 1 Amado Adalberto LOPEZ BAUTISTA 115 2 Sabil Damiao MANDALA 110 3 Ahmed Mohamed Harb RABIA 80 4 Marta RONCHI 30 5 Alfred Kouly TINE 185 6 Cinzia LANFREDI SOFIA Id_student Id_sport Id_sport Sport Fee 1 Football 30 2 Swimming 60 3 Tennis 50 4 Golf 80 5 Basket 6 Hockey 75 Id_country Country 1 Guatemala 2 Mozambique 3 Egypt 4 Italy 5 Senegal Third Normal Form (3NF) Remove columns that are not fully dependent upon the primary key.

19 Database normalization
Id_student First Name Second Name Family Name Country 1 Amado Adalberto LOPEZ BAUTISTA 2 Sabil Damiao MANDALA 3 Ahmed Mohamed Harb RABIA 4 Marta RONCHI 5 Alfred Kouly TINE 6 Cinzia LANFREDI SOFIA Id_student Id_sport Id_sport Sport Fee 1 Football 30 2 Swimming 60 3 Tennis 50 4 Golf 80 5 Basket 6 Hockey 75 Id_country Country 1 Guatemala 2 Mozambique 3 Egypt 4 Italy 5 Senegal

20 Increased productivity of application development
DBMS Advantages Enforced standards Increased productivity of application development Minimal data redundancy Improved data consistency and quality Program-data independence

21 Increased productivity of application development
DBMS Advantages Enforced standards Increased productivity of application development Minimal data redundancy Improved data consistency and quality Program-data independence Improved accessibility and data sharing

22 PostgreSQL PostgreSQL is an object-relational database management system (DBMS) based on POSTGRES developed at the University of California at Berkeley Computer Science Department. POSTGRES pioneered many concepts that only became available in some commercial database systems much later. PostgreSQL is an open-source descendant of this original Berkeley code. It supports a large part of the SQL standard, offers many modern features and can be extended by the user in many ways. The official manual is more than 2700 pages...

23 PostgreSQL A server process, which manages the database files, accepts connections to the database from client applications, and performs database actions on behalf of the clients. The database server program is called postgres. The user’s client (frontend) application that wants to perform database operations. Client applications can be very diverse in nature: a client could be a text-oriented tool, a graphical application, a web server that accesses the database to display web pages, or a specialized database maintenance tool. Some client applications are supplied with the PostgreSQL distribution; most are developed by users.

24


Download ppt "Database management system (DBMS)"

Similar presentations


Ads by Google