INFO 340 Lecture 2 Intro to Databases. Book –Need it –Order individually through UW Bookstore –Or Amazon.

Slides:



Advertisements
Similar presentations
Introduction to Databases
Advertisements

Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Introduction to Databases
1 Pertemuan 01 Pengantar tentang database Matakuliah: >/ > Tahun: > Versi: >
Introduction to Databases
1 Minggu 1, Pertemuan 1 Introduction to Database Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Introduction to Databases Transparencies
Chapter 1 INTRODUCTION TO DATABASE.
1 Chapter 2 Database Environment. 2 Objectives of Three-Level Architecture u All users should be able to access same data u User’s view immune to changes.
INTRODUCTION TO DATABASES
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Lecture Two Database Environment Based on Chapter Two of this book:
Chapter 1 Introduction to Databases
Introduction to Databases
Introduction to Database Systems 1.  Assignments – 3 – 9%  Marked Lab – 5 – 10% + 2% (Bonus)  Marked Quiz – 3 – 6%  Mid term exams – 2 – (30%) 15%
Introduction to Databases Transparencies 1. ©Pearson Education 2009 Objectives Common uses of database systems. Meaning of the term database. Meaning.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Database
Introduction Chapter 1. Reference Book  Database Systems Thomas Connolly, Carolyn Begg, Anne Strachan Addison-Wesley 1999 ISBN:
Fundamental of Database (FCT 1083) Chapter 1: Concept of Databases.
Sistem Basis Data (DATABASE) Siauw Yohanes Darmawan
Module Title? DBMS Introduction to Database Management System.
Chapter 2 CIS Sungchul Hong
Chapter 1 Introduction to Databases Pearson Education ©
Database Architecture Introduction to Databases. The Nature of Data Un-structured Semi-structured Structured.
Databases and Database Management Systems
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
1 Chapter 1 Introduction to Databases Transparencies Last Updated: Pebruari 2010 By M. Arief Updated by RSO Feb 2011
Introduction to Databases
Chapter 1 Introduction to Databases © Pearson Education Limited 1995, 2005.
Database Environment Chapter 2. Data Independence Sometimes the way data are physically organized depends on the requirements of the application. Result:
1 Introduction to Databases. 2 Examples of Database Applications u Purchases from the supermarket u Purchases using your credit card u Booking a holiday.
1 Chapter 1 Introduction to Databases Transparencies.
Introduction to Databases
Introduction to Databases Transparencies © Pearson Education Limited 1995, 2005.
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
What is Database Administration ?
Introduction to Databases Transparencies
Introduction to Databases
Introduction to Databases Transparencies
Introduction to Databases
Introduction to DBMS Purpose of Database Systems View of Data
Databases and DBMSs Todd S. Bacastow January 2005.
Introduction to Databases
Chapter 1: Introduction
Introduction to Databases
Introduction to Databases Transparencies
Introduction to Databases
Introduction to Databases Connolly and Begg
Introduction to Databases
Introduction to Databases
Introduction to Databases
Introduction to Database Systems
Chapter 2 Database Environment Pearson Education © 2009.
Data Base System Lecture 2: Introduction to Database
Introduction to Databases
Introduction to DBMS Purpose of Database Systems View of Data
Introduction to Databases
Introduction to Databases
Introduction to Databases
Introduction to Databases Transparencies
Chapter 1: Introduction
Database System Concepts and Architecture
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 1: Introduction
Presentation transcript:

INFO 340 Lecture 2 Intro to Databases

Book –Need it –Order individually through UW Bookstore –Or Amazon

Previous Class How many cards did your system require total? How difficult was it to answer the standard queries? –The ad-hoc queries?

What if -- iTunes Store via File Based Approach Imagine all details of a song encapsulated in a single file (or nest of files) Problems –Difficulty in accessing data We need that particular application to access the data –Duplication of data do we want a separate copy of the album cover for every single song ? –Data dependence What if we want to get at the same data, but with a different application? –File format incompatibilities What if the applications use different file formats? Ie one uses text, another XML, another binary, etc –Fixed queries Largely dependent on app developer –Results in fixed (non- ‘ad-hoc’) queries and/or –Multiple applications

