Databases and DBMS. What is a Database?



Similar documents
ISM 318: Database Systems. Objectives. Database. Dr. Hamid R. Nemati

Database Management. Technology Briefing. Modern organizations are said to be drowning in data but starving for information p.

Commercial Database Software Development- A review.

DBMS Questions. 3.) For which two constraints are indexes created when the constraint is added?

1 File Processing Systems

14 Databases. Source: Foundations of Computer Science Cengage Learning. Objectives After studying this chapter, the student should be able to:

Relational Database Basics Review

Introduction to Computing. Lectured by: Dr. Pham Tran Vu

Database IST400/600. Jian Qin. A collection of data? A computer system? Everything you collected for your group project?

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Basics on Geodatabases

Database Design. Marta Jakubowska-Sobczak IT/ADC based on slides prepared by Paula Figueiredo, IT/DB

1. INTRODUCTION TO RDBMS

Database Design Overview. Conceptual Design ER Model. Entities and Entity Sets. Entity Set Representation. Keys

Relational Database Concepts

Foundations of Business Intelligence: Databases and Information Management

BCA. Database Management System

Databases in Engineering / Lab-1 (MS-Access/SQL)

Fundamentals of Database Design

Data Modeling. Database Systems: The Complete Book Ch ,

Course: CSC 222 Database Design and Management I (3 credits Compulsory)

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

The process of database development. Logical model: relational DBMS. Relation

Introduction to Databases

Lecture 6. SQL, Logical DB Design

Outline. Data Modeling. Conceptual Design. ER Model Basics: Entities. ER Model Basics: Relationships. Ternary Relationships. Yanlei Diao UMass Amherst

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

Attribute Data and Relational Database. Lecture 5 9/21/2006

The Entity-Relationship Model

Database Systems. S. Adams. Dilbert. Available: Hans-Petter Halvorsen, M.Sc.


Geodatabase Programming with SQL

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Data Modeling Basics

IT2305 Database Systems I (Compulsory)

The Relational Model. Why Study the Relational Model?

Database Management System

Oracle Data Integrator: Administration and Development

A basic create statement for a simple student table would look like the following.

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Normal Form vs. Non-First Normal Form

DATABASE MANAGEMENT SYSTEM

- Eliminating redundant data - Ensuring data dependencies makes sense. ie:- data is stored logically

Chapter 2 Database System Concepts and Architecture

IT2304: Database Systems 1 (DBS 1)

Using SQL Server Management Studio

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

SQL, PL/SQL FALL Semester 2013

Course MIS. Foundations of Business Intelligence

Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.

CHAPTER 6 DATABASE MANAGEMENT SYSTEMS. Learning Objectives

Chapter 6 FOUNDATIONS OF BUSINESS INTELLIGENCE: DATABASES AND INFORMATION MANAGEMENT Learning Objectives

In This Lecture. Security and Integrity. Database Security. DBMS Security Support. Privileges in SQL. Permissions and Privilege.

B.Sc (Computer Science) Database Management Systems UNIT-V

10. Creating and Maintaining Geographic Databases. Learning objectives. Keywords and concepts. Overview. Definitions

DATABASE MANAGEMENT FILES GIS06

Databases and Information Management

B.Sc. (Computer Science) First Year

There are five fields or columns, with names and types as shown above.

SQL Server An Overview

Databases and BigData

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

Overview. Physical Database Design. Modern Database Management McFadden/Hoffer Chapter 7. Database Management Systems Ramakrishnan Chapter 16

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. COURSE CURRICULUM COURSE TITLE: DATABASE MANAGEMENT (Code: ) Information Technology

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

Entity/Relationship Modelling. Database Systems Lecture 4 Natasha Alechina

