cs 464/564 introduction to database management …mueen/teaching/cs_464_564/...project 20% : there...

17
CS 464/564 Introduction to Database Management System Instructor: Abdullah Mueen LECTURE 1: INTRODUCTION

Upload: others

Post on 25-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

CS 464/564Introduction to Database Management SystemInstructor: Abdullah MueenLECTURE 1: INTRODUCTION

Page 2: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

About MeProf. Abdullah MueenOffice: B01 Travelstead Hall (Building 65 in Campus Map)Office Hours: Monday 10:30-12:00, Tuesday 10:30-12:00; other times by appointmentEmail: [email protected] Phone: 505-277-1914

Page 3: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Course PageWebpage: http://www.cs.unm.edu/~mueen/Teaching/CS_464_564/

Learn: https://learn.unm.edu/

Page 4: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Textbook and ReferencesDatabase Systems, The Complete Book (2nd Edition),by Hector Garcia-Molina, Jeffrey D. Ullman, and Jennifer Widom.

◦ Copies on reserve at the library (should be 2)◦ Homework assignments◦ Developed at Stanford, other schools◦ Slides by Jeffrey Ullman: http://www-db.stanford.edu/~ullman/dscb/pslides/pslides.html◦ Slides by Hector Garcia-Molina: http://www-db.stanford.edu/~hector/cs245/notes.htm◦ Slides by Arthur Keller: http://www.soe.ucsc.edu/classes/cmps180/Winter02◦ Slides by Rada Chirkova: http://courses.ncsu.edu/csc540/lec/001/

Page 5: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Course Outline Exams 60% : There will be two midterm exams and one final exam, worth 20% each.

Homework 20% : There will be five homework/assignments, typically due on every other Thursdays.

Project 20% : There will be a significant programming project. The project will have several checkpoints. Each group will develop a webpage in the department server. The page will be visible to everyone.

Two person group: Your responsibility. Form group by Jan 30th.

No individual project

Each group will do a unique project in a unique domain

Page 6: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Information Students are responsible for looking up deadlines in

Learn.

Deadlines are strict with zero tolerance.

See me in office hours if You don’t know any of the following languages

C/C++/Java/Python

You have not taken any algorithms class in your life

Page 7: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

CS464/564 The two sections will be graded at their own scale.

Homework, project, exams will have different questions for the two sections.

Page 8: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

CS Account Name

Email address

Section registered/waitlisted for: 464 or 564?

Do you have a CS account?

If yes, write down the account name

If no, Go to CS Support office (ECE 214) with your Lobocards.

Page 9: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Database Management System (DBMS)Specalized software that manages access to very large amounts of data:◦ Data persists over a long time◦ Efficent access◦ Concurrent access◦ Reliable and predictable access◦ Convenient interface language

Application examples:Airline reservation systems, banking, corporate records, etc.

Page 10: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Outline of the CourseDatabase Design: ◦ Entity-Relationship model: notation to express relationships among the data

(Chs 1, 4)◦ Relational model (Chs 2-3)

Database Programming:◦ Relational algebra: how to operate on relations (Ch 5)◦ Programming with SQL (Chs 6-8, 9)

Database Implementation:◦ storage management (Chs 13-14)◦ query processing (Chs 15-16)◦ transaction processing (Chs 17-19)

Page 11: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Relational Model IntroductionStore information in tables

Each table is a relation

Each column is named with an attribute

Each row is a tuple

Example relation named Accounts

accountNo balance type

12345 1000.0 savings

67890 2846.92 checking

Page 12: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Structured Query Language (SQL) PreviewAccounts

accountNo balance type

12345 1000.0 savings

67890 2846.92 checking

SELECT balanceFROM AccountsWHERE accountNo = 67890;

SELECT accountNoFROM AccountsWHERE type = 'savings'

AND balance < 0;

Page 13: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Setting up a DatabaseDatabase schema specifies what relations are in the database

Schema is altered using DDL (data definition language)

Only database administrator should be able to do this

Schema affects how the data is stored

Page 14: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Querying the DatabaseA query is expressed in a DML (data manipulation language), e.g. SQL

The query compiler translates a query into a query plan (sequence of operations to be performed)

Query compilation includes query parsing, query preprocessing and query optimization.

Execution engine performs the operations, interacting with storage manager, scheduler and logger, etc.

Page 15: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Storage and Buffer ManagementData is usually stored on disk, in units called blocks

Storage manager controls movement of data between disk and main memory

Buffer manager controls partitioning of main memory into block-sized regions

Relies on info about data, schema, statistics, and indexes (special data structures for efficient access)

Page 16: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

TransactionsUsually database queries are grouped into transactions

A transaction must satisfy the ACID properties:◦ Atomicity: Either all the changes or none of them are made to the database

◦ Consistency: transaction must preserve consistency constraints of the database

◦ Isolation: the result must be “as if” the transaction ran alone

◦ Durability: once transaction has completed, changes must not be lost

Page 17: CS 464/564 Introduction to Database Management …mueen/Teaching/CS_464_564/...Project 20% : There will be a significant programming project. The project will have several checkpoints

Transaction ProcessingEvery change is logged separately on disk by a log manager

After a system failure, recovery manager uses log on disk to reconstruct a consistent state

Scheduler ensures that concurrently executing transactions do not interfere with each other. In case of Deadlock the scheduler intervenes.