Introduction to Database Management System 電機三 趙上鋒.

Slides:



Advertisements
Similar presentations
Database Management Systems, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Advertisements

Lecture-7/ T. Nouf Almujally
1 Introduction to Database Systems CSE444 Instructor: Scott Vandenberg University of Washington Winter 2000.
Database: A collection of related data [Elmasri]. A database represents some aspect of real world called “miniworld” [Elmasri] or “enterprise” [Ramakrishnan].
Relational Databases Chapter 4.
3-1 Chapter 3 Data and Knowledge Management
1 Introduction to Database Systems Ref. Ramakrishnan & Gehrke Chapter 1.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSC 2720 Building Web Applications Database and SQL.
DBMS1 Database Management System (DBMS) Introductory Concepts Week-1.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
Introduction To Databases IDIA 618 Fall 2014 Bridget M. Blodgett.
IST Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Database Lecture # 1 By Ubaid Ullah.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
CSC2012 Database Technology & CSC2513 Database Systems.
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
Module Title? DBMS Introduction to Database Management System.
The Relational Model. Review Why use a DBMS? OS provides RAM and disk.
Chapter 2 CIS Sungchul Hong
Web-Enabled Decision Support Systems
DATABASE. A database is collection of information that is organized so that it can easily be accessed, managed and updated. It is also the collection.
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Database Technical Session By: Prof. Adarsh Patel.
Introduction to SQL Steve Perry
 DATABASE DATABASE  DATABASE ENVIRONMENT DATABASE ENVIRONMENT  WHY STUDY DATABASE WHY STUDY DATABASE  DBMS & ITS FUNCTIONS DBMS & ITS FUNCTIONS 
Introduction to Database Systems
Database Organization and Design
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
INFS614, Dr. Brodsky, GMU1 Database Management Systems INFS 614 Instructor: Professor Alex Brodsky
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Ch. 1 데이터베이스시스템 (2). Ch.1 Database System 데이터베이스시스템 2 What to Learn Database System Overview Entity-Relationship diagram Relational Data Model  Structure.
Oleh Munawar Asikin. Principles of Information Systems, Seventh Edition 2  Database management system (DBMS): group of programs that manipulate database.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Instructor: Dema Alorini Database Fundamentals IS 422 Section: 7|1.
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Introduction to Database Systems1. 2 Basic Definitions Mini-world Some part of the real world about which data is stored in a database. Data Known facts.
Oracle & SQL Introduction. Database Concepts Revision DB? DBMS? DB Application? Application Programs? DBS? Examples of DBS? Examples of DBMS? 2Oracle.
Creating and Maintaining Geographic Databases. Outline Definitions Characteristics of DBMS Types of database Relational model SQL Spatial databases.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
Database Systems Lecture 1. In this Lecture Course Information Databases and Database Systems Some History The Relational Model.
DBMS 3. course. Reminder Data independence: logical and physical Concurrent processing – Transaction – Deadlock – Rollback – Logging ER Diagrams.
Instructor: Pavlos Pavlikas1 How Data is Stored Chapter 8.
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Chapter 3: Relational Databases
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Chapter 3 The Relational Model. Why Study the Relational Model? Most widely used model. Vendors: IBM, Informix, Microsoft, Oracle, Sybase, etc. “Legacy.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Introduction: Databases and Database Systems Lecture # 1 June 19,2012 National University of Computer and Emerging Sciences.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Fundamental of Database Systems
Databases and DBMSs Todd S. Bacastow January
Oracle & SQL Introduction
Chapter 4 Relational Databases
CS1222 Using Relational Databases and SQL
Introduction to Database Management System
Database.
CS1222 Using Relational Databases and SQL
Data Model.
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
CS1222 Using Relational Databases and SQL
DATABASE Purpose of database
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
CS1222 Using Relational Databases and SQL
Presentation transcript:

Introduction to Database Management System 電機三 趙上鋒

Outline  What is DBMS?  What can DBMS do?  How to design a database?  How to use DBMS?  Conclusion  Reference

What is DBMS?

Data v.s. Information  Data  Anything stored without summarized or analyzed.  Information  Data that has been proceeded to be meaningful for users.

Example Data Information

Database  Stores organized data so that you can query from it or update it.  Like an electrical shelf to put data with organization.

From user to data Teacher (user) Application x Database data Student (user) Application x

What is DBMS?  Database Management System  DBMS is software to store and manage data, so applications don’t have to worry about them.  Like a person who search the dictionary for you.