GIS Databases With focused on ArcSDE

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Databases Model the Real World. The Entity- Relationship Model. Conceptual Design. Steps in Database Design. ER Model Basics. ER Model Basics (Contd.

Basic Concepts of Database Systems

DATABASE MANAGEMENT SYSTEMS. Question Bank:

Database Fundamentals: 1

MySQL for Beginners Ed 3

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7

Data Hierarchy. Traditional File based Approach. Hierarchy of Data for a Computer-Based File

Designing Databases. Introduction

Database Design Standards. U.S. Small Business Administration Office of the Chief Information Officer Office of Information Systems Support

CS2Bh: Current Technologies. Introduction to XML and Relational Databases. Introduction to Databases. Why databases? Why not use XML?

Object Oriented Databases. OOAD Fall 2012 Arjun Gopalakrishna Bhavya Udayashankar

æ A collection of interrelated and persistent data èusually referred to as the database èdbèè.

TIM 50 - Business Information Systems

Administering a Microsoft SQL Server 2000 Database

Database 10g Edition: All possible 10g features, either bundled or available at additional cost.

Overview of Database Management Systems

Oracle Database 10g Express

Database Setup. Coding, Understanding, & Executing the SQL Database Creation Script

David Dye. Extract, Transform, Load

A brief overview of developing a conceptual data model as the first step in creating a relational database.

Databases What the Specification Says


Study Notes for DB Design and Management Exam 1 (Chapters 1-2-3) record A collection of related (logically connected) fields.

CHAPTER-IV DATABASE MANAGEMENT AND ITS ENVIRONMENT

v4.8 Getting Started Guide: Using SpatialWare with MapInfo Professional for Microsoft SQL Server

Oracle 10g PL/SQL Training

SQL NULL s, Constraints, Triggers

DATABASES AND DATABASE USERS

Chapter 14: Databases and Database Management Systems

Transcription:

Databases and DBMS Eric Lew (MSc, BSc) SeconSys Inc. Nov 2003 What is a Database? Data (singular: datum) Factual Information Database Organized body of related information Repository / storage of information Examples: Grocery list Phone book

Data Organization Grocery list: Apples (2) Bread Yoghurt Paper plates (20) Lettuce (2) Chicken drumsticks Mushrooms Cheese Spaghetti Pork ribs Cilantro Tomato Sauce Plastic forks (20) Oranges Ice cream Plastic knives (20) Parsley Sour cream Tomatoes Bacon Paper napkins Spinach Data Organization (II) Grocery list: Fresh Produce: Meats: Oranges (1 lb) Apples (2 lbs) Lettuce (2) Spinach Mushrooms (white) Parsley Cilantro Tomatoes (plum) Pork ribs (3 lbs) Bacon (1 lb) Chicken drumsticks (20) Dairy: Other: Yoghurt (low fat) Sour cream Ice cream Cheese (mozarella) Bread (white sliced) Spaghetti Tomato Sauce Plastic forks (20) Plastic knives (20) Paper napkins (20) Paper plates (20)

Data Models Conceptual Model What is the data about How will the data be used Entity-Relationship (ER) diagram Logical Model Implementation dependent Network, Hierchical - obsolete Relational - the current standard Object-oriented - the future? Physical Model How is the data physically stored and retrieved Hardware and software dependent

Relational Data Model Data organized as a collection of tables Each table represents an entity type Consists of rows and columns Each row contains the data values of one entity Each column represents an attribute (property) of the entity Technical terms: Table = relation Row = tuple, record Column = attribute, field Domain = cell value Relational Data Model - Example

Relational Concepts Attribute values Data types: character, number, logical, date Range constraint; e.g. 1.0 to 9.9 Enumeration contraint; e.g. RED, BLUE, GREEN Null value means unknown data No two rows can be identical Primary key: attribute(s) which uniquely identify a row Relational Database Design A cell should only have one value Minimize data redundancy (reduce human error) Replace one big table by several small tables Technical term: normalization Use small attributes for primary keys More efficient use of space Faster retrieval of data

Relational Database Bad Design Student Address Course Books Professor John Bell 89 Lilac Dr. Software 101 book1, book2 James Cook Laura Holm 675 West Lane Psychology 201 book3 Bill Gomez Chet Davis 11 Bright Cres. Database 101 book4, book5 James Cook Mia Rowe 92 Sunlight Rd. History 202 book6 Jenny Yates Jill Aries 7 Hilly Lane History 202 Book6 Jennifer Yates Chet Davis 11 Bright Crescent Software 101 book1, book2 James Cook Mia Rowe 92 Sunlight Rd. Psychology 201 book3 Bill Gomez Alan Gold 117 Rose Drive History 201 book6 Jennifer Yates Relational Database - Good Design Student StudentCourse ID Name Address Stu_ID Cour_ID 11 John Bell 89 Lilac Dr. 11 31 12 Laura Holm 675 West Lane 12 32 13 Chet Davis 11 Bright Cres. 13 33 14 Mia Rowe 92 Sunlight Rd. 14 34 15 Jill Aries 7 Hilly Lane 15 34 16 Alan Gold 117 Rose Drive 13 31 14 32 Course ID Name Prof_ID 16 35 Professor 31 Software 101 1 32 Psychology 201 2 ID Prof_Name 33 Database 101 1 1 James Cook 34 History 202 3 2 Bill Gomez 35 History 201 3 3 Jennifer Yates

Relational Concept: Join Relationship between tables identified by primary keys and foreign keys Primary key (PK) in Professor table is ID Foreign key (FK) in Course table is Prof_ID Primary and foreign key must be same data type Joining tables: compare FK value and PK value Course.Prof_ID = Professor.ID Relationship types: One-to-one One-to-many Many-to-many Relational Database Management System Separate application from data Several applications can use same data Tables can be added to database incrementally Multi-user concurrent access to data Maintenance of data integrity Enforce validation of data Back-up and recovery Transaction management All or nothing (eg. Bank transfer) SQL: Structured Query Language Standard language for all relational DBMS

Structured Query Language INSERT command One row at a time INSERT INTO Student (ID, Name) VALUES (20, Adam Wright ) DELETE command DELETE FROM StudentCourse WHERE Stu_ID = 20 UPDATE command UPDATE Course SET Prof_ID = 3 WHERE Name LIKE History% SELECT command SELECT * FROM Student WHERE ID > 10 SELECT Course.Name, Prof_Name FROM Course, Professor WHERE Course.Prof_ID = Professor.ID Stored Procedures Blocks of SQL commands Implement business rules Reusable used by multiple applications Stored in the DBMS (hence the name) Compiled at time of creation Faster runtime execution No syntax errors at run-time Language varies from one DBMS to another Oracle: PL/SQL Microsoft: Trans-SQL

Stored Procedure - Example CREATE PROCEDURE TransferMoney @acctnum1 CHAR(15), @acctnum2 CHAR(15), @amount FLOAT AS DECLARE @balance FLOAT BEGIN TRANSACTION SELECT @balance = Balance FROM Savings WHERE Account = acctnum1 IF (@balance < @amount) THEN ROLLBACK TRANSACTION RETURN (-1) END IF UPDATE Savings SET Balance = Balance - @amount WHERE Account = acctnum1 UPDATE Savings SET Balance = Balance + @amount WHERE Account = acctnum2 COMMIT TRANSACTION RETURN (0) Georelational Data Model Hybrid data model (logical model) Topological data mode (represents spatial data) Relational DBMS (represents attribute data) Geographic data represented by Layers Roads, streams, land cover Each layer is stored in a separate table Spatial objects classified by graphical form Points, Lines and Polygons are stored in separate tables

Georelational Example Geodatabase Storage of geo information within DBMS Versioning Multi-user editing Multiple representations of data Long transactions Behaviours Validation rules: domains, sub types Default values

Object-Oriented Data Model Entities represented as objects Object classes (types) Objects have properties (attribues) Objects have methods (operations) Classes and Inheritance Class hierarchy super and sub classes Creation of new classes: Point, Line, Polygon Operations and Encapsulation Data and operations bundled together Polymorphism: classes Rectangle and Circle can have same operation CalculateArea Object-Oriented DBMS Not widely accepted currently Lack of standard query language Portability issues Not as efficient as Relational DBMS Big name RDBMS have too much marketing clout

DBMS in an Enterprise Application Server Web Server Sales Report ArcObjects MapInfo GeoDatabase Sales Database Inventory