Introduction to  Information Systems SSC, Semester 6 Lecture 01
Staff <ul><li>Instructors:  </li></ul><ul><ul><li>Karl Aberer, BC 108, karl aberer at epfl ch </li></ul></ul><ul><ul><li>P...
Communications <ul><li>Web page: lsirww.epfl.ch </li></ul><ul><ul><li>Lectures will be available here </li></ul></ul><ul><...
Textbook <ul><li>Main textbook: </li></ul><ul><li>Databases and Transaction Processing ,  An application-oriented approach...
Other Texts <ul><li>Many classic textbooks (each of them will do it) </li></ul><ul><li>Database Systems: The Complete Book...
Material on the Web <ul><li>SQL Intro </li></ul><ul><li>SQL for Web Nerds,  by Philip Greenspun,  http://philip.greenspun....
The Course <ul><li>Goal: Teaching RDBMS (standard) with a strong emphasis on the Web </li></ul><ul><li>Fortunately others ...
Acknowledgement <ul><li>Build on UoW course </li></ul><ul><ul><li>many slides </li></ul></ul><ul><ul><li>many exercise </l...
Outline for Today’s Lecture <ul><li>Overview of database systems </li></ul><ul><li>Course Outline </li></ul><ul><li>First ...
What is behind this Web Site? <ul><li>http://immo.search.ch/   </li></ul><ul><li>Search on a large database </li></ul><ul>...
Database Management Systems <ul><li>Database Management System = DBMS </li></ul><ul><li>A collection of files that store t...
Where are RDBMS used ? <ul><li>Backend for traditional “database” applications </li></ul><ul><ul><li>EPFL administration <...
Example of a Traditional Database Application <ul><li>Suppose we are building a system  </li></ul><ul><li>to store the inf...
Can we do it without a DBMS ? <ul><li>Sure we can!  Start by storing the data in files: </li></ul><ul><li>students.txt  co...
Doing it without a DBMS... <ul><li>Enroll “Mary Johnson” in “CSE444”: </li></ul><ul><ul><li>Read ‘students.txt’ </li></ul>...
Problems without an DBMS... <ul><li>System crashes: </li></ul><ul><ul><li>What is the problem ? </li></ul></ul><ul><li>Lar...
Enters a DBMS Data files Database server (someone else’s C program) Applications “ Two tier system” or “client-server” con...
Functionality of a DBMS <ul><li>The programmer sees SQL, which has two components: </li></ul><ul><li>Data Definition Langu...
How the Programmer Sees the DBMS <ul><li>Start with DDL to  create tables : </li></ul><ul><li>Continue with DML to  popula...
How the Programmer Sees the DBMS <ul><li>Tables: </li></ul><ul><li>Still implemented as files, but behind the scenes can b...
Transactions <ul><li>Enroll “Mary Johnson” in “CSE444”: </li></ul>BEGIN TRANSACTION;  INSERT INTO Takes SELECT Students.SS...
Transactions <ul><li>A  transaction  = sequence of statements that either all succeed, or all fail </li></ul><ul><li>Trans...
Queries <ul><li>Find all courses that “Mary” takes </li></ul><ul><li>What happens behind the scene ? </li></ul><ul><ul><li...
Queries, behind the scene Imperative query execution plan: SELECT  C.name FROM   Students S, Takes T, Courses C WHERE S.na...
Database Systems <ul><li>The big commercial database vendors: </li></ul><ul><ul><li>Oracle </li></ul></ul><ul><ul><li>IBM ...
Databases and the Web <ul><li>Accessing databases through web interfaces </li></ul><ul><ul><li>Java programming interface ...
Database Integration <ul><li>Combining data from different databases </li></ul><ul><ul><li>collection of data (wrapping) <...
Other Trends in Databases <ul><li>Industrial </li></ul><ul><ul><li>Object-relational databases </li></ul></ul><ul><ul><li>...
Course Outline  (Details on the Web) <ul><li>Part I </li></ul><ul><li>SQL (Chapter 6) </li></ul><ul><li>The relational dat...
Structure <ul><li>Prerequisites:  </li></ul><ul><ul><li>Programming courses </li></ul></ul><ul><ul><li>Data structures </l...
The Project <ul><li>Models the real data management needs of a Web company </li></ul><ul><ul><li>Phase 1: Modelling and Da...
The Project – Side Effects <ul><li>Trains your soft skills </li></ul><ul><ul><li>team work </li></ul></ul><ul><ul><li>deal...
Practical Concerns <ul><li>New course, expect some hickups </li></ul><ul><li>Important to keep time schedule </li></ul><ul...
 
So what is this course about, really ? <ul><li>A bit of everything ! </li></ul><ul><li>Languages: SQL, XPath, XQuery </li>...
Upcoming SlideShare
Loading in …5
×

