RDBMS Interview Questions And Answer
What does rdbms stand for?
The acronym stands for relational database management systems. Databases in these systems are stored in tables where values are represented in rows and columns.
While appearing for your interview, present yourself gracefully and take time to figure out and plan the answers before you speak. In case you have any doubts about a question, ask the interviewer instead of beating around the bush.
Be confident and approach the day with an optimistic outlook. You are sure to crack the interview.
All the best!
State a few components of an RDBMS
- Tables
- Queries
- Reports
- Forms
- Macros
- Modules
What are the differences between primary key and foreign key?
The value of a primary key can never be null whereas that of a foreign key can be null.
Duplicate values are not allowed for the primary key whereas a foreign key can have duplicate values.
What is cardinality?
This is the relationship between two tables. There are four types of cardinality that include one to one, one to many, many to one, and many to many.
Explain how each type of cardinality organizes data in a rdbms
- One-to-one? one row of the first table partners with another row in the second table.
- One to many ? One row of the first table partners with more than one row in the second table.
- Many to one ? more than one rows of the first table partners with one row of the second table.
- Many to many ? more than one rows of the first table partners with more than one rows of the second table.
What is the difference between logical and physical data independence?
In the case of logical data independence, the logical schema is changed without necessarily rewriting the applications program while in physical data independence, the physical schema is rewritten without changing the applications programs.
Explain what the super key, primary key, foreign key, and candidate key stand for?
- Super key – it recognizes a row in the table
- Primary key – A column in the table that recognizes each row in the same table uniquely.
- Candidate key – it does not have any repeated attributes
- Foreign key – A column in the table that can be used to create a relationship with another table.
State a few reasons why RDBMS is better than DBMS.
- A lot of data can be handled using RDBMS
- Rdbms supports client-server architecture
- Rdbms has minimum data redundancy
What is a buffer manager in RDBMS?
A software layer that is responsible for bringing pages from the physical disk to the main memory as needed.
What is an object-oriented model?
It is used to represent real scenarios as objects. While using this model, the data in tables can be reused in various missions.
What is in Constraints RDBMS?
Constraints make it possible to further restrict the domain of an attribute. For instance, a constraint can restrict a given integer attribute to values between 1 and 10. Constraints provide one method of implementing business rules in the database and support subsequent data use within the application layer.
Primary key
A primary key uniquely specifies a tuple within a table. While natural attributes (attributes used to describe the data being entered) are sometimes good primary keys, surrogate keys are often used instead.
Foreign key
A foreign key is a field in a relational table that matches the primary key column of another table. It relates the two keys. Foreign keys need not have unique values in the referencing relation. A foreign key can be used to cross-reference tables, and it effectively uses the values of attributes in the referenced relation to restricting the domain of one or more attributes in the referencing relation.
Stored procedures
A stored procedure is executable code that is associated with and generally stored in the database. Stored procedures usually collect and customize common operations, like inserting a tuple into a relation, gathering statistical information about usage patterns, or encapsulating complex business logic and calculations.