INTRODUCTION TO DATABASES CS 260 Database Systems.

Slides:



Advertisements
Similar presentations
Action Queries CS 320. Review: SQL Command Types  Data Definition Language (DDL)  Used to create and modify database objects  Data Manipulation Language.
Advertisements

Client/Server Databases and the Oracle 10g Relational Database
Database Software File Management Systems Database Management Systems.
1 A GUIDE TO ORACLE8 CHAPTER 1: Introduction to Client/Server Databases 1.
1 Basic DB Terms Data: Meaningful facts, text, graphics, images, sound, video segments –A collection of individual responses from a marketing research.
CSE 190: Internet E-Commerce Lecture 10: Data Tier.
CSCI 150 Database Applications Chapter 1 – Getting Started.
1 Introduction The Database Environment. 2 Web Links Google General Database Search Database News Access Forums Google Database Books O’Reilly Books Oracle.
Client/Server Databases and the Oracle9i Relational Database
Creating Database Tables CS 320. Review: Levels of data models 1. Conceptual: describes WHAT data the system contains 2. Logical: describes HOW the database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
BUSINESS DRIVEN TECHNOLOGY
CSC 2720 Building Web Applications Database and SQL.
Chapter 1 An Overview of Database Management. 1-2 Topics in this Chapter What is a Database System? What is a Database? Why Database? Data Independence.
Chapter 4 Database Management Systems. Chapter 4Slide 2 What is a Database Management System (DBMS)?  Database An organized collection of related data.
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.
Database Design and Introduction to SQL
IST Databases and DBMSs Todd S. Bacastow January 2005.
Introduction to Database
PHASE 3: SYSTEMS DESIGN Chapter 7 Data Design.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
1 DATABASE TECHNOLOGIES BUS Abdou Illia, Fall 2012 (September 5, 2012)
1 Intro to Info Tech Database Management Systems Copyright 2003 by Janson Industries This presentation can be viewed on line at:
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Copyright © 2003 by Prentice Hall Module 4 Database Management Systems 1.What is a database? Data hierarchy and data organization Field, record, file,
6-1 DATABASE FUNDAMENTALS Information is everywhere in an organization Information is stored in databases –Database – maintains information about various.
Module Title? DBMS Introduction to Database Management System.
Introduction to SQL Steve Perry
STORING ORGANIZATIONAL INFORMATION— DATABASES CIS 429—Chapter 7.
1 INTRODUCTION TO DATABASE MANAGEMENT SYSTEM L E C T U R E
Simple Database.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
1 Client/Server Databases and the Oracle Relational Database.
Storing Organizational Information - Databases
“INTRODUCTION TO DATABASE AND SQL”. Outlines 2  Introduction To Database  Database Concepts  Database Properties  What is Database Management System.
Intro – Part 2 Introduction to Database Management: Ch 1 & 2.
Enhanced Guide to Oracle8i
Database Design 1: Introduction and Terminology CS 320.
ADVANCED SQL SELECT QUERIES CS 260 Database Systems.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 7 Storing Organizational Information - Databases.
Introduction to Database AIT632 Chapter 1 Sungchul Hong.
1 Introduction to Oracle Chapter 1. 2 Before Databases Information was kept in files: Each field describes one piece of information about student Fields.
Introduction to Databases Queries CS 146. Sample Database: CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT.
Zhangxi Lin Texas Tech University ISQS 6347, Data & Text Mining 1 ISQS 6339 Data Management and Business Intelligence Database Review.
SQL ACTION QUERIES AND TRANSACTION CONTROL CS 260 Database Systems.
Sql DDL queries CS 260 Database Systems.
1 Geog 357: Data models and DBMS. Geographic Decision Making.
Chapter 3: Relational Databases
CS320 Web and Internet Programming SQL and MySQL Chengyu Sun California State University, Los Angeles.
uses of DB systems DB environment DB structure Codd’s rules current common RDBMs implementations.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
IIS 645 Database Management Systems DDr. Khorsheed Today’s Topics 1. Course Overview 22. Introduction to Database management 33. Components of Database.
CSCI-235 Micro-Computers in Science Databases. Database Concepts Data is any unorganized text, graphics, sounds, or videos A database is a collection.
SQL Basics Review Reviewing what we’ve learned so far…….
Introduction to Databases Queries CS 146. Sample Database: CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT.
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.
Introduction to Database Programming with Python Gary Stewart
Databases and DBMSs Todd S. Bacastow January
Chapter 1 Introduction.
Client/Server Databases and the Oracle 10g Relational Database
Chapter 1: Introduction
Introduction to Database Management System
DATABASE Purpose of database
The Database Environment
Course Instructor: Supriya Gupta Asstt. Prof
Presentation transcript:

INTRODUCTION TO DATABASES CS 260 Database Systems

Course Outline  SQL queries  DML Select (SELECT)  DDL (CREATE, ALTER, DROP)  DML Action (INSERT, UPDATE, DELETE)  User authentication  Data modeling and normalization  Transaction processing  Stored DBMS programs  Scaling and performance  Distributed databases

Why Study Database Systems?  Important  The back end of many important systems Web-based e-commerce (e.g. amazon.com, imdb.com) Scientific sites (e.g. protein sequences) Real-time systems (e.g. air-traffic control) Business systems (e.g. banking)  Good job experience  Many jobs require database systems experience  Oracle DBAs hired at >$80K, often make >$100K  A lot of data out there  Facebook – over 100 petabytes  Amazon – over 90 pb  Google processes over 20pb per day  AT&T (323 TB, 2010)  World Data Center for Climate (6+ PB, 2010)

Why Study Database Systems?  As it relates to UWEC courses  CS268 Use SQL and JDBC  CS355 & CS485 (SE I and II) Project(s) might use databases  Any CS course might use a database!