Relation between App & DBMS Teacher (user) Application x data Student (user) Application x View1 View2 Conceptual schema Physical schema DBMS

What can DBMS do?

DBMS can Do These…  Store huge amount of data ( eg. 100+GB )  Store data for long period of time  Manage data on permanent storage.  Efficient database operation  B+ Tree indexing  Hash-based indexing  Allow people to query & update data  Support query language.

More Requirement  Protect from unauthorized access  Security!  Protect from system crash  Crash recovery  Support many users to access the database at the same time  Concurrency control  Allow administrator to easily change data schema  Protect from incorrect input

If we don’t use DBMS  Applications have to stores data as files  32-bit addressing (5GB) is insufficient to address 100GB+ data file  Write special code to:  support different queries  protect data from multiple users and concurrent access  protect against data loss / corruption as result of system crashes

If we don’t use DBMS (cont’d)  Other issues:  Rewrite applications when data schema changes  Password-based authorization is insufficient  Optimize applications for efficient access and query  Easier to use a DBMS to handle these issuse!

How to design a database

Data Model  A data model is a collection of concepts for describing data.  Entity-relation (ER) model  Proposed by Peter Chen (BS NTU EE ‘68) in 1976  popular for conceptual design  Relational model  Object-oriented model  A schema is a description of a particular collection of data in a given data model.  Eg. How to describe a book?

Some example for ER-modal user idpassword order num Entity set key attribute relation book ISBN name author price

Relational Model  Most widely used today  Microsoft SQL Server  Oracle  MySQL  SyBase  IBM DB2  Microsoft Office Access

Why People Like It  Simple  Each relation is represented as a table of rows and columns  Easy to understand  Ease of expressing complex query (using SQL) on the data  Efficient query evaluation (using query optimization)

Example of Relation  A relation has two parts:  Relational Schema defines column heads of the table.  Relational Instance contains the data rows (called tuples or records) of the table. ISBNnameauthorprice 羊肉爐不是故意的 LogyDog 奼紫嫣紅牡丹亭:四百年青春之夢白先勇 孽子白先勇 270

Example of Relation  Field  Also called an attribute or a column  Key  a set of minimal fields that can uniquely identify a tuple in a relation ISBNnameauthorprice 羊肉爐不是故意的 LogyDog 奼紫嫣紅牡丹亭:四百年青春之夢白先勇 孽子白先勇 270

Convert from ER-Model to Relational Model idpassword user id password order num book ISBN name author price ISBNnameauthorprice idISBNnum userbook order

How to use DBMS?

SQL  Structured Query Language  Developed by IBM (system R) in the 1970s  Current standard: SQL-99  DDL: Data Definition Language  DML: Data Manipulation Language

SQL Basic Commands  DDL  create table: create a table  drop table: delete a table  alter table: alter a field in a table  DML  insert: add a record  delete: delete a record  update: change field values in a record  select: query data satisfying some condition

Example of create table & drop table create table book( ISBN integer, name char(255), author char(127), price integer, primary key(ISBN) ) drop table book ISBNnameauthorprice

Example of alter table alter table book add m_price integer alter table book drop m_price ISBNnameauthorprice m_ price

Example of insert insert into book( ISBN, name, author, price ) values ( , “ 羊肉爐不是故意的 ”, “LogyDog”, 200 ) ISBNnameauthorprice ISBNnameauthorprice 羊肉爐不是故意的 LogyDog200

Example of delete delete from book where author = ‘ 白先勇 ’ ISBNnameauthorprice 羊肉爐不是故意的 LogyDog 奼紫嫣紅牡丹亭:四百年青春之夢白先勇 孽子白先勇 270

Example of update update book as b set b.name = ‘ 羊肉爐不是故意的 ’ where b.author = ‘LogyDog’ update book as b set b.price = b.price * 0.9 ISBNnameauthorprice 羊肉爐是故意的 LogyDog 奼紫嫣紅牡丹亭:四百年青春之夢白先勇 孽子白先勇 270 羊肉爐不是故意的

Example of select select book as b where b.price<300 and author=‘ 白先勇 ’ ISBNnameauthorprice 羊肉爐不是故意的 LogyDog 奼紫嫣紅牡丹亭:四百年青春之夢白先勇 孽子白先勇 270

Conclusion

Reference  Database Management System, 3 rd Ed., by R&G  dex.html - by Hao-hua Chu dex.html  Computer Science -- An Overview, 7 th Ed, by J. Glenn Brookshear