DBMS Interview Questions

Oct 13, 2022
100 views
21 questions

About Dbms

DBMS aka Database Management System also called a Database + Management System. The database is a group of data and Management System is a set of programs to handle the database. In short, it is defined as a technology solution to store and retrieve the data from databases. The components of DBMS like Software, Database engine, Query processor, Processors, etc. helps to facilitate the functionalities, for instance, adding, deleting, updating, retrieving the data. The DBMS also offers some amazing benefits such as Data integration, data security, data sharing, uniform management and many more.

Key Features of DBMS

  Data Availability
  Minimized Redundancy
  Data Accuracy
  Improved Data Security
  Data Retrieval
  Multi-user Access
  Minimum Duplication

DBMS Interview Questions for freshers

Difference between primary key and unique key

A primary key is a table that represents each row in the table. The primary key will not allow any duplicate value or Null value. The entered value cannot be changed in a primary key.

A unique key is also a table like a primary key, but the unique key will accept one duplicate value or Null value.

Difference between primary key and unique key

A primary key is a table that represents each row in the table. The primary key will not allow any duplicate value or Null value. The entered value cannot be changed in a primary key.

A unique key is also a table like a primary key, but the unique key will accept one duplicate value or Null value.

Normalization in DBMS is the term used for organizing data in the database without accepting any deletion, update or insertion. 1nf, 2nf, and 3nf are some of the examples of normalization used to organize the data in different techniques.

There are four types of database languages available in DBMS. These are as follows:

  • Data Definition Language 
  • Data Manipulation Language 
  • Data Control Language 
  • Transaction Control Language

 

Database systems are composed of complex data structures and in order to be the database with user interaction, a technique was developed to hide any internal irrelevant details from Developers or users. This process of hiding from the user is known as data abstraction. There are three basic levels of this process i.e. physical, logical and view. The main purpose of this system is to provide an abstract view to the users.

Relational Algebra is a query language used to get input as relation and yield output of regard in a modified form. An operator can raise the query, and the most likely operator will be unary or binary. The relational queries are performed when there is a higher level of language used to handle the questions.

In atomicity, when an ongoing transaction is incomplete, the user does not need to worry about the incompletion. DBMS ensures to complete the action. Either the operation will be completed, or the entire system will be stopped and restarted.

When a relation to be expressed within the relationships, a system is followed to execute this process. The process is termed as aggregation.

In DBMS, functional dependency is a relationship that exists between two attributes. It is basically a constraint that specifies the relationship between two sets of attributes where the one set can accurately determine the value of other sets and can be denoted as X → Y.

Entity-Relationship modeling represents a graphical approach for database design by utilizing the entity-relationship, it depicts real-world projects. In ER modeling, the entities are modeled along with their attributes and overall relationship among entities. Also, describe the interrelated interest in any specific domain of knowledge. The basic ER model is comprised of several and its types and specifies the relationship that exists between them.

Object-oriented modeling can be defined as the construction of objects using a collection of objects that contain stored values of the instance variables found within an object. It allows for object identification and communication while supporting data abstraction, inheritance, and encapsulation.

BCNF (Boyce-Codd Normal Form) is a general form that is utilized in database normalization. It is the stronger version than the third normal form which was developed by Raymond and Edgar in 1974. It is based on the functional dependencies which take account of all the candidate keys in their precise relation and it also has the additional constants compared with the significant definition of 3NF. Its application may identify any additional redundancy which might be caused by the dependency to violate one or multiple candidate keys.

Intension and extension, in logic, correlative words that indicate the reference of a term or concept such that intension indicates the internal content of a term or concept that constitutes its formal definition, whereas extension indicates its range of applicability by naming the particular objects that it denotes.

The difference between DBMS and RDBMS can be stated as DBMS applications store data as files in either a hierarchical form or a navigational form. It uses a file system to store data, so there will be no relation between the tables. Whereas RDBMS applications store data in a tabular form such that the tables have an identifier called primary key and the data values are stored in the form of tables. It is designed to handle a large amount of data.

A transaction can be defined as a single logical unit of work that accesses and possibly modifies the contents of a database. It can be also stated as any logical calculation done in a consistent model in a database is known as a transaction.

The difference between attributes and identifiers can be stated as the attributes are properties that describe the entity's characteristics. Whereas Identifiers are attributes that name or identify entity instances.

Some of the advantages of a Database Management System are as follows:

  • Data Integrity
  • Data Security
  • Better data integration
  • Minimized Data Inconsistency
  • Faster Data Access
  • Better decision making
  • Simplicity

 

A Data Dictionary is a collection of names, definitions, and attributes about data elements that are being used or captured in a database The data in a data dictionary is the metadata about the database. These elements are then used as part of a database, research project, or information system.