Overview  Data management  Database system architectures  Database vocabulary & history

Data Management  "Real" computer applications tend to have:  Large volumes of data  Different types of data  Data with complex relationships

“Old” Approach to Data Management  File-based  Decentralized  Each application has its own data files Data File 1 Application 1 Application 2 Data File 2

Problems with file based approach?  Duplicate data  Redundant data  Becomes inconsistent over time  Requires custom programs to create, update, and retrieve data from files  Transaction atomicity  Concurrent access issues  Security

DBMS Approach to Data Management  Data is viewed as a shared organizational resource  Centralized  All applications interact with a single centralized database Database Application 1 Application 2

What is a Database?  Components  Data files  Database Management System (DBMS) Data Files DBMS Application 1 Application 2 Database

What is the DBMS?  Set of programs that perform…  Basic data handling tasks Insert, Update, Delete, Retrieve  Creating atomic transactions  Enabling/disabling concurrency  Database administration tasks Creating users, creating objects, enforcing security, creating backups, …  Applications interact only with the DBMS  Never interact directly with the data files  Major players today:  Oracle, SQL Server, DB2, MySQL

Overview  Data management  Database system architectures  Database vocabulary & history

Database System Architectures  Single-tier  2-tier  N-tier

Single-Tier Databases  Personal computer-based  Applications and database run on the same local computer  Example: Access, Filemaker  What are the limitations? Database Applications Host Computer (microcomputer)

Single-Tier Databases  Mainframe-based (host)  Applications & database run on the same host computer  Mainly used in legacy systems Database Applications Host Computer Terminals Network

2-Tier (Client/Server)  DBMS runs on a server  Client applications run on the clients  Example: Oracle (server) + SQL Developer (client) Client Workstations Database Applications Database Applications Database Applications Database Database Server Network

N-Tier Database Systems  N-tier system places each service type on a different host Database Client Workstations (Browser) User Services User Services User Services Database Server Business Services Middle-tier Server(s) (Web server)

Sample Database (CANDY) CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT

Overview  Data management  Database system architectures  Database vocabulary & history

Basic Database Vocabulary  Field: column of similar data values  Record*: row of related fields  Table*: set of related rows PROD_ID PROD_DESCPROD_COSTPROD_PRICE 1Celestial Cashew Crunch7.45$ 10.00$ 2Unbrittle Peanut Paradise5.75$ 9.00$ 3Mystery Melange7.75$ 10.50$ 4Millionaire’s Macadamia Mix12.50$ 16.00$ 5Nuts Not Nachos6.25$ 9.50$ Mathematical terms for record and table: tuple and relation

Database History  All pre-1960’s systems used file-based data  First database: Apollo project  Goal: No duplicate data in multiple locations  Used a hierarchical structure  Created relationships using pointers Pointer: hardware address

Example Hierarchical Database Student ID Student LastName Student FirstName Student MI Pointers to Course Data* 5000NelsonAmberS 5001HernandezJosephP 5002MyersStephenR UNIVERSITY_STUDENT CourseIDCourse Name Course Title 100MIS 290Intro. to Database Applications 101MIS 304Fundamentals of Business Programming 102MIS 310Systems Analysis & Design UNIVERSITY_COURSE * Hex number referencing data’s physical location on hard drive

Problems with Hierarchical Databases  Relationships are all one-way; to go the other way, you must create a new set of pointers  Pointers are hardware-specific  VERY hard to move to new hardware  Applications must be custom-written  Usually in COBOL

Relational Databases  Circa 1972  E.J. Codd  “Normalizing” relations  Goal: No redundant data  Stores data in a tabular format  Creates relationships by sharing key fields

Key Fields  Primary key: field that uniquely identifies a record  Often abbreviated “PK” InstructorIDInstructor LastName Instructor FirstName 1BlackGreg 2McIntyreKaren 3SarinNaj UNIVERSITY_INSTRUCTOR Primary keys

Class Discussion  What is the primary key of each table in the CANDY database?  How can you tell if a field is a primary key?

Sample Database (CANDY) CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT

Special Types of Primary Keys  Composite PK: made by combining 2 or more fields to create a unique identifier  Consider the CANDY_PURCHASE table…  Surrogate PK: ID generated by the DBMS solely as a unique identifier (not done in above example, but likely in CANDY_CUSTOMER and CANDY_PRODUCT) Composite PK

Key Fields (continued)  Foreign key  Field that is a primary key in another table  Serves to create a relationship StudentIDStudent LastName Student FirstName StudentMIAdvisorID 5000NelsonAmberS1 5001HernandezJosephP1 5002MyersStephenR3 UNIVERSITY_STUDENT Foreign keys InstructorIDInstructor LastName Instructor FirstName 1BlackGreg 2McIntyreKaren 3SarinNaj UNIVERSITY_INSTRUCTOR Primary keys

Alternative to Foreign Keys  Repeat data values for every record  Problems  Takes extra space  Redundant data becomes inconsistent over time StudentIDStudent LastName Student FirstName StudentMIAdvisorLast Name AdvisorFirst Name 5000NelsonAmberSBlackGreg 5001HernandezJosephPBlackGregory 5002MyersStephenRSarinNaj UNIVERSITY_STUDENT

Class Discussion  What are the foreign keys in the CANDY database?  Does a table HAVE to have foreign keys?  How can you tell if a field is a foreign key?

Sample Database (CANDY) CANDY_CUSTOMER CANDY_PURCHASE CANDY_CUST_TYPE CANDY_PRODUCT

Rules for Relational Database Tables  Every record has to have a non-NULL (or “non- empty”) and unique PK value  Every FK value must be defined as a PK in its parent table