Dbms Viva Questions
Dbms Viva Questions
Module-1
1) Define Database.
A prearranged collection of figures known as data is called database.
2) What is Database.
▪ record keeping system that is used to record , maintain and retrieve data.
▪ Operate and handle large amount of information.
▪ Storing, retrieving and managing data in database.
3) What is DBMS?
Database Management Systems (DBMS) are applications designed especially which
enable user interaction with other applications.
5) Why Database ?
ADVANTAGE OF DBMS:-
▪ No redundant data
▪ Data Consistency
▪ Secure
▪ Easy recovery
The software used to store, manage, query, and retrieve data stored in a relational database is
called a relational database management system (RDBMS). The RDBMS provides an interface
between users and applications and the database, as well as administrative functions for
managing data storage, access, and performance.
An object-relational database (ORD) is a database management system (DBMS) that's composed of both
a relational database (RDBMS) and an object-oriented database (OODBMS). ORD supports the basic
components of any object-oriented database model in its schemas and the query language used, such as
objects, classes and inheritance.
Users:
1. Application programmers
2. End users
3. Database administrator (DBA)
Defining external schema
Defining conceptual schema
Defining internal schema
Liaison with users
Defining security and integrity checks
Defining backup and recovery procedures
Monitoring performance and changing requirements
▪ To search data, first, it is necessary to parse each row and load it to an array at runtime.
Data redundancy is when same piece of the data is store in two or more places
Data inconsistency is a situation where there are multiple tables within a database that deal with the same data
but may receive it from different inputs.
Multiple users are allowed to access the data simultaneously(concurrently). This is for sake of
better performance and faster response.
Accessing is comparatively
Accessing database is easier
difficult
Transactions like insert, delete, view, updating, In file system, transactions are
etc are possible in database not possible
A database model is a type of data model that determines the logical structure of a database. It
fundamentally determines in which manner data can be stored, organized and manipulated. The
most popular example of a database model is the relational model, which uses a table-based
format.
Disadvantages:-
The link is permanently established and cannot be modified which makes this model rigid
Advantages
Provides flexibility that allows changes to the database structure to be easily accommodated. It facilitates
multiple views of the same database for different users.
Disadvantages
it does not easily support the distribution of one database across a number of servers
Application Programmers :
▪ computer professionals who write application programs.
▪ Rapid application development (RAD) tools are tools that enable an application
programmer to construct forms and reports without writing a program.
▪ Most major commercial database systems include a fourth generation language.
Sophisticated users :
▪ interact with the system without writing programs
▪ Instead they use database query language
▪ Submit query to query processor
▪ Online analytical processing (OLAP) tools simplify analysts’ tasks by letting them view
summaries of data in different ways.
Specialized users :
▪ users who write specialized database
▪ applications that do not fit into the traditional data-processing framework.
▪ Knowledge base and expert systems
▪ E.g Graphics data and audio data.
Storage manager:-
▪ Provides interface between the low level data stored in the database and the application
programs and queries submitted to the system.
▪ Authorization and integrity manager : which tests for the satisfaction of integrity constraints
and checks the authority of users to access data.
▪ Transaction manager : which ensures that the database remains in a consistent (correct) state
despite system failures, and that concurrent transaction executions proceed without conflicting.
▪ File manager : which manages the allocation of space on disk storage and the data structures
used to represent information stored on disk.
▪ Buffer manager :
• which is responsible for fetching data from disk storage into main memory, and deciding what
data to cache in main memory.
• The buffer manager is a critical part of the database system,
• to handle data sizes that are much larger than the size of main memory.
MODULE 2
1. What is an ER model ?
● ENTITY RELATIONAL (ER) MODEL is a high-level conceptual data model diagram.
● ER modeling helps you to analyze data requirements systematically to produce a well-designed
database.
3. What is an Entity ?
● A real-world thing either living or non-living that is easily recognizable and
nonrecognizable.
● An entity can be place, person, object, event or a concept, which stores data in the
database.
4. What is an Entity Set?
An entity set is a set of entities of the same type that share the same properties.
Examples: set of all persons, companies, holidays,Students.
5. What is an relationship?
Relationship is nothing but an association among two or more entities.
Relationship is represented by the Diamond.
6. What is an attribute?
An entity is represented by a set of attributes, that is descriptive properties possessed by
all members of an entity set.
Simple attribute − Simple attributes are atomic values, which cannot be divided further
A key attribute can uniquely identify an entity from an entity set. For example, student roll
number can uniquely identify a student from a set of students.
Key attribute is represented by oval same as other attributes however the text of key attribute is
underlined.
Composite attribute − Composite attributes are made of more than one simple attribute.
For example, a student's complete name may have first name and lastname.
Derived attribute − Derived attributes are the attributes that do not exist in the physical
database, but their values are derived from other attributes present in the database.
For example, average_salary in a department should not be saved directly in the database,
instead it can be derived
● Super Key is defined as a set of attributes within a table that can uniquely identify each
record within a table. Super Key is a superset of Candidate key.
13. Difference between weak entity set and strong Entity Set?
14. What is Generalization ?
● Generalization is a bottom-up approach in which two lower level entities combine to form a
higher level entity. In generalization, the higher level entity can also combine with other lower
level entities to make further higher level entity.
▪ It consists of the :
• Relation name
• Set of attributes/field names/column names
• Every attribute would have an associated domain.
• Relational Model: Relational model represents data in the form of relations or tables.
• Relational Schema: Schema represents structure of a relation. e.g.; Relational Schema of
STUDENT relation can be represented as:
STUDENT (STUD_NO, STUD_NAME, STUD_PHONE, STUD_STATE, STUD_COUNTRY,
STUD_AGE)
• Relational Instance: The set of values present in a relation at a particular instance of time is known
as relational instance
• Cardinality of a relation: The number of tuples in a relation determines its cardinality
• Degree of a relation: Each column in the tuple is called an attribute. The number of attributes in a
relation determines its degree.
• Domains: A domain definition specifies the kind of data represented by the attribute.
1. Select Operation:
● The select operation selects tuples that satisfy a given predicate.
● It is denoted by sigma (σ).
σ is used for selection prediction
r is used for relation
p is used as a propositional logic formula which may use connectors like: AND OR and NOT.
These relational can use as relational operators like =, ≠, ≥, <, >, ≤.
Project Operation:
● This operation shows the list of those attributes that we wish to appear in the result. Rest
of the attributes are eliminated from the table.
● It is denoted by ∏.
Union Operation:
● Suppose there are two tuples R and S. The union operation contains all the tuples that
are either in R or S or both in R & S.
● It eliminates the duplicate tuples. It is denoted by ∪.
A union operation must hold the following condition:
● R and S must have the attribute of the same number.
● Duplicate tuples are eliminated automatically.
Set Intersection:
● Suppose there are two tuples R and S. The set intersection operation contains all tuples
that are in both R & S.
● It is denoted by intersection ∩.
Set Difference:
● Suppose there are two tuples R and S. The set intersection operation contains all tuples
that are in R but not in S.
● It is denoted by intersection minus (-).
Cartesian product
● The Cartesian product is used to combine each row in one table with each row in the
other table. It is also known as a cross product.
● It is denoted by X.
Join Operation:-
To combine two or more tables based on the related attributes.
It is basically a cross product followed by some more operations like select, project etc.
Inner Join
• Natural Join
• Theta Join
• Equi Join
Outer Join
• Left Outer Join
• Right Inner Join
• Full Outer Join
Inner Join
• Inner join is a type of join in which only those tuples are selected which full fill the required
conditions.
All those tuples which do not satisfy the required conditions are excluded
Natural Join(⋈)
• Natural Join is a join which is performed if there is a common attribute between the
relations.
Theta Join
• Theta join is a join which combines the tuples from different relations according to the
given theta condition.
Equi Join
Equi Join is a type of theta join where we use only the equality operator.
Outer Join
• Difference : In Inner Join, we matched rows are returned and unmatched rows are not
returned. But, in outer join, we include those tuples which meet the given condition along
with that, we also add those tuples which do not meet the required condition.
• All the tuples from right relation are included and only those tuples from left relation are
included which have a common value in the common attribute on which the right join is
being performed.
• Also, all the remaining tuples which are not common on in both the relations.
What is SQL?
Structured Query Language (SQL) being ANSI standard language updates database
and commands for accessing.
▪ Allows to create DB
▪ Allows to manipulate DB
▪ Supported Features:
ALTER:
It helps in modification of an existing object of database. Its syntax is:
ALTER objecttype objectname parameters.
DROP:
It destroys an existing database, index, table or view. Its syntax is:
DROP objecttype objectname.
Q) What are Constrains ?
▪ Constraints enforce rules at the table level.
▪ Constraints ensures that changes made to a database do not result in a loss of data consistency.
▪ Types of Constraints :
– NOT NULL
– UNIQUE
– PRIMARY KEY
– FOREIGN KEY (Referential Integrity)
– CHECK
Q) DML Statements ?
▪ INSERT
▪ UPDATE
▪ DELETE
Define Normalization.
Organized data void of inconsistent dependency and redundancy within a database
is called normalization.
Define Denormalization.
Boosting up database performance, adding of redundant data which in turn helps
rid of complex data is called denormalization.
• Normalization is used to minimize the redundancy from a relation or set of relations. It is also
used to eliminate the undesirable characteristics like Insertion, Update and Deletion Anomalies.
• Normalization divides the larger table into the smaller table and links them using relationship.
• The normal form is used to reduce redundancy from the database table.
• Multivalued dependency occurs in the situation where there are multiple independent
multivalued attributes in a single table.
• The Trivial dependency is a set of attributes which are called a trivial if the set of
attributes are included in that attribute.