Introduction to Database Systems Introduction to Database
Total Page:16
File Type:pdf, Size:1020Kb
Introduction to Database Introduction to Database Systems Systems Slides adapted from Loreto Bravo Slides adapted from Loreto Bravo Introduction to Database Introduction to Database Systems Systems Slides adapted from Loreto Bravo Slides adapted from Loreto Bravo What is a database? What is a database? ! A database is an organized collection of data for ! A database is an organized collection of data for one or more multiple uses. one or more multiple uses. ! Databases organizes the data in a database ! Databases organizes the data in a database according to a data model. according to a data model. " A data model is a collection of conceptual tools for describing " A data model is a collection of conceptual tools for describing data, data relationships, data semantics and data constraints. data, data relationships, data semantics and data constraints. " Components: " Components: ! structural part ! structural part ! manipulative part ! manipulative part ! integrity rules ! integrity rules What is a database? What is a database? ! A database is an organized collection of data for ! A database is an organized collection of data for one or more multiple uses. one or more multiple uses. ! Databases organizes the data in a database ! Databases organizes the data in a database according to a data model. according to a data model. " A data model is a collection of conceptual tools for describing " A data model is a collection of conceptual tools for describing data, data relationships, data semantics and data constraints. data, data relationships, data semantics and data constraints. " Components: " Components: ! structural part ! structural part ! manipulative part ! manipulative part ! integrity rules ! integrity rules Data Models Data Models ! Types of Data Models: ! Types of Data Models: " Describe data at the conceptual and external levels " Describe data at the conceptual and external levels ! Object-based Data Models ! Object-based Data Models " Entity-relationship model, Object-oriented model, Semantic data model, " Entity-relationship model, Object-oriented model, Semantic data model, Functional data model Functional data model ! Record-based Data Models ! Record-based Data Models " relational, network, and hierarchical data model, etc. " relational, network, and hierarchical data model, etc. " Describe data at the internal level " Describe data at the internal level ! Unifying model or Frame memory. ! Unifying model or Frame memory. Data Models Data Models ! Types of Data Models: ! Types of Data Models: " Describe data at the conceptual and external levels " Describe data at the conceptual and external levels ! Object-based Data Models ! Object-based Data Models " Entity-relationship model, Object-oriented model, Semantic data model, " Entity-relationship model, Object-oriented model, Semantic data model, Functional data model Functional data model ! Record-based Data Models ! Record-based Data Models " relational, network, and hierarchical data model, etc. " relational, network, and hierarchical data model, etc. " Describe data at the internal level " Describe data at the internal level ! Unifying model or Frame memory. ! Unifying model or Frame memory. Historical Perspective -- Before 1960 Historical Perspective -- Before 1960 ! File systems ! File systems " Problems: " Problems: ! data redundancy ! data redundancy ! data is separated: they cannot be easily combined ! data is separated: they cannot be easily combined ! high cost of propagation of updates ! high cost of propagation of updates ! update anomalies and inconsistencies ! update anomalies and inconsistencies ! no abstract data model ! no abstract data model ! requires knowledge of storage details ! requires knowledge of storage details ! no standard query language ! no standard query language ! need to enforce security policies in which different users have ! need to enforce security policies in which different users have permission to access different subsets of the data permission to access different subsets of the data Historical Perspective -- Before 1960 Historical Perspective -- Before 1960 ! File systems ! File systems " Problems: " Problems: ! data redundancy ! data redundancy ! data is separated: they cannot be easily combined ! data is separated: they cannot be easily combined ! high cost of propagation of updates ! high cost of propagation of updates ! update anomalies and inconsistencies ! update anomalies and inconsistencies ! no abstract data model ! no abstract data model ! requires knowledge of storage details ! requires knowledge of storage details ! no standard query language ! no standard query language ! need to enforce security policies in which different users have ! need to enforce security policies in which different users have permission to access different subsets of the data permission to access different subsets of the data File Systems File Systems Cliente processing Client Files Cliente processing Client Files User User Loans processing Loan Files Loans processing Loan Files User User For each loan the information of the client is stored: Redundancy For each loan the information of the client is stored: Redundancy File Systems File Systems Cliente processing Client Files Cliente processing Client Files User User Loans processing Loan Files Loans processing Loan Files User User For each loan the information of the client is stored: Redundancy For each loan the information of the client is stored: Redundancy File Systems File Systems ! Enroll “Mary Johnson” in “CSE444”: ! Enroll “Mary Johnson” in “CSE444”: Write a C program to do the following: Write a C program to do the following: Read ‘students.txt’ Read ‘students.txt’ Read ‘courses.txt’ Read ‘courses.txt’ Find&update the record “Mary Johnson” Find&update the record “Mary Johnson” Find&update the record “CSE444” Find&update the record “CSE444” Write “students.txt” Write “students.txt” Write “courses.txt” Write “courses.txt” File Systems File Systems ! Enroll “Mary Johnson” in “CSE444”: ! Enroll “Mary Johnson” in “CSE444”: Write a C program to do the following: Write a C program to do the following: Read ‘students.txt’ Read ‘students.txt’ Read ‘courses.txt’ Read ‘courses.txt’ Find&update the record “Mary Johnson” Find&update the record “Mary Johnson” Find&update the record “CSE444” Find&update the record “CSE444” Write “students.txt” Write “students.txt” Write “courses.txt” Write “courses.txt” File Systems File Systems ! System crashes: ! System crashes: Read ‘students.txt’ Read ‘students.txt’ Read ‘courses.txt’ CRASH ! Read ‘courses.txt’ CRASH ! Find&update the record “Mary Johnson” Find&update the record “Mary Johnson” Find&update the record “CSE444” Find&update the record “CSE444” Write “students.txt” Write “students.txt” Write “courses.txt” Write “courses.txt” " What is the problem ? " What is the problem ? ! Large data sets (say 50GB) ! Large data sets (say 50GB) " What is the problem ? " What is the problem ? ! Simultaneous access by many users ! Simultaneous access by many users " Need locks " Need locks File Systems File Systems ! System crashes: ! System crashes: Read ‘students.txt’ Read ‘students.txt’ Read ‘courses.txt’ CRASH ! Read ‘courses.txt’ CRASH ! Find&update the record “Mary Johnson” Find&update the record “Mary Johnson” Find&update the record “CSE444” Find&update the record “CSE444” Write “students.txt” Write “students.txt” Write “courses.txt” Write “courses.txt” " What is the problem ? " What is the problem ? ! Large data sets (say 50GB) ! Large data sets (say 50GB) " What is the problem ? " What is the problem ? ! Simultaneous access by many users ! Simultaneous access by many users " Need locks " Need locks 1960 1960 ! Hierarchical Databases ! Hierarchical Databases " Developed by North American Rockwell and IBM as the IMS " Developed by North American Rockwell and IBM as the IMS (Information Management System) (Information Management System) ! IMS formed the basis for hierarchical data model ! IMS formed the basis for hierarchical data model ! Still Available!! http://www-01.ibm.com/software/data/ims/ ! Still Available!! http://www-01.ibm.com/software/data/ims/ " American Airlines and IBM jointly developed SABRE for making " American Airlines and IBM jointly developed SABRE for making airline reservations airline reservations ! SABRE is used today to populate Web-based travel services such as ! SABRE is used today to populate Web-based travel services such as Travelocity Travelocity " Based on a tree structure " Based on a tree structure " Problems: " Problems: ! Changes in data structure require changes in application programs that access ! Changes in data structure require changes in application programs that access that structure that structure ! No Many-to-Many relationships ! No Many-to-Many relationships ! Programmers must be thoroughly familiar with the database structure. ! Programmers must be thoroughly familiar with the database structure. 1960 1960 ! Hierarchical Databases ! Hierarchical Databases " Developed by North American Rockwell and IBM as the IMS " Developed by North American Rockwell and IBM as the IMS (Information Management System) (Information Management System) ! IMS formed the basis for hierarchical data model ! IMS formed the basis for hierarchical data model ! Still Available!! http://www-01.ibm.com/software/data/ims/ ! Still Available!! http://www-01.ibm.com/software/data/ims/ " American Airlines and IBM jointly developed SABRE for making " American Airlines and IBM jointly developed SABRE for making airline reservations airline