Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

What is DBMS?

Database Management System (DBMS) is a collection of programs or a software that


enables users to define, create, maintain and control access to the database".

Examples of DBMS's include MySQL, PostgreSQL, MSSQL, Oracle Database,


and Microsoft Access

Functionalities of DBMS
• Modify, delete, insert the data.

• Security

• Control multi-user access management.

• Achieved data integrity.

• Transaction management.

• Data Access control

• Data Independency

DBMS Components
• Data Dictionary

• Query Processor

• Query Optimizer

• Integrity Checker

• Transaction Manager

• Scheduler

• Recovery Manager

• Buffer Manager

• Authorization Control
Query Optimization
The optimizer attempts to generate the most optimal execution plan for a SQL statement.

The optimizer choose the plan with the lowest cost among all considered candidate plans

Data Dictionary
• Data Dictionary is a repository of information about data in a database or a data set . Every
change in database structure is automatically reflected in the data dictionary.

What is Relational Model? 


• Relational Model represents how data is stored in Relational Databases.  A relational database
stores data in the form of relations (tables). Consider a relation STUDENT with attributes
ROLL_NO, NAME, ADDRESS, PHONE and AGE.

Acid Properties
Attribute

Attributes are the properties which define the entity type

Types of Attributes

Key Attribute, Composite, Derived, Multivalued Attribute.

Key Attribute:

The attribute which uniquely identifies each entity in the entity set is called key
attribute.

Derived Attributes:

An attribute which can be derived from other attributes of the entity type is
known as derived attribute

Multivalued Attribute:

An attribute consisting more than one value for a given entity

Composite Attribute:

An attribute composed of many other attribute is called as composite attribute.

Weak Entity

An entity set which is not having any single attribute for unique identification is a
weak entity. In ER diagram Weak entity is represented by the double rectangle.
Degree of Relationship

The number of different entity sets participating in a relationship set is called as


degree of a relationship set.

Generalization

Generalization is like a bottom-up approach in which two or more entities of


lower level combine to form a higher level entity if they have some attributes in
common.

Specialization

Specialization is a top-down approach, and it is opposite to Generalization. In


specialization, one higher level entity can be broken down into two lower level
entities.

Key

Set of attribute by which each tuple of a relational table can be uniquely


identified.

• Types of Keys:

 Super Key

 Candidate Key

 Primary Key

 Alternate Key

 SUPER KEYS:
Any set of attributes that allows us to identify unique rows (tuples) in a
given relation are known as super keys. Or Superset of any candidate key is
a super key.
 Candidate Key: A super key whose proper subset is not a super key is the
candidate key. Also we can say, Minimal Super key is the candidate Key.

 Primary Key: A Candidate Key whose value can not be null is the primary
key.

 Alternate Key: Keys which are candidate key and not primary key are the
alternate keys.

Foreign Key

Set of attribute that references to primary key of the Same or some other relation

Constraints in Relational Model

While designing Relational Model, we define some conditions which must hold for
data present in database are called Constraints. These constraints are checked
before performing any operation

Domain Constraints: 

These are attribute level constraints. An attribute can only take values which lie
inside the domain range

Key Integrity Constraints: 

Every relation in the database should have atleast one set of attributes which

defines a tuple uniquely. Key should be unique for all tuples and key can’t have
NULL values.
Referential Integrity:
When one attribute of a relation can only take values from other attribute of same relation or any other
relation, it is called referential integrity

ANOMALIES

An anomaly is an irregularity, or something which deviates from the expected or


normal state. When designing databases, we identify three types of
anomalies: Insert, Update and Delete.

Insertion Anomaly:

We can’t insert a row in REFERENCING RELATION if referencing attribute’s value


is not present in referenced attribute value.

Deletion/ Updation Anomaly in Referenced Relation:

We can’t delete or update a row from REFERENCED RELATION if value of


REFRENCED ATTRIBUTE is used in value of REFERENCING ATTRIBUTE.

What are the advantages of DBMS?

o Redundancy control
o Restriction for unauthorized access
o Provides multiple user interfaces
o Provides backup and recovery
o Enforces integrity constraints
o Ensure data consistency
o Easy accessibility
o Easy data extraction and data processing due to the use of queries
o Data Definition Language (DDL) e.g., CREATE, ALTER, DROP, TRUNCATE, RENAME, etc.
All these commands are used for updating the data that?s why they are known as Data
Definition Language.
o Data Manipulation Language (DML) e.g., SELECT, UPDATE, INSERT, DELETE, etc. These
commands are used for the manipulation of already updated data that's why they are
the part of Data Manipulation Language.
o DATA Control Language (DCL) e.g., GRANT and REVOKE. These commands are used
for giving and removing the user access on the database. So, they are the part of Data
Control Language.
o Transaction Control Language (TCL) e.g., COMMIT, ROLLBACK, and SAVEPOINT. These
are the commands used for managing transactions in the database. TCL is used for
managing the changes made by DML.

What do you understand by Data Model?


The Data model is specified as a collection of conceptual tools for describing data, data
relationships, data semantics and constraints. These models are used to describe the
relationship between the entities and their attributes.

There is the number of data models:

o Hierarchical data model


o network model
o relational model
o Entity-Relationship model and so on.

What is the Relationship?


The Relationship is defined as an association among two or more entities. There are three type
of relationships in DBMS-

One-To-One: Here one record of any object can be related to one record of another object.
One-To-Many (many-to-one): Here one record of any object can be related to many records
of other object and vice versa.

Many-to-many: Here more than one records of an object can be related to n number of
records of another object.

