Sunteți pe pagina 1din 6

EECS 484: Database Management Systems

Instructor: Mike Cafarella


Email: michjc@umich.edu Office Hours: M 1-2, and by appt., BBB 4709 Lecture: Monday, Wednesday 9:00 at Chrysler Auditorium 10:30 at 1670 Beyster
Course Web Page: http://piazza.com/umich/winter2014/eecs484 Also, course CTools site has more info

What Is a DBMS?
! DBMS = Database Management System ! Database: Large, integrated collection of data. ! Models some real-world enterprise
! Entities (e.g., students, courses) ! Relationships (e.g., Lisa Simpson is taking EECS 484)

! DBMS: a software package designed to store and manage databases

1/7/14

EECS 484

Who Uses a DBMS?


! In short: everyone
! Your ! Your ! Your ! Your ! Your ! Your bank university coffee shop favorite website phone government

Why Use a DBMS?


! Data independence ! Efficient access ! Reduced application development time ! Uniform data administration ! Data integrity and security ! Concurrent access, recovery from crashes

! How many databases have you used so far today?


1/7/14
EECS 484

1/7/14

EECS 484

Why Study Databases?


! Data is useless without the tools to extract information from the data (queries)
! Optimal pricing of an airline ticket

484 Metadata
! GOAL: Basic introduction to database management systems. ! Two perspectives:
! External (Database user)
! Data models, ER model, relational model, SQL, database design ! Java/JDBC Project: Common platform for building database applications

! Datasets increasing in diversity and volume.


! Websites, Digital libraries, interactive video, Human Genome project, mobile applications ! ... need for DBMS exploding

! Internal (Database implementer)


! File organizations, access methods, sorting, concurrency control, recovery, ! Project: Build components of a Relational Database System

! Databases touch most of CS


! OS, languages, theory, AI, multimedia, logic,

! Preqreqs: EECS 281 or graduate standing, plus programming maturity

! Databases have as rich a history as OS, networks, etc. 1/7/14


EECS 484

1/7/14

EECS 484

This Class is Big


! Two sections and five sections!
! Lecture: 9am and 10:30am ! Disc: Fri @10:30, 11:30, 12:30, 2:30, 3:30

Textbook
! Textbook Database Management Systems, by Raghu Ramakrishnan & Johannes Gehrke. 3rd ed. ! Its not perfect, but is the best there is ! I assume youve done the reading for each lecture
! Life will be easier for you with the textbook

1/7/14

! Even so, the 10:30am class is hitting the classroom size limit ! I would like to allow everyone in (who has prereqs); were limited by room size ! Please drop the class formally if you dont want to take it; that will make room for others
EECS 484

! For some lectures, Ill ask you to watch online Coursera lectures before class
7 1/7/14
EECS 484

Accounts & Resources


! CTools
! For assignment submission, grading, lecture notes ! login to http://ctools.umich.edu using your kerberos and check that you can view the course web site.

Syllabus
! Posted to Ctools ! Will be updated as we go ! Information is subject to change!

! Piazza
! http://piazza.com/umich/winter2014/eecs484 ! Bulletin board for questions, discussion, help with assignments and projects.

1/7/14

EECS 484

1/7/14

EECS 484

10

Instructional Staff

Work and Grading


Midterm Final 4 of 5 written homeworks 22% 30% 8% 40%

Dana

Yijia Mike

Rahul

Four projects [each worth 10%]

! Email all of us: eecs484w14@umich.edu


! But for most questions, use Piazza!
1/7/14
EECS 484

11

1/7/14

EECS 484

12

Exams
! Midterm and Final ! Final is cumulative, but heavy emphasis on 2nd half; during the standard period
! Note: what is the standard period for a class with two timeslots? Were waiting to hear from the registrar; stay tuned

Homeworks
! Total of five homeworks ! Your best 4 count; worst one is dropped ! Done entirely by yourself ! Meant more for learning than evaluation ! Best 4 each count for 2% of your grade

! Count for 22% and 30% of your grade

1/7/14

EECS 484

13

1/7/14

EECS 484

14

Projects
! Total of four projects ! Each done in groups of size 2 ! Same partner for all projects ! Start looking for partners now!
! Register your group by Jan 13, using online form (announced via Ctools) ! Dont have a partner? Post to Piazza!

Discussion Sections
! Covers projects, hw, special topics ! Exams may have project-related questions ! Five Friday sections have identical content, but different instructors ! Stick to your discussion as a rule. But if you have to miss your section one week, feel free to attend a different one
15 1/7/14
EECS 484

! Each counts for 10% of your grade


1/7/14
EECS 484

16

Discussion: This Week Only


! Well review Java for people who have never seen it before ! If youre an ace Java programmer, no need to attend for this week only ! Starting Jan 17, plan on attending each discussion

Handin Policies
! Homework
! Typically due by 11:55PM on Thursday nights, before discussion the next day ! No late submissions accepted ! Worst homework dropped from total

