To crack the Interviews for various Computer and IT Sector jobs in TCS, Freshers as well as experience technicals must go through the top DBMS Interview Questions given in the following section of this page. You can also download free DBMS Interview Questions and Answers PDFs through the links given below.
DBMS Interview Questions PDF – Download Here
|DBMS Interview Questions PDF||Download|
|DBMS Basics – Interview Questions and Answers||Download|
DBMS Interview Questions
Here we have provided some commonly asked DBMS interview questions along with their specific answers. Concerned aspirants seeking jobs in IT and Computer Sector must check these DBMS Viva Questions and Answers in order to prepare for the interviews effectively.
DBMS Interview Theory Questions
Q1. What are super, primary, candidate and foreign keys?
Ans: A super key is a set of attributes of a relation schema upon which all attributes of the schema are functionally dependent. No two rows can have the same value of super key attributes.
A Candidate key is minimal superkey, i.e., no proper subset of Candidate key attributes can be a superkey.
A Primary Key is one of the candidate keys. One of the candidate keys is selected as most important and becomes the primary key. There cannot be more that one primary keys in a table.
Foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table.
Must Read Latest: Interview Questions and Answers
Q2. What are the differences between DDL, DML and DCL in SQL?
Ans: Following are some details of three.
DDL stands for Data Definition Language. SQL queries like CREATE, ALTER, DROP and RENAME come under this.
DML stands for Data Manipulation Language. SQL queries like SELECT, INSERT and UPDATE come under this.
DCL stands for Data Control Language. SQL queries like GRANT and REVOKE come under this.
Q3. What is a Trigger?
Ans: A Trigger is a code that associated with insert, update or delete operations. The code is executed automatically whenever the associated query is executed on a table. Triggers can be useful to maintain integrity in database.
Q4. What is a stored procedure?
Ans: A stored procedure is like a function that contains a set of operations compiled together. It contains a set of operations that are commonly used in an application to do some common database tasks.
Q5. Explain the concept of ACID properties in DBMS?
- 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 databasebefore or after any transaction that takes place inside the database.
- Isolation: As the name itself suggests, this property states that each transaction that is occurring is in isolation with otherse. 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 statee. 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.
Also Read: Interview Preparation Tips
Q6. What is Correlated Subquery in DBMS?
Ans: 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 ‘RIYA’ IN (Select Name from DEPT where EMP.EMPID=DEPT.EMPID)
Here, inner query is not executed for each of the rows of the outer query.
Q7. Explain Entity, Entity Type, and Entity Set in DBMS?
Ans: 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. Eg: any person, book, etc.
Entity Type is a collection of the entities which have the same attributes. Eg: STUDENT table contains rows in which each row is an entity holding attributes like name, age, and id of the students; hence STUDENT is an Entity Type which holds the entities having same attributes.
Entity Set is a collection of the entities of the same type. Eg: A collection of the employees of a firm.
Q8. What are the different levels of abstraction in the DBMS?
Ans: 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.
Q9. What integrity rules exist in the DBMS?
Ans: There are 2 major integrity rules that exist in the DBMS. They are:
- 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.
Q10. What is E-R model in the DBMS?
Ans: 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.
Read Out Here: BPO Interview Questions and Answers
Q11. What are different types of joins in the SQL?
Ans: 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.
Q12. What is VDL (View Definition Language)?
Ans: It specifies user views and their mappings to the conceptual schema.
Q13. What is SDL (Storage Definition Language)?
Ans: This language is to specify the internal schema. This language may specify the mapping between two schemas.
Q14. What is SQL Deadlock?
Ans: Deadlock is a unique situation in a multi user system that causes two or more users to wait indefinitely for a locked resource.
Q15. What is difference between DELETE & TRUNCATE commands?
Ans: Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
Q16. What is Hashing technique?
Ans: This is a primary file organization technique that provides very fast access to records on certain search conditions.
Q17. What is Enterprise Resource Planning (ERP), and what kind of a database is used in an ERP application?
Ans: Enterprise Resource Planning (ERP) is an information system used in manufacturing companies and includes sales, inventory, production planning, purchasing and other business functions. An ERP system typically uses a multiuser database.
Q18. What is Database?
Ans: A database is a logically coherent collection of data and gives a systematic and organized way of storing, managing and retrieving from collection of logically related information and can be used for representing some aspect of real world.
Get Here: Interview Tips For Freshers
Q19. What is DBMS?
Ans: The acronym of DBMS is Database Management System and it is a collection of programs that enables user to create and maintain a database. It gives the facility of independent way of accessing data and should not be dependent on the application to access the information.
Q20. What is a Database system?
Ans: The database and DBMS software together is called as Database system and major difference between a file and database is that database has independent way of retrieving information while simple files do not.
Q21. What are the advantages of DBMS?
Ans: There are the various advantages of using the database by organization, some of its uses are as shown below:
- Unauthorized right of entry is constrained.
- Redundancy or data duplicacy is controlled.
- Enforcing integrity constraints.
- Providing backup and recovery facilities.
- Providing multiple user interfaces to accomplish the task.
Q22. What’s difference between DBMS and RDBMS?
Ans: Database Management Systems provides a systematic and organized way of storing, managing and retrieving from collection of logically related information and RDBMS also provides but above that it provides relationship integrity as shown below:
RDBMS (Relational Database Management Systems): DBMS + Referential Integrity
Q23. What are the disadvantages in File Processing System?
Ans: There are some disadvantages of using the file processing system in database as furnished below:
- Data redundancy and discrepancy occurred.
- Difficult to accessing data information.
- Difficult to handle the data isolation.
- Data integrity in the files.
- Simultaneous access is not possible.
- Security (Protection) Problems.
Q24. What are E-R diagrams?
Ans: E-R diagram also known as Entity-Relationship diagram that shows the relationship between various tables in the database.
Q25. What are CODD rules?
Ans: There are 12 rules which a DBMS should adhere in order to get the logo of a true RDBMS which is created by the Dr. E. F. Codd In 1969.
- Information Rule
- Guaranteed access Rule.
- Systematic treatment of null values
- Dynamic on-line catalog based on the relational model
- Comprehensive data sub-language Rule
- View updating Rule
- High-level insert, update and delete
- Physical data independence.
- Logical data independence
- Integrity independence
- Distribution independence
- Non-subversion Rule
Know Here: How To Dress For An Interview
Q26. How many types of relationship exist in database designing?
Ans: There are three major types of the relationship models:
Q27. What is normalization?
Ans: In database, there is set of rules that have been recognized to help in the design of tables that are meant to be linked through relationships. This set of rules is known as Normalization. There are some benefits of Normalizing your database include as shown below:
- Helps in avoiding repetitive entries
- To reduce the required storage space
- Use to preventing the need to restructure existing tables to accommodate new data.
- Help to Increased speed and flexibility of queries, sorts, and summaries.
Q28. What is denormalization?
Ans: Denormalization is the procedure of setting one fact in various places (its vice-versa of Normalization). Only one valid reason exists for denormalizing a relational design – to improve performance. The sacrifice to presentation is that you boost redundancy in database.
Q29. What is extension and intension?
Ans: Extension: It is the number of tuples available in a table at any instance. This is time dependent.
Intension: It is a constant value that gives the name, structure of table and the constraints settled on it.
Q30. What is a view?
Ans: A view may be idea of as a virtual table, a table that does not really exist in its own right or database but as an alternative is derived from one or more underlying base table. We can say that, there is no stored file in database that direct represents the view in its place a definition of view is stored in data dictionary.
Also Check: Why Should We Hire You-Get Best Answers
Q31. What is System R?
Ans: The System R was designed and developed at IBM San Jose Research Center over a period of 1974-79. It is a first of its kind and its function was to show that it is possible to build a Relational System that can be used in a real life environment to resolve real life problems, with performance at least comparable to that of existing system.
It has two subsystems are as indicated below:
- Research Storage
- System Relational Data System
Q32. How is the data structure of System R different from the relational structure?
Ans: There are some major differences between Relational systems in System R as provided below:
- The Domains are not supported by the user.
- The Enforcement of candidate key uniqueness is not obligatory.
- Enforcement of entity integrity is non-compulsory
- Referential integrity is not imposed.
Q33. What is transparent DBMS?
Ans: It is one, which keeps its physical structure hidden from user.
Q34. Explain the difference between attributes and identifiers.
Ans: Entities have attributes. Attributes are properties that describe the entity’s characteristics. Entity instances have identifiers. Identifiers are attributes that name, or identify, entity instances.
Q35. What is schema?
Ans: The description of a data base is called the database schema, which is specified during database design and is not expected to change frequently. A displayed schema is called schema diagram. We call each object in the schema as schema construct.
Must Know: Common Interview Mistakes
DBMS Technical Interview Questions:
Q1. Differentiate Nested Loop, Hash Join and Merge Join.
Nested loop (loop over loop)
An outer loop within an inner loop is formed consisting of fewer entries and then for individual entry, inner loop is individually processed.
- Select col1.*, col2.* from coll, col2 where coll.col1=col2.col2;
It’s processing takes place in this way:
For i in (select * from col1) loop
For j in (select * from col2 where col2=i.col1) loop
Results are displayed;
End of the loop;
End of the loop;
The Steps of nested loop are:
- Identify outer (driving) table
- Assign inner (driven) table to outer table.
- For every row of outer table, access the rows of inner table.
Nested Loops is executed from the inner to the outer as:
- Hash join
While joining large tables, the use of Hash Join is preferred.
Algorithm of Hash Join is divided into:
- Build: It is a hash table having in-memory which is present on the smaller table.
- Probe: this hash value of the hash table is applicable for each second row element.
- Sort merge join
Two independent sources of data are joined in sort merge join. They performance is better as compared to nested loop when the data volume is big enough but it is not good as hash joins generally.The full operation can be divided into parts of two:
Sort join operation:
Get first row R1 from input1
Get first row R2 from input2.
Merge join operation:
‘while’ is not present at either loop’s end.
if R1 joins with R2
next row is got R2 from the input 2
return (R1, R2)
else if R1 < style=””> next row is got from R1 from input 1
next row is got from R2 from input 2
end of the loop
Must Read: What Are Your Strength & Weakness?
Q2. How to create Table?
Ans: For creating a Table in database, we have to use ‘CREATE TABLE’ Statement.
CREATE TABLE “SomeName”
Q3. What is a Join?
Ans: An SQL Join is used to combine data from two or more tables, based on a common field between them. For example, consider the following two tables.
Student Course Table
Following is join query that shows names of students enrolled in different courseIDs.
SELECT StudentCourse.CourseID, Student.StudentName
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;
The above query would produce following result.
Know Here: Interview Preparation Tips for getting a Job
Q4. What is a view in SQL? How to create one
Ans: A view is a virtual table based on the result-set of an SQL statement. We can create using create view syntax.
CREATE VIEW view_name AS
Q5. There is a table where only one row is fully repeated. Write a Query to find the repeated row
In the above table, we can find duplicate row using below query.
SELECT name, section FROM tbl
GROUP BY name, section
HAVING COUNT(*) > 1
DBMS Interview Questions for Freshers
Database Management System is one of the essentials part of IT Section. Knowledge of DBMS Basics is essential to perform well in the interviews of any IT sector firm including TCS. But answering the DBMS Interview Questions is not an easy task.
There are various vacancies related to DBMS like the SQL Analyst, Database Administrator etc. Some of the top DBMS Interview Questions in TCS provided here will help you in preparing for these interviews in an effective manner.
There are various types of questions that may be asked in the interview like the DBMS SQL Questions or DBMS Technical Questions, RDBMS Interview questions etc.
Find Here: Latest Jobs Openings For Freshers
Along with these DBMS Viva Questions, you can also download Database Interview Questions and Answers PDF by pressing the direct links facilitated at the top of this page. It is advised to learn more and more DBMS questions and answers in order to develop your knowledge over this section.
We hope that these DBMS Interview Questions and Answers will help you to great extent in the preparation for related jobs. We will keep on updating these DBMS Interview Questions for Freshers time to time. Therefore, it is advised to bookmark this page by pressing CTRL +D and keep visiting regularly to check further updates of DBMS Interview Questions.
Something That You Should Put An Eye On