CMSC424: Review. Database Management Systems Manage data ► Store data ► Update data ► Answer questions about the data.

Slides:



Advertisements
Similar presentations
IiWAS2002, Bandung, Indonesia Teaching and Learning Databases Dr. Stéphane Bressan National University of Singapore.
Advertisements

CMSC424: Database Design Instructor: Amol Deshpande
Adapted from: ©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Fly-over Introduction Purpose of Database Systems View of Data Data.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Wrapup Amol Deshpande CMSC424. “Inventing the Future” Wednesday at 3:30pm 1115 CSIC Exam.
BD05/06 Chapter 1: Introduction  Purpose of database systems  Data abstraction levels  Data models  SQL :Data Definition Language and Data Manipulation.
Database Management System (DBMS)
CMSC424: Database Design Instructor: Amol Deshpande
Ch1: File Systems and Databases Hachim Haddouti
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 1 Database Systems I Introduction.
On Database Systems.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
CMSC724: Database Management Systems Instructor: Amol Deshpande
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Database Management Systems Purpose of Database Systems View of Data.
CMSC424, Spring 2005 CMSC424: Database Design Instructor: Amol Deshpande
ECE 569 Database System EngineeringFall 2004 ECE 569 Database System Engineering Fall 2004 Yanyong Zhang:
...Looking back Why use a DBMS? How to design a database? How to query a database? How does a DBMS work?
Compe 301 ER - Model. Today DBMS Overview Data Modeling Going from conceptual requirements of a application to a concrete data model E/R Model.
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Introduction to DBMS Purpose of Database Systems View of Data
CS462: Introduction to Database Systems. ©Silberschatz, Korth and Sudarshan1.2Database System Concepts Course Information Instructor  Kyoung-Don (KD)
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Temple University – CIS Dept. CIS616– Principles of Database Systems V. Megalooikonomou Introduction (based on notes by Silberchatz,Korth, and Sudarshan)
ADVANCED DATABASES WITH ORACLE 11g FOR ADDB7311 LEARNING UNIT 1 of 7.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Introduction to Databases
Overview of a Database Management System
Introduction. 
Chapter 1: Introduction. Unite International College1.2Database Management Systems Chapter 1: Introduction Purpose of Database Systems View of Data Database.
CST203-2 Database Management Systems Lecture 2. One Tier Architecture Eg: In this scenario, a workgroup database is stored in a shared location on a single.
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
Database Management Systems
Database Organization and Design
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 4:15 pm – 5:30.
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
CS 162 Discussion Section Week 9 11/11 – 11/15. Today’s Section ●Project discussion (5 min) ●Quiz (10 min) ●Lecture Review (20 min) ●Worksheet and Discussion.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: M,T,W,Th,F 2:30 pm – 3:30 pm,
INFS614, Dr. Brodsky, GMU1 Database Management Systems INFS 614 Instructor: Professor Alex Brodsky
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Chapter 1 Introduction Yonsei University 1 st Semester, 2015 Sanghyun Park.
Introduction to Database Management Systems. Information Instructor: Csilla Farkas Office: Swearingen 3A43 Office Hours: Monday, Wednesday 2:30 pm – 3:30.
1 CS3431 – Database Systems I Introduction Instructor: Mohamed Eltabakh
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
Instructor: Amol Deshpande  Motivation ◦ Why study databases ?  Syllabus  Administrivia ◦ Workload etc  Data management challenges.
Chapter 1 Introduction Yonsei University 1 st Semester, 2014 Sanghyun Park.
Introduction.  Administration  Simple DBMS  CMPT 454 Topics John Edgar2.
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Mr.Prasad Sawant, MIT Pune India Introduction to DBMS.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Transaction Processing Concepts Muheet Ahmed Butt.
Chapter 1: Introduction
ASET 1 Amity School of Engineering & Technology B. Tech. (CSE/IT), III Semester Database Management Systems Jitendra Rajpurohit.
CS3431: C-Term CS3431 – Database Systems I Introduction Instructor: Mohamed Eltabakh
Lecture on Database Management System
Database System Concepts Introduction Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Transaction.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
CHAPTER 1: INTRODUCTION Purpose of Database Systems View of Data Data Models Data Definition Language Data Manipulation Language Storage Management Database.
SQL Basics Review Reviewing what we’ve learned so far…….
Database System Concepts, 5th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 1: Introduction.
Introduction to DBMS Purpose of Database Systems View of Data
Introduction To DBMS.
Chapter 1: Introduction
Chapter 1: Introduction
Introduction to Database Systems
Chapter 1: Introduction
Introduction to DBMS Purpose of Database Systems View of Data
Chapter 1: Introduction
Chapter 1: Introduction
Data Independence Applications insulated from how data is structured and stored. Logical data independence: Protection from changes in logical structure.
Presentation transcript:

CMSC424: Review

Database Management Systems Manage data ► Store data ► Update data ► Answer questions about the data

What kind of data ? ► Enterprise data  Banking  Supermarkets, Sales  Airlines  Universities  Manufacturing  Human resources ► More recent:  Semi-structured Data (XML)  Scientific data  Biological data  Sensor network data etc etc…