! Projects
! 2 free late days total for all projects ! 1% course grade for each late day allowed beyond the free day Up to 2 late days allowed per project

1/7/14

EECS 484

17

1/7/14

EECS 484

18

Academic Honesty
! CoE Honor Code applies for all students ! Specifics on course website ! In general:
! Homeworks and exams are your work alone ! Projects are collaboration with your partner

Projects 1 & 2: Fakebook


! Project 1 is to design a database for information gleaned from Facebook, and then to populate it.
! We will provide (fake) data, but will give you the tools (and encourage you) to obtain your own data from your Facebook account.

! Can discuss work with others, but not copy ! Questions? Ask us first!
1/7/14
EECS 484

! Project 2 is to query this database, in a mix of SQL and Java.

19

1/7/14

EECS 484

20

Project 3: Query Optimization


! Use PostgreSQL to explore query optimization techniques ! Optimizers are extremely complex pieces of software, hard to observe directly ! Modify database and index design to investigate what real database optimizer does

Project 4: Minirel
! Build key query processing subsystem of a DBMS
! Programming intensive, implemented in C++

! Plug these into a skeleton database framework


! Practice reading and understanding source code

! Yields a simple relational database engine

1/7/14

EECS 484

21

1/7/14

EECS 484

22

Java
! Databases are most often accessed via SQL. ! But SQL is usually embedded in, and called from, a traditional programming language. ! Java is the most common choice, and so the one we have chosen for this course.

Data Models
! Data model: a collection of concepts for describing data. ! Schema: a description of a particular collection of data, using a given data model. ! Relational model: the most widely-used model today.
! Data model: Database is a collection of relations A relation is a table with rows and columns. ! Every relation has a schema, which describes the columns (also called the fields or attributes). ! Each row also called a tuple

! Entity-Relationship (ER) model: A semantic data model, i.e. a higher-level more user-intuitive model
1/7/14
EECS 484

! A (relational) DBMS only understands the relational model ! Must translate an ER schema to a relational schema
23 1/7/14
EECS 484

24

Example: University Database


! Three tables
! Students(sid:string, name:string, login:string, age:integer) ! Courses(cid: string, cname:string, credits:integer) ! Enrolled(sid:string, cid:string, grade:string)
Students
sid 13 41 name login Lisa Bart lsimp bart age 40 20

Levels of Abstraction
External Schema 1
! Conceptual schema: defines logical structure (aka logical schema) ! Physical schema: describes the files and indexes used. ! External schema: describe how users see the data, views ! Many external schemas, 1 conceptual (logical) schema & "! Schemas are defined using Data Definition Language (DDL) 1 physical schema. "! Data is modified/queried using Data Manipulation Language (DML)
25 1/7/14
EECS 484

External Schema 2

Conceptual Schema Physical Schema

Courses
cid cname Cr. 4 3

Enrolled
sid 41 13 cid E-484 E-584 Grade AA+

E-484 EECS484 E-584 EECS584

1/7/14

EECS 484

26

Example: University Database


! Conceptual schema:
! Students(sid: string, name: string, login: string, age: integer) ! Courses(cid: string, cname: string, credits: integer) ! Enrolled(sid: string, cid: string, grade: string)

Data Independence
! Applications insulated from data format and storage details. ! Logical data independence: Protection from changes in logical structure of data.
! External / Conceptual schemas

! Physical schema:
! Relations stored as unordered files. ! Index on first column of Students.

! External Schema:
! View: Course_info(cid: string, enrollment: integer) ! View: Class_rank(sid: string, gpa: real, rank: integer)

! Physical data independence: Protection from changes in physical structure of data.


! Conceptual / Physical schemas One of the key benefits Other key benefits: of using a DBMS #! declarative query processing #! transactions
27 1/7/14
EECS 484

1/7/14

EECS 484

28

Transactions
You Read Balance: $100 Yes Sufficient funds? Pay $25 New balance: $75
Bank Balance : $75! Bank Balance : $100

Lots of People use DBMS ...


Your Significant Other Read Balance: $100 Sufficient funds? Pay $25 New balance: $75 Yes

! DBMS vendors ! DB application programmers


! E.g. webmasters, chemists, astronomers, sociologists, economists, etc, etc, etc

! Special role: Database administrator (DBA)


! ! ! ! Designs logical /physical schemas Handles security and authorization Data availability, crash recovery Database tuning as needs evolve

! Inconsistency caused by interleaving actions of different user programs ! DBMS provides the illusion of a single-user system ! Key concept: Transaction, an atomic sequence of R/W ! Concurrency control, transaction management
1/7/14
EECS 484

Must understand how a DBMS works!


29 1/7/14
EECS 484

30

Summary
! DBMS used to maintain, query large datasets ! Benefits include recovery from system crashes, concurrent access, quick application development, data integrity and security ! Levels of abstraction give data independence ! DBMS R&D is one of the most exciting areas in CS

1/7/14

EECS 484

31

S-ar putea să vă placă și