DBMS Interview Questions@freecodecs
DBMS Interview Questions@freecodecs
@freecodecs
© Copyright by Interviewbit
Contents
18. Explain the difference between a 2-tier and 3-tier architecture in a DBMS.
RDBMS stands for Relational Database Management System and was introduced in
the 1970s to access and store data more efficiently than DBMS. RDBMS stores data in
the form of tables as compared to DBMS which stores data as files. Storing data as
rows and columns makes it easier to locate specific values in the database and makes
it more efficient as compared to DBMS.
Examples of popular RDBMS systems are MySQL, Oracle DB, etc.
Atomicity: This property reflects the concept of either executing the whole
query or executing nothing at all, which implies that if an update occurs in a
database then that update should either be reflected in the whole database or
should not be reflected at all.
Consistency: This property ensures that the data remains consistent before and
a er a transaction in a database.
Durability: This property ensures that the data is not lost in cases of a system
failure or restart and is present in the same state as it was before the system
failure or restart.
The process of collecting, extracting, transforming, and loading data from multiple
sources and storing them into one database is known as data warehousing. A data
warehouse can be considered as a central repository where data flows from
transactional systems and other relational databases and is used for data analytics. A
data warehouse comprises a wide variety of organization’s historical data that
supports the decision-making process in an organization.
Physical Level: it is the lowest level and is managed by DBMS. This level
consists of data storage descriptions and the details of this level are typically
hidden from system admins, developers, and users.
Conceptual or Logical level: it is the level on which developers and system
admins work and it determines what data is stored in the database and what is
the relationship between the data points.
External or View level: it is the level that describes only part of the database
and hides the details of the table schema and its physical storage from the users.
The result of a query is an example of View level data abstraction. A view is a
virtual table created by selecting fields from one or more tables present in the
database.
It deletes only the rows which are specified by the WHERE clause.
It can be rolled back if required.
It maintains a log to lock the row of the table before deleting it and hence it’s
slow.
TRUNCATE command: this command is needed to remove complete data from a
table in a database. It is like a DELETE command which has no WHERE clause.
It removes complete data from a table in a database.
It can be rolled back even if required.
It doesn’t maintain a log and deletes the whole table at once and hence it’s fast.
Primary Key: The primary key defines a set of attributes that are used to
uniquely identify every tuple. In the below example studentId and firstName are
candidate keys and any one of them can be chosen as a Primary Key. In the given
example studentId is chosen as the primary key for the student table.
Unique Key: The unique key is very similar to the primary key except that
primary keys don’t allow NULL values in the column but unique keys allow them.
So essentially unique keys are primary keys with NULL values.
Alternate Key: All the candidate keys which are not chosen as primary keys are
considered as alternate Keys. In the below example, firstname and lastname are
alternate keys in the database.
Foreign Key: The foreign key defines an attribute that can only take the values
present in one table common to the attribute present in another table. In the
below example courseId from the Student table is a foreign key to the Course
table, as both, the tables contain courseId as one of their attributes.
Composite Key: A composite key refers to a combination of two or more
columns that can uniquely identify each tuple in a table. In the below example
the studentId and firstname can be grouped to uniquely identify every tuple in
the table.
Css Interview Questions Laravel Interview Questions Asp Net Interview Questions