Naïve solutions ► Don’t offer:  Consistency ► Atomicity, durability etc  Concurrency  Declarative data retrieval  Control of redundancy  Dynamic data evolution

DBMS ► Database Management Systems provide  Data abstraction ► Key in evolving systems ► Probably the most important purpose of a DBMS ► Goal: Hiding low-level details from the users of the system  Guarantees about data integrity ► In presence of concurrent access, failures…  Speed !!

Data Abstraction Logical Level Physical Level View Level View 1View 2View n … How data is actually stored ? e.g. are we using disks ? Which file system ? What data is stored ? describe data properties such as data semantics, data relationships What data users and application programs see ?

DBMS at a Glance 1. Data Modeling 2. Data Retrieval 3. Data Storage 4. Data Integrity

Data Modeling ► A data model is a collection of concepts for describing data properties and domain knowledge:  Data relationships  Data semantics  Data constraints ► We discussed two models:  Entity-relationship Model ► Diagrammatic representation ► Easier to work with ► Syntax not important, but remember the “meaning” ► Remember what you can model  Relational Model ► Only one abstract concept ► Closer to the physical representation on disk ► Normalization

Data Retrieval ► Query = Declarative data retrieval program  describes what data to acquire, not how to acquire it  Non-declarative: ► scan the accounts file ► look for number 55 in the 2 nd field ► subtract $50 from the 3 rd field  Declarative (posed against the tables abstraction): update accounts update accounts set balance = balance - 50 set balance = balance - 50 where acct_no = 55 where acct_no = 55 ► Why ?  Easier to write  More efficient to execute ► Database system can decide how to execute it

Data Storage ► Where and how to store data ?  Main memory ? ► What if the database larger than memory size ?  Disks ► We discussed properties of disks ► RAID ► How to move data between memory and disk ?  Buffer Management ► LRU, MRU, Clock  Indexes ► Closely tied to data retrieval ► B+-trees, Hashing

Data Integrity Manage concurrency and crashes  Transaction: A sequence of database actions enclosed within special tags  Properties: ► Atomicity: Entire transaction or nothing ► Consistency: Transaction, executed completely, take database from one consistent state to another ► Isolation: Concurrent transactions appear to run in isolation ► Durability: Effects of committed transactions are not lost  Consistency: Transaction programmer needs to guarantee that ► DBMS can do a few things, e.g., enforce constraints on the data  Rest: DBMS guarantees ► Haven’t covered in class yet

Data Integrity ► Semantic constraints  Typically specified at the logical level  E.g. balance > 0 ► Assert statements ► Functional dependencies  kinda

DBMS at a glance ► Data Models  Conceptual representation of the data ► Data Retrieval  How to ask questions of the database  How to answer those questions ► Data Storage  How/where to store data, how to access it ► Data Integrity  Manage crashes, concurrency  Manage semantic inconsistencies ► Not fully disjoint categorization !!

SQL Assignment Report the home run champs in the last three years (2002 to 2004). select h.year, firstname, lastname, h.hrs from playerinfo p, hitting h where p.playerid = h.playerid and h.hrs = ( select max(hrs) from hitting h2 where h.year = h2.year);

SQL Assignment select firstname, lastname from playerinfo where firstname <= all (select firstname from playerinfo) and lastname <= all ( select lastname from playerinfo p2 where p2.firstname = playerinfo.firstname); Report the last name of the batter who would be reported first in alphabetical order.

SQL Assignment 20 Create the dream NL batting team (that will have the most total RBI) from 2004 statistics. Remember, a NL team consists of 1 LF, 1CF, 1RF, 1 SS, 1 2B, 1 3B, 1 1B, 1 Catcher, and 1 Pitcher. Only consider the position at which the hitter played the maximum number of games; so a player will only qualify at one fielding position. Break Ties arbitrarily.

create table rbistable as select p.firstname, p.lastname, p.playerid, h.rbis, f.pos from playerinfo p, hitting h, fielding f where p.playerid = h.playerid and f.playerid = h.playerid and f.year = 2004 and h.year = 2004 and f.numgames = (select max(f2.numgames) from fielding f2 where f2.playerid = f.playerid and f2.year = f.year); create table rbistable2 as select firstname, lastname, pos, rbis, playerid from rbistable r1 where r1.rbis = (select max(r2.rbis) from rbistable r2 where r2.pos = r1.pos); select firstname, lastname, pos, rbis from rbistable2 r where playerid <= all (select playerid from rbistable2 r2 where r2.pos = r.pos);

22 Rank the 2004 teams by their number of wins. The output should contains a table with two columns: Team Name, and Rank (between 1 and 30), and it should be sorted by Rank. Two teams with same number of wins will be ranked the same, and the next rank will be skipped in that case. select t1.teamname, t1.wins, 31 - count(t2.teamname) as rank from teams t1, teams t2 where t1.year = 2004 and t1.year = t2.year and t1.losses <= t2.losses group by t1.teamname, t1.wins order by rank;