DataBase
It’s an organized collection of structured data that can be stored, accessed and modified electronically
DBMS
The software which is used to manage database is called Database Management System (DBMS). * It is the software that interacts with end users, applications, and the database itself to capture and analyze the data. * DBMS provides an interface to perform various operations like database creation, storing data in it, updating data, creating a table in the database etc. * MySQL, Oracle etc. are popular commercial DBMS used in different applications.
CHARACTERISTICS OF DBMS
Stores any kind of data
Concurrent use of the database
Supports ACID properties
Back up and recovery
Data integrity
Multiple Views
Security
Represents Complex Relationship Between Data
Query Language
Cost
DATABASE USERS
Database users are those people whose jobs require access to the database. They are categorized
based up on their interaction with the database.
Casual Users / Temporary Users :Casual Users are the users who occasionally use/access the database, but each time when they access the data base they require new information
Naive / Parametric End Users: Parametric End Users are unsophisticated who don’t have any DBMS knowledge but they frequently use the data base applications in their daily life to get the desired results.
Sophisticated Users : Sophisticated users can be engineers, scientists, business analyst, who are familiar with the database
Database Administrator (DBA): * Database Administrator is a person/team who defines the schema and also controls the 3 levels of database.
* DBA will then create a new account id and password for the user if he/she need to access the data base.
* DBA is also responsible for providing security to the data base and he allows only the authorized users to access/modify the data base.
Data Base Designers: Data Base Designers are the users who design the structure of data base which includes
tables, indexes, views, constraints, triggers, stored procedures.
.Application Program :Application Program are the back end programmers who writes the code for the application
programs.
System Analyst :* System Analyst is a user who analyzes the requirements of parametric end users.
* They check whether all the requirements of end users are satisfied.
ADVANTAGES OF DBMS
Better Data Transferring:
Database management creates a place where users have an advantage of more and better managed
data. Thus making it possible for end-users to have a quick look and to respond fast to any changes
made in their environment
2.Better Data Security
As number of users increases data transferring or data sharing rate also increases thus increasing the risk of data security. DBMS provide a better platform for data privacy and security policies thus, improves Data Security.
DATA MODELS
Data models in Database Management Systems (DBMS) are conceptual tools that help summarize the description of the database. They provide a transparent picture of the data, making it easier to create an actual database. Data models show how the data is designed and implemented, from the conceptual level to the physical level.
There are 3 types of data models
Conceptual Data Model:
The conceptual data model describes the database at a very high level and is useful to understand the needs or requirements of the database. It is this model, that is used in the requirement-gathering process eg: ER model
Logical Data Model
This type of data model is used to represent only the logical part of the database and does not represent the physical structure of the database. The representational data model allows us to focus primarily, on the design part of the database.
Physical Data Model
The physical Data Model is used to practically implement Relational Data Model. Ultimately, all data in a database is stored physically on a secondary storage device such as discs and tapes. This is stored in the form of files, records, and certain other data structures. It has all the information on the format in which the files are present and the structure of the databases,
DATABASE SCHEMA
DB Schema is the overall description of the DB.It is the skeleton structure that represents the logical view of the entire database. It defines how the data is organized and how the relations among them are associated. It formulates all the constraints that are to be applied on the data
It contains a descriptive detail of the database, which can be depicted by means of schema diagrams.
DATABASE INSTANCE
The content of database at a point of time is called instance.The instances can be changed by certain
operations as like addition, deletion ,updation of data. It may be noted that any search query will not
make any kind of changes in the instances.
DATABASE LANGUAGE
a). DDL (Data Definition Language) : Deals with schemas and descriptions, of how the data
should reside in the database.
b).DML (Data Manipulation Language): Deals with data manipulation and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE, etc. It is used to store, modify, retrieve, delete and update data in a database
c).DCL (Data control Language) : used to control access to data stored in a database
* GRANT: It is used to give user access privileges to a database.
* REVOKE: It is used to take back permissions from the user.
d).TCL (Transaction Control Language) :TCL is used to run the changes made by the DML statement.
* COMMIT: It is used to save the transaction on the database.
* ROLLBACK: It is used to restore the database to original since the last Commit.
DATABASE STATES :
ONLINE OFFLINE RESTORING RECOVERING RECOVERY PENDING SUSPECT EMERGENCY
THREE SCHEMA ARCHITECTURE
The three schema architecture is also called ANSI/SPARC architecture or three-level architecture.
* This framework is used to describe the structure of a specific database system.
* The three schema architecture is also used to separate the user applications and physical database.
* The three schema architecture contains three-levels. It breaks the database system down into three different categories.
Internal Schema
Conceptual Schema
External Schema
Objectives of Three schema Architecture :
The main objective of three level architecture is to enable multiple users to access the same data
with a personalized view while storing the underlying data only once
Thus it separates the user’s view from the physical structure of the database.
This separation is desirable for the following
reasons:
Mapping between Views(Three tier schema)
There must be mapping between the three levels . DBMS is responsible for the mapping.
There are basically two types of mapping in the database architecture:
1). Conceptual/ Internal Mapping :
The Conceptual/ Internal Mapping lies between the conceptual level and the internal level. Its role
is to define the correspondence between the records and fields of the conceptual level and files and
data structures of the internal level.
2). External/ Conceptual Mapping :
The external/Conceptual Mapping lies between the external level and the Conceptual level. Its role
is to define the correspondence between a particular external and the conceptual view.
Data Independence(3 tier schema)
1). Physical data independence :
It is the capacity to change the internal schema without having to change the conceptual schema. Hence, the external schemas need not be changed as well. Changes to the internal schema may be needed because some physical files were reorganized
2).Logical data independence :
It is the capacity to change the conceptual schema without having to change external schemas or application programs. We may change the conceptual schema to expand the database by adding a record type or data item), to change constraints, or to reduce the database .
DATABASE INTERFACES
Menu-Based Interfaces for Web Clients or Browsing – Forms-Based Interfaces –. Graphical User Interface –Natural language Interfaces –Speech Input and Output –
Interfaces for DBA –
ER MODEL(ENTITY RELATIONSHIP MODEL)
b. Composite Attribute
An attribute that composed of many other attributes is known as a composite attribute. The
composite attribute is represented by an ellipse, and those ellipses are connected with an ellipse
c. Multivalued Attribute
An attribute can have more than one value. These attributes are known as a multivalued attribute.
The double oval is used to represent multivalued attribute.
d. Derived Attribute
An attribute that can be derived from other attribute is known as a derived attribute. It can be
represented by a dashed ellipse.
Weak entity
An entity that depends on another entity called a weak entity. The weak entity doesn’t
contain any key attribute of its own. The weak entity is represented by a double rectangle
Relationship
A relationship is used to describe the relation between entities. Diamond or rhombus is used to
represent the relationship.
CARDINALITY : It is expressed as the number of entities to which another entity can be
associated via a relationship set.
a. One-to-One Relationship
b. One-to-many relationship
c). Many-to-one relationship
d). Many-to-many relationship
DEGREE OF A RELATIONSHIP
The number of entity types which take part in the entity relationship is called the degree of relationships.
1).Unary relationship
It is the relationship between the instances of a single entity type. It is also called a recursive relationship.
2).Binary relationship It is the relationship between the instances of two different entity types.
3).Ternary relationship : A simultaneous relationship between the instances of three entity types with unique attributes
4).N-ary relationship
PARTICIPATION CONSTRAINTS
Participation of an entity can be either total or partial.
a).Total Participation − Each entity is involved in the relationship. Total participation is
represented by double lines.
b). Partial participation − Not all entities are involved in the relationship. Partial participation is
represented by single lines..
TYPES OF KEYS
2.Candidate key :The candidate keys refer to those attributes that identify rows uniquely in a table. In a table, we select the primary key from a candidate key.
NAMING CONVENTIONS
Relational Model(table)
Relational Model represents how data is stored in Relational Databases. A relational database stores
data in the form of relations (tables).
Degree(table)
no of attributes