Limitations of Files Separation and isolation of data Duplication of data Data Dependence Incompatible file formats Fixed queries / proliferation of apps Two main problems emerge: –Data definition is embedded in application –No control over access and data manipulation.

Introducing Databases Solves many problems introduced in a file system. Multi-user, simultaneous connections Security Separation of application and data Common query language One copy of data

Database Def (pg 15) A shared collection of logically related data, and a description of this data, designed to meet the information needs of an organization

Types of databases Relational (we’ll focus on this type in this class) Network and Hierarchical model Object Oriented

Database are “Self Describing” System catalog Data dictionary Meta-data It is this local or in-place description of the data that allows “program-data independence” (BTW good quiz item)

Data abstraction Similar to programming classes –You can change the internal coding to the object (instantiated class) as long as the external behavior (behavior presented to the outside world) doesn’t change Similarly, in databases, we can separate the data from the application

Logically related Entities -- distinct object Attributes -- describes some aspect of the object Relationships -- associations between the entities

DBMS Database Management System Provides facility to define the database via a Data Definition Language -- DDL Provides facility to store, retrieve, & manipulate data through Data Manipulation Language –SQL (Structured Query Language) is the standard –Note SQL & MySQL are 2 different things

Controlled access to database: –Authorization & possibly authentication –Control of integrity/consistency –Handle multiple simultaneous users (concurrency) –Handle recovery -- return to a known, consistent state –User-accessible catalog DBMS

Database Application Program Program that interacts with a database. Database can expose Views to the application. Views help to –Present the data to the user in a useful format –Choose who sees what ie not all should see payroll –Customize data presentation Same db can have many different looks/appearances Generally better than having multiple databases –Allows db to hide any evolutionary structural changes to the database ‘behind the scenes’

Three (or four) levels of the DBMS

Database Design Data structure first & application second –Data structure will be the basis –Data structure is also harder to change on the fly –At the design phase, want to think it through as much as possible –Data design decisions can make application design easier (or harder)

Data Administrator -- “Data Monk” Database Administrator Logical Database Designer –Business rules Ie only HR or finance person can see payroll Physical Database Designer Application developers User types –Naïve –Sophisticated Database Design

DBMS Advantages Control (though not elimination) of redundancy Consistency - reduce points of update/modification –Caused by ‘same’ data existing in multiple places Data sharing Integrity - use of constraints Security - users, roles, privileges Standardization forced Concurrency Backup & recovery

DBMS Disadvantages You pay for robustness Complexity - Lots of forethought Cost (upfront, but generally not over time) Higher impact of failure - centralization Conversion cost

Schema & Instance Schema -- Description of the database Instance -- A functioning database at any point in time -- sometimes refers to a particular running installation

DDL & DML DDL –Language to specify the db System uses sets of tables itself to support user tables/schema –System catalog –Data dictionary DML –Language to update the db & retrieve data –Procedural How –Non-Procedural What SQL

DBMS Functions Data storage, retrieval, update User-accessible catalog –Data about data -- metadata –System catalog Transaction support -- ie ‘rollback’ –Failure of db, network, etc before operation is complete Concurrency support Authorization services Data comm support Integrity services Utility services - imports, exports, analysis, monitoring/alerts

Some Behind the Scenes Processes of DBMS Query Processor File Manager DML preprocessor DDL compiler - creates metadata tables Authorization control Integrity checker Query optimizer Transaction processor Recovery manager

Entity Relationship Modeling/Entity Relationship Diagram (ERD) Introduction Example - Used car business with multiple lots, multiple cars, multiple sales people car salesperson Sales lots colormake year Engine size name address Phone number location size Lighted? has M 1 M 1

In-class work Groups of 5 Create ERD for following 3 scenarios –iTunes (w/customers, songs, artists) –Live inventory (w/computers, users, & ‘on- net’ snapshots) –Hacker attack incident database Attacker, victim, locations, computers (addresses, OS’s, other pertinent info,etc) Present your results for each

Assignment Read Chapter 3-4 of Connolly & Begg