430 likes | 652 Views
Lecture # 4. Database Systems. Recap…. First-generation Hierarchical and Network Second generation Relational Third generation Object Relational Object-Oriented. History of Database Systems. Logically represented by an upside down tree
E N D
Lecture # 4 Database Systems
First-generation • Hierarchical and Network • Second generation • Relational • Third generation • Object Relational • Object-Oriented History of Database Systems
Logically represented by an upside down tree • Each parent can have many children (segment linkage) • Each child has only one parent Hierarchical Database Model (HDBM)
Logically represented by an upside down tree • 1:M relationship Hierarchical Database Model
Customer Order 1 Order 2 List Item 1 List Item 2 List Item 1 List Item 2 Hierarchical Model
Advantages • Conceptual simplicity: relationship between layers is logically simple; design process is simple • Efficiency in 1:M relationships and when uses require large numbers of transactions • Dominant in 1970s , when we used mainframe system with large databases Hierarchical Database Model
Disadvantages • Complex implementation: physical data storage characteristics; database design is complicated • Difficult to manage and lack of standards • Lacks structural independence • Applications programming and use complexity (pointer based) • Implementation limitations, i.e. especially it only handle 1:M type of model Hierarchical Database Model
In today’s lecture… Network Databases Model
In many ways, the network database model was designed to solve some of the more serious problems with the hierarchical database model • Specifically, the network model solves the problem of data redundancy by representing relationships in terms of sets rather then a hierarchy • The model have its own origins in the conference on Data Systems Languages (CODASYL). The CODASYL group was originally formed to create a COBAL standard, the CODASYL group set out to do the same thing in the database arena and created the Data Base Task Group to explore and design a model to replace the hierarchical model Network Databases
History: • CODASYL (Conference on Data Systems Languages) created a group to work on standardization of databases: Database Task Group (DBTG) • Identified 3 database component: • Network schema (database organization) • Subschema (views of database per user) • Data Management language Network Database Model
A major deficiency of the hierarchical model is the fact that common many-to-many relationships such as the fact that each student can take many courses and each course can have many students is difficult to implement in a hierarchical model To overcome some of the deficiencies of the hierarchical model, the network model was created It was created to represent complex data relationships more effectively then the hierarchal model could It was also designed to improve database performance and to impose database standards The Network Database Model
Each record can have multiple parents • Composed of sets – relationships • Each set has owner record and member record • Member may have several owners • A set represents a 1:M relationship between the owner and the member Network Database Model
The network model is very similar to the hierarchical model • In fact, the hierarchical model is a subset of network model • Instead of using a single-parent tree hierarchy, the network model uses set theory to provide a tree-like hierarchy • Child tables are allowed to have more then one parent. This allowed the network model to support many-to-many relationships Network Model
CUSTOMER SALES PERSON ORDER 1 ORDER 2 LIST ITEM 1 LIST ITEM 2 LIST ITEM 1 LIST ITEM 2 Network Model Example
A network database looks like a hierarchical database in that it is a type of tree • In network database, children can have multiple parents and parents can have multiple children • Though it was a dramatic improvement, the network model was far from perfect • Most profoundly, the model was difficult to implement and maintain. Most implementations of the network model were used by computer programmer rather then real users. What was needed was a simple model which could be used by real end users to solve real problems Network Databases (Cont…)
Advantages • Conceptual simplicity • Handles more relationship types • Data access flexibility • Conformance to standards Network Database Model
Although the network database model yielded significant advantages over the hierarchical database model, it still was subjected to disadvantages: • System Complexity: Database integrity control and efficiency with which the network model manages relationships is not user friendly • Lack of Structural Independence: It remains difficult to make structural changes in the network databases, and some structural changes are impossible • Because of the network database model’s disadvantage, it was largely replace by the relational database model in 1980’s • The Network Model is for all practical purposes obsolete Disadvantage of Network Model
Relational Database Model • The need to know the physical details of database structures made good database design difficult at best • The relational model represented a major breakthrough for both users and designers • Although the relational model was considered ingenious, it was initially considered impractical because simplicity was bought at the expense of computer overhead • This problem was fixed by improved efficiency in computer systems and a drop in computer prices • Today many computers can run sophisticated relational database software such as Oracle, Ingress, DB2 and SQL Server
Database Management System (DBMS) • A Software system that enables users to define, create and maintain the database and that provides controlled access to this database
Database Management System (DBMS) • customer = Cust_ID : string;name : string;street : string;city : string;account_no : string;
Database Management System (DBMS) Attributes • Example of tabular data in the relational model customer- street customer- city account- number customer- name Cust-id Johnson Smith Johnson Jones Smith 192-83-7465 019-28-3746 192-83-7465 321-12-3123 019-28-3746 Alma North Alma Main North A-101 A-215 A-201 A-217 A-201 Palo Alto Rye Palo Alto Harrison Rye
Database Approach • Controlled access to database approach may include: • A security system • An integrity system • A concurrency system • A recovery control system • A user-accessible catalog
Order Filing System Central database Contains employee, order, inventory, pricing, and customer data Invoicing System DBMS Payroll System Database Systems
Database Approach • Data Definition Language (DDL) • Permits specification of data types, structures and data constraints. • All specifications are stored in the database • Data Manipulation Language (DML) • General enquiry facility (query language) of the data
Components of DBMS Environment • Hardware • Can range from a PC to a network of computers • Software • DBMS, operating system, network software (if necessary) and also the application programs • Data • Used by the organization and a description of this data called schema
Components of DB Environment • Procedures • Instructions and rules that should be applied to the design and use of the database and DBMS • People
Roles in the Database Environment • Data Administrator (DA) • Database Administrator (DBA) • Database Designers (Logical and Physical) • Application Programmers • End users (Naive and sophisticated)
DBMS Benefits • Minimal data redundancy • Consistency of data • Integration of data • Sharing of data • Ease of application development • Uniform security, privacy and integrity controls • Data accessibility and responsiveness • Reduced program maintenance • Data independence
Terms and Concepts • Data Independence • Physical representation and location of data and the use of that data are separated • The application doesn’t need to know how or where the database has stored the data, but just how to ask for it • Moving a database from one DBMS to another should not have a material effect on application program • Recording, adding fields, etc in the database should not affect applications