Introduction to Database Systems

933 views
690 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
933
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Database Systems

  1. 1. Introduction to Information Systems SSC, Semester 6 Lecture 01
  2. 2. Staff <ul><li>Instructors: </li></ul><ul><ul><li>Karl Aberer, BC 108, karl aberer at epfl ch </li></ul></ul><ul><ul><li>Philippe Cudré-Mauroux, BC 114, philippe cudre-mauroux at epfl ch </li></ul></ul><ul><ul><li>Office hours: by appointment </li></ul></ul><ul><li>TAs: </li></ul><ul><ul><li>Gleb Skobeltsyn (exercises) </li></ul></ul><ul><ul><li>Martin Rubli (project) </li></ul></ul>
  3. 3. Communications <ul><li>Web page: lsirww.epfl.ch </li></ul><ul><ul><li>Lectures will be available here </li></ul></ul><ul><ul><li>Homeworks and solutions will be posted here </li></ul></ul><ul><ul><li>The project description and resources will be here </li></ul></ul><ul><li>Newsgroup: </li></ul><ul><ul><li>epfl.ic.cours.IIS </li></ul></ul>
  4. 4. Textbook <ul><li>Main textbook: </li></ul><ul><li>Databases and Transaction Processing , An application-oriented approach Philip M. Lewis, Arthur Bernstein, Michael Kifer, Addison-Wesley 2002. </li></ul>
  5. 5. Other Texts <ul><li>Many classic textbooks (each of them will do it) </li></ul><ul><li>Database Systems: The Complete Book , Hector Garcia-Molina, Jeffrey Ullman, Jennifer Widom </li></ul><ul><li>Database Management Systems , Ramakrishnan </li></ul><ul><li>Fundamentals of Database Systems , Elmasri, Navathe </li></ul><ul><li>Database Systems , Date (7. edition) </li></ul><ul><li>Modern Database Management, Hoffer, (4. edition) </li></ul><ul><li>Database Systems Concepts , Silverschatz, (4. edition) </li></ul>
  6. 6. Material on the Web <ul><li>SQL Intro </li></ul><ul><li>SQL for Web Nerds, by Philip Greenspun, http://philip.greenspun.com/sql/ </li></ul><ul><li>Java Technology </li></ul><ul><li>java.sun.com </li></ul><ul><li>WWW Technology </li></ul><ul><li>www.w3c.org </li></ul>
  7. 7. The Course <ul><li>Goal: Teaching RDBMS (standard) with a strong emphasis on the Web </li></ul><ul><li>Fortunately others already did it </li></ul><ul><ul><li>Alon Halevy, Dan Suciu, Univ. of Washington </li></ul></ul><ul><ul><li>http://www.cs.washington.edu/education/courses/cse444/ </li></ul></ul><ul><ul><li>http://www.acm.org/sigmod/record/issues/0309/4.AlonLevy.pdf </li></ul></ul>
  8. 8. Acknowledgement <ul><li>Build on UoW course </li></ul><ul><ul><li>many slides </li></ul></ul><ul><ul><li>many exercise </li></ul></ul><ul><ul><li>ideas for the project </li></ul></ul><ul><li>Main difference </li></ul><ul><ul><li>less theory </li></ul></ul><ul><ul><li>will use real Web data in the project </li></ul></ul>
  9. 9. Outline for Today’s Lecture <ul><li>Overview of database systems </li></ul><ul><li>Course Outline </li></ul><ul><li>First Steps in SQL </li></ul>
  10. 10. What is behind this Web Site? <ul><li>http://immo.search.ch/ </li></ul><ul><li>Search on a large database </li></ul><ul><li>Specify search conditions </li></ul><ul><li>Many users </li></ul><ul><li>Updates </li></ul><ul><li>Access through a web interface </li></ul>
  11. 11. Database Management Systems <ul><li>Database Management System = DBMS </li></ul><ul><li>A collection of files that store the data </li></ul><ul><li>A big C program written by someone else that accesses and updates those files for you </li></ul><ul><li>Relational DBMS = RDBMS </li></ul><ul><li>Data files are structured as relations (tables) </li></ul>
  12. 12. Where are RDBMS used ? <ul><li>Backend for traditional “database” applications </li></ul><ul><ul><li>EPFL administration </li></ul></ul><ul><li>Backend for large Websites </li></ul><ul><ul><li>Immosearch </li></ul></ul><ul><li>Backend for Web services </li></ul><ul><ul><li>Amazon </li></ul></ul>
  13. 13. Example of a Traditional Database Application <ul><li>Suppose we are building a system </li></ul><ul><li>to store the information about: </li></ul><ul><li>students </li></ul><ul><li>courses </li></ul><ul><li>professors </li></ul><ul><li>who takes what, who teaches what </li></ul>
  14. 14. Can we do it without a DBMS ? <ul><li>Sure we can! Start by storing the data in files: </li></ul><ul><li>students.txt courses.txt professors.txt </li></ul><ul><li>Now write C or Java programs to implement specific tasks </li></ul>
  15. 15. Doing it without a DBMS... <ul><li>Enroll “Mary Johnson” in “CSE444”: </li></ul><ul><ul><li>Read ‘students.txt’ </li></ul></ul><ul><ul><li>Read ‘courses.txt’ </li></ul></ul><ul><ul><li>Find&update the record “Mary Johnson” </li></ul></ul><ul><ul><li>Find&update the record “CSE444” </li></ul></ul><ul><ul><li>Write “students.txt” </li></ul></ul><ul><ul><li>Write “courses.txt” </li></ul></ul>Write a C/Java program to do the following:
  16. 16. Problems without an DBMS... <ul><li>System crashes: </li></ul><ul><ul><li>What is the problem ? </li></ul></ul><ul><li>Large data sets (say 50GB) </li></ul><ul><ul><li>Why is this a problem ? </li></ul></ul><ul><li>Simultaneous access by many users </li></ul><ul><ul><li>Lock students.txt – what is the problem ? </li></ul></ul><ul><ul><li>Read ‘students.txt’ </li></ul></ul><ul><ul><li>Read ‘courses.txt’ </li></ul></ul><ul><ul><li>Find&update the record “Mary Johnson” </li></ul></ul><ul><ul><li>Find&update the record “CSE444” </li></ul></ul><ul><ul><li>Write “students.txt” </li></ul></ul><ul><ul><li>Write “courses.txt” </li></ul></ul>CRASH !
  17. 17. Enters a DBMS Data files Database server (someone else’s C program) Applications “ Two tier system” or “client-server” connection (ODBC, JDBC)
  18. 18. Functionality of a DBMS <ul><li>The programmer sees SQL, which has two components: </li></ul><ul><li>Data Definition Language - DDL </li></ul><ul><li>Data Manipulation Language - DML </li></ul><ul><ul><li>query language </li></ul></ul><ul><li>Behind the scenes the DBMS has: </li></ul><ul><li>Query engine </li></ul><ul><li>Query optimizer </li></ul><ul><li>Storage management </li></ul><ul><li>Transaction Management (concurrency, recovery) </li></ul>
  19. 19. How the Programmer Sees the DBMS <ul><li>Start with DDL to create tables : </li></ul><ul><li>Continue with DML to populate tables: </li></ul>CREATE TABLE Students ( Name CHAR(30) SSN CHAR(9) PRIMARY KEY NOT NULL, Category CHAR(20) ) . . . INSERT INTO Students VALUES(‘Charles’, ‘123456789’, ‘undergraduate’) . . . .
  20. 20. How the Programmer Sees the DBMS <ul><li>Tables: </li></ul><ul><li>Still implemented as files, but behind the scenes can be quite complex </li></ul>Students: Takes: Courses: “ data independence ” = separate logical view from physical implementation
  21. 21. Transactions <ul><li>Enroll “Mary Johnson” in “CSE444”: </li></ul>BEGIN TRANSACTION; INSERT INTO Takes SELECT Students.SSN, Courses.CID FROM Students, Courses WHERE Students.name = ‘Mary Johnson’ and Courses.name = ‘CSE444’ -- More updates here.... IF everything-went-OK THEN COMMIT; ELSE ROLLBACK If system crashes, the transaction is still either committed or aborted
  22. 22. Transactions <ul><li>A transaction = sequence of statements that either all succeed, or all fail </li></ul><ul><li>Transactions have the ACID properties: </li></ul><ul><ul><li>A = atomicity (a transaction should be done or undone completely ) </li></ul></ul><ul><ul><li>C = consistency (a transaction should transform a system from one consistent state to another consistent state) </li></ul></ul><ul><ul><li>I = isolation (each transaction should happen independently of other transactions ) </li></ul></ul><ul><ul><li>D = durability (completed transactions should remain permanent) </li></ul></ul>
  23. 23. Queries <ul><li>Find all courses that “Mary” takes </li></ul><ul><li>What happens behind the scene ? </li></ul><ul><ul><li>Query processor figures out how to answer the query efficiently. </li></ul></ul>SELECT C.name FROM Students S, Takes T, Courses C WHERE S.name=“Mary” and S.ssn = T.ssn and T.cid = C.cid
  24. 24. Queries, behind the scene Imperative query execution plan: SELECT C.name FROM Students S, Takes T, Courses C WHERE S.name=“Mary” and S.ssn = T.ssn and T.cid = C.cid Declarative SQL query The optimizer chooses the best execution plan for a query Students Takes sid=sid sname name=“Mary” cid=cid Courses
  25. 25. Database Systems <ul><li>The big commercial database vendors: </li></ul><ul><ul><li>Oracle </li></ul></ul><ul><ul><li>IBM (with DB2) </li></ul></ul><ul><ul><li>Microsoft (SQL Server) </li></ul></ul><ul><ul><li>Sybase </li></ul></ul><ul><li>Some free database systems (Unix) : </li></ul><ul><ul><li>Postgres </li></ul></ul><ul><ul><li>MySQL </li></ul></ul><ul><ul><li>Predator </li></ul></ul>
  26. 26. Databases and the Web <ul><li>Accessing databases through web interfaces </li></ul><ul><ul><li>Java programming interface (JDBC) </li></ul></ul><ul><ul><li>Embedding into HTML pages (JSP) </li></ul></ul><ul><ul><li>Access through http protocol (Web Services) </li></ul></ul><ul><li>Using Web document formats for data definition and manipulation </li></ul><ul><ul><li>XML, Xquery, Xpath </li></ul></ul><ul><ul><li>XML databases and messaging systems </li></ul></ul>
  27. 27. Database Integration <ul><li>Combining data from different databases </li></ul><ul><ul><li>collection of data (wrapping) </li></ul></ul><ul><ul><li>combination of data and generation of new views on the data (mediation) </li></ul></ul><ul><li>Problem: heterogeneity </li></ul><ul><ul><li>access, representation, content </li></ul></ul><ul><li>Example revisited </li></ul><ul><ul><li>http:// immo.search.ch / </li></ul></ul><ul><ul><li>http://www.swissimmo.ch </li></ul></ul>
  28. 28. Other Trends in Databases <ul><li>Industrial </li></ul><ul><ul><li>Object-relational databases </li></ul></ul><ul><ul><li>Main memory database systems </li></ul></ul><ul><ul><li>Data warehousing and mining </li></ul></ul><ul><li>Research </li></ul><ul><ul><li>Peer-to-peer data management </li></ul></ul><ul><ul><li>Stream data management </li></ul></ul><ul><ul><li>Mobile data management </li></ul></ul>
  29. 29. Course Outline (Details on the Web) <ul><li>Part I </li></ul><ul><li>SQL (Chapter 6) </li></ul><ul><li>The relational data model (Chapter 3) </li></ul><ul><li>Database design (Chapters 2, 3, 7) </li></ul><ul><li>XML, XPath, XQuery </li></ul><ul><li>Part II </li></ul><ul><li>Indexes (Chapter 13) </li></ul><ul><li>Transactions and Recovery (Chapter 17 - 18) </li></ul><ul><li>Exam </li></ul>
  30. 30. Structure <ul><li>Prerequisites: </li></ul><ul><ul><li>Programming courses </li></ul></ul><ul><ul><li>Data structures </li></ul></ul><ul><li>Work & Grading: </li></ul><ul><ul><li>Homeworks (4): 0% </li></ul></ul><ul><ul><li>Exam (like homeworks): 50% </li></ul></ul><ul><ul><li>Project: 50% (see next) – each phase graded separately </li></ul></ul>
  31. 31. The Project <ul><li>Models the real data management needs of a Web company </li></ul><ul><ul><li>Phase 1: Modelling and Data Acquisition </li></ul></ul><ul><ul><li>Phase 2: Data integration and Applications </li></ul></ul><ul><ul><li>Phase 3: Services </li></ul></ul><ul><li>&quot;One can only start to appreciate database systems by actually trying to use one&quot; (Halevy) </li></ul><ul><li>Any SW/IT company will love you for these skills  </li></ul>
  32. 32. The Project – Side Effects <ul><li>Trains your soft skills </li></ul><ul><ul><li>team work </li></ul></ul><ul><ul><li>deal with bugs, poor documentation, … </li></ul></ul><ul><ul><li>produce with limited time resources </li></ul></ul><ul><ul><li>project management and reporting </li></ul></ul><ul><li>Results useful for you personally </li></ul><ul><ul><li>Demo: </li></ul></ul><ul><li>Project should be fun  </li></ul>
  33. 33. Practical Concerns <ul><li>New course, expect some hickups </li></ul><ul><li>Important to keep time schedule </li></ul><ul><li>Communication through Web </li></ul><ul><li>Newsgroup </li></ul><ul><li>Student committee for regular feedback (2 volunteers) </li></ul>
  34. 35. So what is this course about, really ? <ul><li>A bit of everything ! </li></ul><ul><li>Languages: SQL, XPath, XQuery </li></ul><ul><li>Data modeling </li></ul><ul><li>Theory ! (Functional dependencies, normal forms) </li></ul><ul><li>Algorithms and data structures (in the second half) </li></ul><ul><li>Lots of implementation and hacking for the project </li></ul><ul><li>Most importantly: how to meet Real World needs </li></ul>

×