DBMS, commonly known as Database Management System, is an application system whose main purpose
revolves around the data. This is a system that allows its user to store the data, define it,
retrieve it and update the information about the data inside the database.
Database is a collection of data in some organized way to facilitate its user’s to easily
access, manage and upload the data.
2. Why DBMS recommended? Explain its major advantages.
the major advantages of DBMS are as follows:
* Controlled Redundancy: DBMS supports a mechanism to control the redundancy of data
inside the database by integrating all the data into a single database and as data is stored at only
one place, the duplicity of data does not happen.
* Data Sharing: Sharing of data among multiple users simultaneously can also be done
in DBMS as the same database will be shared among all the users and by different application
programs.
* Backup and Recovery Facility: DBMS minimizes the pain of creating the backup of
data again and again by providing a feature of ‘backup and recovery’ which automatically creates the
data backup and restores the data whenever required.
* Enforcement of Integrity Constraints: Integrity Constraints are very important to
be enforced on the data so that the refined data after putting some constraints are stored in the
database and this is followed by DBMS.
* Independence of data: It simply means that you can change the structure of the
data without affecting the structure of any of the application programs.
3. What is RDBMS?
RDBMS is a short form of Relational Database Management system. It is a software system that stores
only data that needs to be stored in related tables. In RDBMS, data is managed and stored in rows
and columns, known as tuples and attributes.
4. Differences between DBMS and RDBMS?
DBMS :-
* stores data as a file.
* It stores data in either a navigational or hierarchical form.
* DBMS supports single users only.
* Demands low software and hardware needs.
* DBMS does not support Normalization RDBMS can be Normalized.
* Does not support client-server architecture
RDBMS :-
* Data is stored in the form of tables.
* It uses a tabular structure where the headers are the column names, and the rows
contain corresponding values.
* It supports multiple users.
* Demands higher hardware and software needs.
* RDBMS can be Normalized.
* Support client-server architecture
5. What is Database Partitioning?
Division of a logical database into complete independent units for improving its management,
availability, and performance is called Database partitioning.
6. What is the normalization in DBMS?
Normalization is the process of analyzing the relational schemas which are based on their respective
functional dependencies and the primary keys in order to fulfill certain properties.
The properties include:
* To minimize the redundancy of the data.
* To minimize the Insert, Delete and Update Anomalies.
7. What is Relational Algebra in the DBMS system?
Relational Algebra is a procedural query language that collects relations as input and gives
occurrences of relations as output. It uses various operations to perform this action.
8. Define Unary operations in Relational Algebra?
In relational algebra, PROJECTION and SELECTION are unary operations. Unary operations are those
kinds of operations that use only single operands.
As in SELECTION, relational operators are used, for example – =, <=,>=, etc.
9.
What are the different types of languages that are available in the DBMS?
there are 3 types of languages in the DBMS as mentioned below:
* DDL: DDL is Data Definition Language which is used to define the database and schema
structure by using some set of SQL Queries like CREATE, ALTER, TRUNCATE, DROP and
RENAME.
* DCL: DCL is Data Control Language which is used to control the access of the users
inside the database by using some set of SQL Queries like GRANT and REVOKE.
* DML: DML is Data Manipulation Language which is used to do some manipulations in the
database like Insertion, Deletion, etc. by using some set of SQL Queries like SELECT, INSERT,
DELETE and UPDATE.
10. What is Concurrency Control?
Concurrency Control is a procedure that helps to manage simultaneous operations without
conflicting with each other. It helps you to ensure that Database transactions are executed
concurrently and accurately.
11. What is Functional Dependency?
Functional Dependencies (FD) in Database Management systems define the relationship between an
attribute and another. It allows you to maintain the quality of data in the Database.
12. What is Primary Key?
Primary keys are columns or sets of columns that uniquely identify every row in the table of an
RDMS system. This key can’t be duplicated means the same value should not appear more than once
in the table.
13. What is Foreign Key?
A foreign key is a column that creates a relationship between two tables. They are used to
maintain data integrity and facilitate navigation between two instances of the same entity.
Moreover, it serves as a cross-reference between two tables since it refers to another table’s
primary key.
14. What are the differences between Primary key and Unique Key?
The main difference between the Primary key and Unique key is that the Primary key can never
have a null value while the Unique key may consist of null value.
In each table, there can be only one primary key while there can be more than one unique key in
a table.
15. What is the concept of sub-query in terms of SQL?
Sub-query is basically the query which is included inside some other query and can also be
called as an inner query which is found inside the outer query.
16. What is the use of DROP command and what are the differences between DROP,
TRUNCATE and DELETE commands?
DROP command is a DDL command which is used to drop/delete the existing table, database, index
or view from the database.
DROP and TRUNCATE commands are the DDL commands which are used to delete tables from the
database and once the table gets deleted, all the privileges and indexes that are related to the
table also get deleted. These 2 operations cannot be rolled back and so should be used only when
necessary.
DELETE command, on the other hand, is a DML Command which is also used to delete rows from the
table and this can be rolled back.
17. What is the main difference between UNION and UNION ALL?
UNION and UNION ALL are used to join the data from 2 or more tables but UNION removes duplicate
rows and picks the rows which are distinct after combining the data from the tables whereas
UNION ALL does not remove the duplicate rows, it just picks all the data from the tables.
18. Explain the concept of ACID properties in DBMS?
ACID properties is the combination of Atomicity, Consistency, Isolation, and Durability
properties. These properties are very helpful in allowing a safe and secure way of sharing the
data among multiple users.
* Atomicity: This is based on the concept of “either all or nothing” which
basically means that if any update occurs inside the database then that update should either be
available to all the others beyond user and application program or it should not be available to
anyone beyond the user and application program.
* Consistency: This ensures that the consistency is maintained in the database
before or after any transaction that takes place inside the database.
* Isolation: As the name itself suggests, this property states that each
transaction that occurs is in isolation with others i.e. a transaction which has started but not
yet completed should be in isolation with others so that the other transaction does not get
impacted with this transaction.
* Durability: This property states that the data should always be in a durable
state i.e. any data which is in the committed state should be available in the same state even
if any failure or restart occurs in the system.
UNION and UNION ALL are used to join the data from 2 or more tables but UNION removes duplicate
rows and picks the rows which are distinct after combining the data from the tables whereas
UNION ALL does not remove the duplicate rows, it just picks all the data from the tables.
19. What is Correlated Subquery in DBMS?
A Subquery is also known as a nested query i.e. a query written inside some query. When a
Subquery is executed for each of the rows of the outer query then it is termed as a Correlated
Subquery.
Example of Non-Correlated Subquery is:
SELECT * from EMP WHERE 'SAM' IN (SELECT Name from DEPT WHERE EMP.EMPID=DEPT.EMPID);
19. What is Entity, Entity Type, and Entity Set in DBMS?
Entity is an object, place or thing which has its independent existence in the real world and
about which data can be stored in a database. For Example, any person, book, etc.
Entity Type is a collection of entities that have the same attributes. For Example, the STUDENT
table contains rows in which each row is an entity holding the attributes like name, age, and id
of the students, hence STUDENT is an Entity Type which holds the entities having the same
attributes.
Entity Set is a collection of entities of the same type. For Example, A collection of the
employees of a firm.
20. What are the different levels of abstraction in the DBMS?
There are 3 levels of data abstraction in the DBMS.
They include:
* Physical Level: This is the lowest level of the data abstraction which states
how the data is stored in the database.
* Logical Level: This is the next level of the data abstraction which states the
type of the data and the relationship among the data that is stored in the database.
* View Level: This is the highest level in the data abstraction which
shows/states only a part of the database.
21. What integrity rules exist in the DBMS?
There are 2 major integrity rules that exist in the DBMS.
* Entity Integrity: This states a very important rule that value of a Primary key
can never have a NULL value.
* Referential Integrity: This rule is related to the Foreign key which states
that either the value of a Foreign key is a NULL value or it should be the primary key of any
other relation.
22. What is E-R model in the DBMS?
E-R model is known as an Entity-Relationship model in the DBMS which is based on the concept of the Entities and the relationship that exists among these entities.
23. What is 1NF in the DBMS?
1NF is known as the First Normal Form.
This is the easiest form of the normalization process which states that the domain of an attribute should have only atomic values. The objective of this is to remove the duplicate columns that are present in the table.
24. What is 2NF in the DBMS?
2NF is the Second Normal Form.
Any table is said to have in the 2NF if it satisfies the following 2 conditions:
* A table is in the 1NF.
* Each non-prime attribute of a table is said to be functionally dependent in totality on the primary key.
25. What is 3NF in the DBMS?
3NF is the Third Normal Form.
Any table is said to have in the 3NF if it satisfies the following 2 conditions:
* A table is in the 2NF.
* Each non-prime attribute of a table is said to be non-transitively dependent on every key of the table.
26. What is BCNF in the DBMS?
BCNF is the Boyce Codd Normal Form which is stricter than the 3NF.
Any table is said to have in the BCNF if it satisfies the following 2 conditions:
* A table is in the 3NF.
* For each of the functional dependency X->Y that exists, X is the super key of a table.
27. What is a CLAUSE in terms of SQL?
This is used with the SQL queries to fetch specific data as per the requirements on the basis of the conditions that are put in the SQL. This is very helpful in picking the selective records from the complete set of the records.
For Example, There is a query which has WHERE condition or the query with the HAVING clause.
28. What is a join in the SQL?
A Join is one of the SQL statements which is used to join the data or the rows from 2 or more tables on the basis of a common field/column among them.
29. What are different types of joins in SQL?
There are 4 types of SQL Joins:
* Inner Join: This type of join is used to fetch the data among the tables which are common in both the tables.
* Left Join: This returns all the rows from the table which is on the left side of the join but only the matching rows from the table which is on the right side of the join.
* Right Join: This returns all the rows from the table which is on the right side of the join but only the matching rows from the table which is on the left side of the join.
* Full Join: This returns the rows from all the tables on which the join condition has put and the rows which do not match hold null values.
30. What is Starvation?
Starvation is a situation where all the low-priority processes get blocked. In any system, requests for high and low-priority resources keep happening dynamically. Therefore, some policy is required to decide who gets support and when.
31. What is a Schedule?
A Schedule is creating a group of multiple parallel transactions and executing them one after one. The order in which the instructions appear should be preserved in every transaction. In case two transactions are executed simultaneously, the result of one transaction may affect the output of the other.
32. What are the different type of relationships in the DBMS?
Different types of relationships are:
* One-to-One: This basically states that there should be a one-to-one relationship between the tables i.e. there should be one record in both the tables. Example: Among a married couple, both wife and husband can have only one spouse.
* One-to-Many: This states that there can be many relationships for one i.e. a primary key table hold only one record which can have many, one or none records in the related table. Example: A Mother can have many children.
* Many-to-Many: This states that both the tables can be related to many other tables. Example: One can have many siblings and so do they have.
33. Explain the Stored Procedure?
Stored Procedure is a group of SQL statements in the form of a function that has some unique name and is stored in relational database management systems(RDBMS) and can be accessed whenever required.
34. What is meant by trigger?
Trigger is one of the very important codes or programs which get executed automatically in response to the events that occur in a table or a view. For Example, If a new record is inserted in an employee database then the data gets created automatically in the related tables like salary, department and roles tables.
35. What is Relational Calculus?
Relational Calculus is a non-procedural query language. It uses mathematical predicate calculus. Therefore, its main focus is on what to do with the relations (tables) rather than how to do it.
36. What is Hashing in DBMS?
In a DBMS system, hashing is a method to directly find the location of requested data on the disk need to use an index structure. A shorter hashed critical value is used in place of the original critical value when indexing and retrieving items in the Database.
37. What is Indexing?
Indexing is a data structure method that helps you quickly retrieve records from a database file. An index is a small table with only two columns. The first column comprises a table’s primary or candidate key. The second column includes a set of pointers for holding the address of the disk block where a particular key value is stored.