What are the three levels of data abstraction?


Following are three levels of data abstraction:

Physical level: It is the lowest level of abstraction. It describes how data are stored.

Logical level: It is the next higher level of abstraction. It describes what data are stored in the
database and what the relationship among those data is.

View level: It is the highest level of data abstraction. It describes only part of the entire
database.

For example- User interacts with the system using the GUI and fill the required details, but the
user doesn't have any idea how the data is being used. So, the abstraction level is entirely high
in VIEW LEVEL.

Then, the next level is for PROGRAMMERS as in this level the fields and records are visible and
the programmers have the knowledge of this layer. So, the level of abstraction here is a little low
in VIEW LEVEL.

And lastly, physical level in which storage blocks are described.

What is DDL (Data Definition Language)?


Data Definition Language (DDL) is a standard for commands which defines the different
structures in a database. Most commonly DDL statements are CREATE, ALTER, and DROP. These
commands are used for updating data into the database.

What is DML (Data Manipulation Language)?


DData Manipulation Language (DML) is a language that enables the user to access or
manipulate data as organized by the appropriate data model. For example- SELECT, UPDATE,
INSERT, DELETE.
There is two type of DML:

Procedural DML or Low level DML: It requires a user to specify what data are needed and how
to get those data.

Non-Procedural DML or High level DML:It requires a user to specify what data are needed
without specifying how to get those data.

What do you mean by durability in DBMS?


Once the DBMS informs the user that a transaction has completed successfully, its effect should
persist even if the system crashes before all its changes are reflected on disk. This property is
called durability. Durability ensures that once the transaction is committed into the database, it
will be stored in the non-volatile memory and after that system failure cannot affect that data
anymore.

What is normalization?

Normalization is a process of analysing the given relation schemas according to their functional dependencies. It is
used to minimize redundancy and also used to minimize insertion, deletion and update distractions. Normalization is
considered as an essential process as it is used to avoid data redundancy, insertion anomaly, updation anomaly,
deletion anomaly.

There most commonly used normal forms are:

o First Normal Form(1NF)


o Second Normal Form(2NF)
o Third Normal Form(3NF)
o Boyce & Codd Normal Form(BCNF)

What is functional Dependency?


• The functional dependency is a relationship that exists between two attributes. Functional
dependency says if X functionally determines Y or Y functionally dependent on x , then if we can
say, if X repeats in any two tuple then Y will also be repeated in these two tuples.
What is Data Independence?
Data independence specifies that "the application is independent of the storage structure and
access strategy of data." It makes you able to modify the schema definition at one level without
altering the schema definition in the next higher level.

It makes you able to modify the schema definition in one level should not affect the schema
definition in the next higher level.

There are two types of Data Independence:

Physical Data Independence: Physical data is the data stored in the database. It is in the bit-
format. Modification in physical level should not affect the logical level.

For example: If we want to manipulate the data inside any table that should not change the
format of the table.

Logical Data Independence: Logical data in the data about the database. It basically defines
the structure. Such as tables stored in the database. Modification in logical level should not
affect the view level.

For example: If we need to modify the format of any table, that modification should not affect
the data inside it.

What is Join?
It is most commonly used way to combine information from two or more relations. A Join is
always performed on the basis of the same or related column. Most complex queries of SQL
involve JOIN command.

There are following types of join:

o Inner joins: Inner join is of 3 categories. They are:


o Theta join
o Natural join
o Equi join
o Outer joins: Outer join have three types. They are:
o Left outer join
o Right outer join
o Full outer join

What is 1NF?
1NF is the First Normal Form. It is the simplest type of normalization that you can implement
in a database. The primary objectives of 1NF are to:

o Every column must have atomic (single value)


o To Remove duplicate columns from the same table
o Create separate tables for each group of related data and identify each row with a
unique column

What is 2NF?
2NF is the Second Normal Form. A table is said to be 2NF if it follows the following conditions:

o The table is in 1NF, i.e., firstly it is necessary that the table should follow the rules of 1NF.
o Every non-prime attribute is fully functionally dependent on the primary key, i.e., every
non-key attribute should be dependent on the primary key in such a way that if any key
element is deleted, then even the non_key element will still be saved in the database.

What is 3NF?

3NF stands for Third Normal Form. A database is called in 3NF if it satisfies the following conditions:

o It is in second normal form.


o There is no transitive functional dependency.
o For example: X->Z

Explain ACID properties

ACID properties are some basic rules, which has to be satisfied by every transaction to preserve the integrity. These
properties and rules are:

ATOMICITY: Atomicity is more generally known as ?all or nothing rule.' Which implies all are considered as one unit,
and they either run to completion or not executed at all.
CONSISTENCY: This property refers to the uniformity of the data. Consistency implies that the database is consistent
before and after the transaction.

ISOLATION: This property states that the number of the transaction can be executed concurrently without leading to
the inconsistency of the database state.

DURABILITY: This property ensures that once the transaction is committed it will be stored in the non-volatile
memory and system crash can also not affect it anymore.

What is 2-Tier architecture?

The 2-Tier architecture is the same as basic client-server. In the two-tier architecture, applications on the client end
can directly communicate with the database at the server side.

Candidate key: The Candidate key is an attribute or set of an attribute which can uniquely
identify a tuple. The Primary key can be selected from these attributes.
Super key: The Super key is a set of attributes which can uniquely identify a tuple. Super key is a
superset of the candidate key.

Foreign key: The Foreign key is a primary key from one table, which has a relationship with
another table. It acts as a cross-reference between tables.

You might also like