Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Database Systems 1. Pop Quiz Question 1: How often do you use a database system or database system application? a)At least once a day.

Similar presentations


Presentation on theme: "Introduction to Database Systems 1. Pop Quiz Question 1: How often do you use a database system or database system application? a)At least once a day."— Presentation transcript:

1 Introduction to Database Systems 1

2 Pop Quiz Question 1: How often do you use a database system or database system application? a)At least once a day (LOVE my db apps) b)About once a week (anything to get out of cleaning my room) c)Very rarely, if ever (only at gunpoint) 2

3 Pop Quiz Question 2: Who are the people below and how are they related to our course? Some clues: –3 out of 4 are multi-billionaires –3 out of 4 dropped out of school –(3 out of 4 are Jewish) 3 Conclusions: 1.Dropping out of school may be a good strategy 2.Patent your ideas! 3.Understanding and developing databases can make you rich or famous (or both)

4 What is a database? Database: A collection of data Data Base Management System (DBMS): A software system that facilitates the creation, maintenance and use of an electronic database Examples on the Web: – Examples off the Web: – 4

5 Some History 5

6 History: 1960s Required by companies with data processing needs: banking, airline reservations, corporate record keeping Databases were navigational Accessed by entire programs 6 Courses Databases AITaken By John Jane

7 History: 1970s Codd (at IBM) introduces the relational model Conceptually, data is stored in tables, connected by keys Codd introduces relational algebra, for querying, which became the basis for SQL End 1970s, first DBMS-s hit the market 7 CourseStudies DBS1 DBS2 AIS1 StudIdNamePhone Number S1John234-5678 S2Jane444-2218

8 Moore’s Law Reversed Moore’s Law: Processing power doubles every 18 months Amount of data doubles every 9 months –Disk sales (# of bits) doubles every 9 months –Parkinson’s Law: Data expands to fill the space available for storage Moore’s Law reversed: –Time to process all data doubles every 18 months! Does your attention span double every 18 months? –No, so we need smarter data management techniques 8

9 Some of the Challenges 9

10 Designing the Schema Real world requirements for data are complex How do you choose which tables to store data in? Does it even matter? Example: University Database –Students have names, tz, addresses, phone numbers –Courses have numbers, names, number of credits –Students register for courses What kind of tables do we need? 10

11 Is this Good? Stud Name Stud TZ Stud Address Stud Phone Course Name Course Num Course Credits 11 StudentCourseInfo

12 Is this Good? Stud Name Stud TZ Stud Address Stud Phone 12 Students Courses Course Name Course Num Course Credits Stud TZ Course Num Registered Can the notion of “good” be quantified in some way?

13 Processing the Data How would we find all courses for which the student with TZ 12345678 is registered? Can sorting help? How can we sort efficiently? Sorting Data Interview at Google 13

14 Persistent Data Jane has a joint bank account containing 150 shekels Jane goes to the ATM (כספומט) to withdraw 100 shekels 1) prompt user for credit card; 2) get balance from bank database; 3) if balance >= 100 then balance := balance - 100; 4) emit the money 5) if OK then put new balance into database; else print "sorry" What happens if the ATM crashes after line 3? line 4? Would exchanging lines 4 and 5 help? 14

15 Multiple Concurrent Users Jane and John have a joint bank account containing 150 shekels Jane goes to the ATM (כספומט) to withdraw 100 shekels John goes to a different ATM (כספומט) to withdraw 100 shekels Do they both succeed win withdrawing 100 shekels? What is the balance at the end? 15

16 Main Features of a DBMS 16

17 Some of the Main Features (1) Levels of Abstraction: The conceptual schema (= manner in which the data seems to be stored to the user, usually in tables), is independent from the physical schema (= actual method of storage on disk, e.g., using hash tables, etc). –Makes changes to physical storage easier –Makes access for user easier 17

18 Some of the Main Features (2) ACID Properties: Atomicity, consistency, isolation and durability –Basically implies that system will behave “as expected” even if there are multiple users and system crashes Efficiency: Although data will typically be huge (not fit in main memory), special access methods are available to make data retrieval efficient –We need efficiency in practice and not only an O(…) theoretical efficiency guarantee –“In theory there's no difference between theory and practice. In practice there is” 18


Download ppt "Introduction to Database Systems 1. Pop Quiz Question 1: How often do you use a database system or database system application? a)At least once a day."

Similar presentations


Ads by Google