Relational Database Management SystemBy Fitwi Kebede Relational Database Management System No. of credits 3 Subject Status Major Prerequisite (s) None Assessment Format Internal Examinations : 70% Coursework : 20% Attendance: 10% Total : 100% Relational Database Management System Course Objective On completion of this module learners should be able to: To understand Database Systems and structures of major types of DBMS & RDBMS and their wide scope in implementation To be familiar with various types of normalizations involved and their importance and usage in data management systems Relational Database Management System Course Synopsis This is an introduction to database systems. Main areas of study include: · DBMS & RDBMS · Familiarization with Normalization · Understanding Data Processing Information · Using database as programmer · Productivity tool · Practical assignments · Introduction to programming · Using Forms and Reports · Introduction to Data Warehousing and Data Mining Relational Database Management System Course Content Chapter 1 An Overview of Database Management Introduction What Is a Database System? What Is a Database? Why Database? Data Independence Relational Systems and Others . Relational Database Management System Chapter 2 Database System Architecture Introduction The Three Levels of the Architecture The External Level The Conceptual Level The Internal Level Mappings The Database Administrator The Database Management System Data Communications Client/Server Architecture Utilities Distributed Processing . Relational Database Management System Chapter 3 An Introduction to Relational Databases Introduction An informal Look at the Relational Model Relations and Relvars What Relations Mean Optimization The Catalog Base Relvars and Views Transactions The Suppliers-and-Parts Database . Variables Types vs. Representations Type Definition Operators Type Generators SQL Facilities Chapter 5 Types .Relational Database Management System Chapter 4 An Introduction to SQL Introduction Overview The Catalog Views Transactions Embedded SQL Dynamic SQL and SQL/CLI SQL Is Not Perfect Introduction Values vs. Relational Database Management System Chapter 6 Relations Introduction Tuples Relation Types Relation Values Relation Variables SQL Facilities Introduction Tuple Calculus Examples Calculus vs. Algebra Computational Capabilities SQL Facilities Domain Calculus Query-By-Example Chapter 7 Relational Calculus . External Predicates Correctness vs. Consistency Integrity and Views A Constraints Classification Scheme Keys Triggers(a Digression) SQL Facilities .Relational Database Management System Chapter 8 Integrity Introduction A Closer Look Predicates and Propositions Relvar Predicates and Database Predicates Checking the Constraints Internal vs. Relational Database Management System Chapter 9 Views Introduction What Are Views For? View Retrievals View Updates Snapshots(a Digression) SQL Facilities Introduction Basic Definitions Trivial and Non trivial Dependencies Closure of a Set of Dependencies Closure of a Set of attributes Irreducible Sets of Dependencies Chapter 10 Functional Dependencies . Second.2NF. and Third Normal Forms Dependency Preservation Boyce/Codd Normal Form A Note on Relation-Valued Attributes Forms Introduction Multi-Valued Dependencies and Fourth Normal Form Join Dependencies and Fifth Normal Form The Normalization Procedure Summarized A Note on Denormalization Orthogonal design(a Digression) Other Normal Forms Chapter 12 Further Normalization II: Higher Normal .3NF.BCNF Introduction Non loss Decomposition and Functional Dependencies First.Relational Database Management System Chapter 11 Further normalization I: 1NF. Relational Database Management System Chapter 13 Semantic Modelling Introduction The Overall Approach The E/R Model E/R diagrams Database Design with the E/R Model Introduction to SQL The Tennis Club Sample Installing the Software SQL in a Nutshell Chapter 14 Structured Query Language . Table Expressions.Relational Database Management System Chapter 15 Querying and Updating Data SELECT Statement: Common Elements SELECT Statements. and Subqueries SELECT Statement: The FROM Clause SELECT Statement: The WHERE Clause SELECT Statement: SELECT Clause and Aggregation Functions SELECT Statement: The GROUP BY Clause SELECT Statement: The HAVING Clause SELECT Statement: The ORDER BY Clause Combining Table Expressions Updating Tables . Relational Database Management System Chapter 16 Creating Database Objects Creating Tables Specifying Integrity Constraints Character Sets and Collating Sequences Changing and Dropping Tables Designing Tables Using Indexes Views Creating Databases Users and Data Security Creating Sequences Creating Schemas . Relational Database Management System Chapter 17 Programming with SQL Introduction to Embedded SQL Transactions and Multi-User Usage Introduction to ODBC Optimization of Statements Chapter 18 Procedural Database Object Stored Procedures Stored Functions Triggers . Relational Database Management System Chapter 19 Object Relational Concepts User-Defined Data Types. References. Functions. and Operators Inheritance. and Collections The Future of SQL Accessing database from Application Embedded SQL Cursors Dynamic SQL Introduction to JDBC and ODBC JDBC & ODBC Driver Management Connections Single Tier & Three Tier Architecture Chapter 20 Application Development . Relational Database Management System Recommended reading Introduction to SQL: Mastering the Relational Database Language. Fourth Edition/20th Anniversary Edition by Rick F. ISBN:0321189566 Database Management Systems (3rd edition) by Raghu Ramakrishnan. Johannes Gehrke ISBN: 0072465638 . van der Lans ISBN: 0321305965 Supplementary reading An Introduction to Database Systems 8th Edition by Date. the assistant normally checks that you have sufficient credit left to make the purchase . When you purchase goods from your local supermarket. It is likely that a database will be accessed When you purchase goods using credit card.An Overview of Database Management Introduction The database is now such an intergal part of our day to day life that often we are not aware we are using one. g. Each program defines and manages its own data.An Overview of Database Management Traditional Prior FileFile-Based System to the database we had File based system File-Based System is a collection of application Fileprograms that perform services for the end users (e. reports). . it is breaks down when we have to cross-reference or process crossthe information in the files. .An Overview of Database Management Works well while the number of items to be stored is small. However. An Overview of Database Management Limitation For of the File-Based Approach Fileand isolation of data Separation example. if we want to produce a list of all houses. With file system such processing is difficult . say that match the requirements of potential renters. and then search the Property-for PropertyRent file for those properties whose property type is house and whose rent is less than the renter s maximum rent. we need to create a temporary file of those renters who have house as the preferred type. a program onethat run only once and can then be discarded) that converts the Property-for-Rent file to the new Property-forformat Incompatible filed formats .An Overview of Database Management Duplication of data Data dependence (changing to an existing structure are difficult) For example. increasing the size of the PropertyPropertyforfor-Rent address field from 40 to 41 characters sound like a simple change but it requires the creation of a one-off program (that is. . designed to meet the information needs of an organisation.An Overview of Database Management Database All approach the above limitation on the file-based fileapproach can be attributed to Database Database: A shared collection of logically related data (and a description of this data). An Overview of Database Management The database is a single large repository of data. . Instead of disconnected file with redundant data. all data is integrated with a minimum amount of duplication. which is defined once and used simultaneously by many departments and users. The DLL allows users to specify the data type and structure. usually through a data definition languages (DLL). It allows users to insert. usually from the Database Manipulation Language (DML) .An Overview of Database Management A Database Management System (DBMS) is a software package designed to store and manage databases. update. It allows users to define the database. and retrieve data from the database. and constrains on the dat to be stored in the database. There are two kinds of data independence.An Overview of Database Management DATA INDEPENDENCE Techniques that allow data to be changed without affecting the applications that process it. Programs access data in a DBMS by field and are concerned with only the data fields they use. the only programs that must be changed are those that use those new fields. . The first type is data independence for data. which is accomplished in a database management system (DBMS). Thus. not the format of the complete record. deleted or changed in size). It allows the database to be structurally changed without affecting most existing programs. when the record layout is updated (fields added. Such data should be stored in a database and not "hard wired" into the code of the program. a much simpler task than recompiling numerous programs. When values change.An Overview of Database Management Data Independence for Processing The second type of data independence relates to processing and refers to miscellaneous data used in programs that might change in the future. such as discount rates. product descriptions and error messages. . only the database item is altered. Each level has its own schema .Database System Architecture are three Level Database Architecture Schema: There Description of data at some level. external. and . conceptual.Database System Architecture We will be concerned with three forms of schemas: physical. linked lists of blocks.explicitly dealt with details.g. indices.) .Database System Architecture Physical Data Level The physical schema describes details of how data is stored: files. Early applications worked at this level . b-tree. minimizing physical distances between related data and organizing the data structures within the file (blocked records. etc. on the random access disk system.. etc. It also typically describes the record layout of files and type of files (hash. flat). E. Database System Architecture Problem: Routines are hardcoded to deal with physical representation. Rapid implementation of new features very difficult. Changes to data structures are difficult to make. Application code becomes complex since it must deal with details. . the conceptual schema presents data as a set of tables. Referred to as physical data independence. Physical schema can be changed without changing application: DBMS must change mapping from conceptual to physical. . In the relational model. independence. The DBMS maps data access between the conceptual to physical schemas automatically.Database System Architecture Conceptual Data Level Hides details of the physical level. the external schema also presents data as a set of relations. Portions of stored data should not be seen by some users and begins to implement a level of security and simplifies the view for these users Examples: Students should not see faculty salaries. Faculty should not see billing or payment data. . It is tailored to the needs of a particular category of users.Database System Architecture External Data Level In the relational model. An external schema specifies a view of the data in terms of the conceptual level. GPA not stored.Database System Architecture Information that can be derived from stored data might be viewed as if it were stored. Different external schemas can be provided to different categories of users. The conceptual schema can be changed without changing application: Mapping from external to conceptual must be changed. . independence. Translation from external level to conceptual level is done automatically by DBMS at run time. It is not stored. Applications are written in terms of an external schema. The external view is computed when accessed. calculated when needed. Referred to as conceptual data independence. Database System Architecture . Database System Architecture Mapping Mapping is a process of converting on level to another level. There are two levels of mapping: From the conceptual level to the internal level From the external level to the conceptual level . If stored data is changed with structural point of view. It specifies how conceptual records and fields are represented at the internal level. . then the conceptual mapping must be changed accordingly so that the conceptual plan can remain steady.Database System Architecture Conceptual / Internal Mapping: Mapping: The conceptual/internal mapping defines the association between the abstract view and stored database. . Any number of users can share a given external view and different external views can overlap each other. In general.Database System Architecture External / Conceptual Mapping: Mapping: An external/conceptual mapping defines the correspondence between a particular external view and the conceptual view.a single field. fields and record names can be changed. For example. the differences that can exist between these two levels are similar to those that can exist between the conceptual view and the stored database. Any number of external views can exist at the same time. several conceptual fields can be combined into . fields can have different data types. Database System Architecture Who look after all your database? . They may also plan. Database Analyst. implementation. and Systems Manager. co-ordinate and implement security comeasures to safeguard the database . They are also known by the titles Database Coordinator or Database Programmer. Modeler. monitoring and improving database performance and capacity. related to the Database Analyst. Modeler. The role includes the development and design of database strategies. maintenance and repair of an organization's database. Programmer Analyst. Analyst.Database System Architecture A database administrator (DBA) is a person DBA) responsible for the design. and is closely Programmer. Manager. and planning for future expansion requirements. Database System Architecture So far we learn the benefit of database but how does it work in an organisation? . it is a more important idea in a network. the client. makes a service request from another program. . Although the client/server idea can be used by programs within a single computer.Database System Architecture Client/server describes the relationship between two computer programs in which one program. which fulfills the request. the server. Although the client/server idea can be used by programs within a single computer. it is a more important idea in a network. makes a service request from another program. the client. which fulfils the request. the server.Database System Architecture Client/server Client server: describes the relationship between two computer programs in which one program. . Database System Architecture In a network. a client program in your computer forwards your request to a server program at the bank . Computer transactions using the client/server model are very common. For example. the client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations. to check your bank account from your computer. Database System Architecture . Database System Architecture Having a client server will enable us to distribute data What is Distributed Processing? . . In other words. Distributed processing implies that processing will occur on more than one processor in order for a transaction to be completed.Database System Architecture Distributed Processing The distribution of applications and business logic across multiple processing platforms. Often the data used in a distributed processing environment is also distributed across platforms. each process performs part of an application in a sequence. processing is distributed across two or more machines and the processes are most likely not running at the same time.e. i.