A query is an operation that retrieves data from one or more tables or views. It is a request for data or information from a database table or combination of tables. Whereas a Subquery is a type of query which is written inside another query. A subquery becomes a part of a larger query.

Some of the basic DDL and DML commands are as follows:

DDL  Commands:

  • CREATE
  • DROP 
  • ALTER 
  • RENAME 
  • TRUNCATE

DML Commands:

  • SELECT 
  • INSERT 
  • UPDATE 
  • DELETE

JOIN is an important feature of DBMS, which is used to combine two tables based on a specified common field between them. It can be categorized in the following types:

  • inner join
  • left outer join
  • right outer join
  •  full outer join

 

The various phases of transaction are as follows:

  • Active State – When the instructions of the transaction are running then the transaction is in active state.
  • Partially Committed – After completion of all the read and write operation the changes are made in main memory or local buffer. 
  • Failed State – When any instruction of the transaction fails, it goes to the “failed state”.
  • Aborted State – After having any type of failure the transaction goes from “failed state” to “aborted state”.
  • Committed State – It is the state when the changes are made permanent on the Data Base and the transaction is complete.
  • Terminated State – If there isn’t any roll-back or the transaction comes from the “committed state”, then the system is consistent and ready for new transaction and the old transaction is terminated. 

Difference between candidate key and foreign key

Candidate key - This key is a candidate for primary care for any table and it can fulfill all the requirements of the primary key which cannot be referred to as null. They have unique records for the primary key as a candidate and every table has at least one of them.

Foreign key - It is used to define the relationship between two tables. Whenever there is a need to implement a relationship between the concepts of the foreign key is used.

DBMS vs RDBMS. Which is better?

DBMS RDBMS
Data is stored as a file. RDBMS stores data in the form of tables.
It is the collection of data and the set of programs for managing the databases. It is the database systems used for managing the relationships between the tables.
DBMS supports a single user only. It supports multiple users.
DBMS does not support Normalization RDBMS can be Normalized.
DBMS is basically for small organizations and used to handle a small amount of data. DBMS is designed to manage a large amount of data.
DBMS does not support a distributed database. RBMS offers support for distributed databases.
File system, XML, Windows Registry, etc. are some examples of DBMS. Some examples of RDBMS are MySQL, Oracle, SQL Server, etc.

Pros of DBMS:

  • Reduction of Redundancies: One of the astonishing features of the DBMS is that it controls the data. It avoids the undesirable duplication of the data which as a result diminish the entire mass of data storage needed. It also reduces the additional processing to trace the required data in a huge data set. Another advantage of dodging duplication is the removal of the inequality present in the excess data.
  • Accessing the Network: An RDBMS includes a server daemon, a software program which is specially designed to catch request sent over a network. It helps in the communication between the database and the database clients. There is no need to log in to the computer system to use or access the database. It not only helps the users with the convenience but also with the security layer for the database. Many developers use this network access facility to build web apps and desktop tools to cooperate with the database.
  • Security: Data is very important to an organization and may be confidential. It has to be clear that this confidential data should not be accessed by an unauthorized person. The DBA assures that proper authentications are followed, including proper procedures for access to the DBMS and extra checks before allowing access to the sensitive data. For the safety of the data and operation, different levels of security are implemented.
  • Language: RDBMS maintains the language SQL. It is because the syntax of SQL is simple. It executes phrasing and keywords in the English language which helps in making it easier to learn and interpret. An RDEMS is also known to add functions, non-SQL database-specific keywords, and features to this SQL awesomeness.
  • Reduced updating errors and increased consistency: Another main advantage of the RDBMS is that it increases consistency and updating errors. In its operation, the database offers end-user consistency. Moreover, there are several events of data errors within a database which creates consistency.
  • Better Decision making: If we have quality information, then it is obvious that we can take better decisions. This same happens in the case of DBMS that let the users take quick decisions very easily. The data transformation tools generate valuable information from underlying data and empower developers to make good choices.

Cons of DBMS:

  • Cost: Maintaining and setting up a database is not as much easier as it sounds. The expenses are relatively high and one of the disadvantages of relational databases. Moreover, to set up relational databases, special software is required and this could cost a fortune.
  • Update Information: For non-programmers, they would need to implement several products to set up this database. It might not be an easy task to update all the information and finally get the program running. As large firms need a more vigorous database, so it becomes important for them to get external help from an expert programmer to develop a relational database implementing SQL.
  • Complexity: The requirement of functionality from a good DBMS makes it an extremely complex piece. The developers, end-users, designers and database administrators must understand the functionality to have benefits of it.
  • Large size: The complexity of DBMS makes it a large piece of software. So. to fulfill the functionality, the size of DBMS gets bigger which occupies a large space of disk space and makes the program slow.
Share this post