CHAPTER – 1 INTRODUCTION TO DBMS AND RDBMS A Database is a collection of related information stored to provide the availability to many users for different purposes. The content of database is obtained by combining data from various sources in an organization. So that data are available to all users and redundant data can be minimized or eliminated. Database systems are designed to manage large bodies of information. The management of data involves both definition of structure for storage of information. Database Management System A database can be of any size and of varying complexity. For example a data consists of only a few hundred records, each with a simple structure. On the other hand, the card catalog of a large library may contain half a million cards stored under different categories— by primary author's last name, by subject, by book title-with each category organized in alphabetic order. A database of even greater size and complexity is maintained by the Internal Revenue Service to keep track of the tax forms filed by U.S. taxpayers. If we assume that there are 100 million taxpayers and if each taxpayer files an average of five form with approximately 200 characters of information per form, we would get a database of 10*(106)*200*5 characters (bytes) of information. If the IRS keeps the past three returns for each taxpayer in addition to the current return, we would get a database of 4*(10U) bytes (400 gigabytes). This huge amount of information must be organized and managed so that users can search for, retrieve, and update the data as needed. Creation of files, Addition of data, deletion of data, modification of data; Creation, addition and deletion of entire files. • •

The data can be retrieved collectively and selectively. Stored data can be sorted or indexed according to Users direction and desecration.





System can generate various reports. Thus report may be either standardized or generated according to user definition. Mathematical function can be performed and stored data can be manipulated with these functions to perform desired calculations. To maintain data integrity and Database use.

The DBMS process and interprets users request to retrieve information from database. These requests may be keyed directly from a terminal or coded as high level language programs to be submitted for either processing or interactive. A database represents some aspect of the real world, sometimes called the mini-world or the Universe of Discourse (UOD).Changes to the mini-world is reflected in the database. A database is a logically coherent collection of data with some inherent meaning. A random assortment of data cannot correctly be referred to as a Database. A database is designed, built, and populated with data for a Specific purpose. It has an intended group of users and some preconceived applications in which these users are interested. Schemas, Instances, and Database State In any data model it is important to distinguish between the description of the database and the database itself. The description of the database is called the database schema, which is specified during database design and is not expected to change frequently Most data models have certain conventions for displaying the schemas as diagrams A displayed schema is called a schema diagram for the database shown in the diagram displays the structure of each record type but not the actual instances of records. The data in the database at a particular moment in time is called a database state or snapshot. It is also called the current set of occurrences or instances

Relational Database Management System A relationship is a logical linkage between two entities that describes how the entities are associated with each other. Creating a relationship explicitly defines an association between entities in the data model. RDBMS is an acronym for Relational Database Management System. The data in RDBMS is stored in database objects called tables. The database tables are the primary data storage for every RDBMS and essentially they are collections of related data entries. For example a table called Users might store information about many persons, and each entry in this table will represent one unique user. Even though all user entries in the Users table are unique, they are related in the sense that they describe similar objects. Each database table consists of columns and rows. Each table column defines the type of data stored in it, and this data type is valid for all rows in this table. A table row is a collection of data having 1 entry for each column in this particular table. RDBMS store the data into group of tables, which might or might not be related by common fields (database table columns). Degree of Relationship • • •

One to One (1:1) One to Many (1:N) Many to Many (M:N)

Attributes and Entities This is second important data-modeling concept, which is to be understood. Attributes are additional characteristics or information defined for an entity. An entity's attributes do not define an entity, but they provide additional information about an entity' that may be useful elsewhere. Entities and Attributes enable to explicitly define what information is being stored in the database.

The following should be kept in mind while implementing Entities and Attributes, • • • •

Entities are modeled as tables. In a table, each instance of an entity is called a row. Attributes are modeled as columns in a table. Programmers often refer to rows and columns as records and fields.

Tables and columns are usually singular, this is relational modeling convention. Tables are almost always named after the entity they represent. Primary key and Foreign Key The primary key is special column in the table that can be used to identify any one row. The important thing is that the value in the primary key column must be unique in the table, in which it resides. The primary key may be chosen out of the existing fields in a table, or a new field can be created expressly for this purpose. The easiest way to create a primary key is to create a special column called as identity column, Column Constraints One may specify additional constraints on the column when designing your database. These constraints enable you to include basic business requirements into your data model. These are three fundamental types of column constraints used in a database design, Not Null (NN) This allows the database designer to force the user to enter a value in a particular column. The not null concept is used for columns involved in a primary key. No Duplicate (ND) This specifies that the values in a column must be unique. This concept is used in primary keys and alternate keys.

No Change (NC) This concept allows the database designer to prohibit change,' in the values in a column. This concept is used mainly for columns participating in primary keys. Normalization In 1970, E.F. Codd formalized three rules for relational database design known as normal forms. In later years, additional normal forms have been defined, but the first three are the most widely used. Normalizing a database ensures the following things, • • •

Dependence between data are identified Redundant data is minimized The data model is flexible and easier to maintain.

Codd's normal forms were derived from set-based calculus. Before normalizing an entity, it is helpful to first identify or create a primary key. In addition, columns should be decomposed before normalization.