Github Com Aman0046 LastMinuteRevision DBMS
Github Com Aman0046 LastMinuteRevision DBMS
main Go to file
aman0046 on Sep 23
Join us for all the latest offcampus job updates, webinar, hackathons, resume review
and a lot more ❤❤
1) What is DBMS?
A DBMS is software that manages databases, providing an interface to store, retrieve, and
manipulate data efficiently and securely.
2) What is a Database?
A Database is an organized, consistent, and logical collection of data that can easily be
updated, accessed, and managed. Database mostly contains sets of tables or objects which
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
consist of records and fields.
Data Sharing:
In the normal file system, data sharing is too difficult because file sharing is a complex
task. In DBMS, all the data is centralized, so data sharing is a very easy task.
Data Concurrency:
When more than one user accesses the database simultaneously, then it is called
concurrency. In a file system, when multiple users are using the files at the same time,
then there may be a chance of anomalies in the data due to changes, and it does not
provide any method to detect anomalies. But in DBMS, we have a locking system to
detect the anomalies so we can protect the data.
Data Searching:
To search the data in a file system, we have to write a specific program and run it. In
DBMS, we have query languages by which we can write small queries to get the data we
want from the database. We can use various query languages, like MySQL, Oracle, etc.,
for a database to search and retrieve the data.
Data Integrity:
When we insert new data into the database, we require some specific constraints on the
data like integer or not null, etc. The file system does not provide any system to check
the constraints, whereas DBMS has the functionality to check the constraints on the data,
and it allows user defined data types.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
5) What is the different languages present in DBMS?
DDL(Data Definition Language): It contains commands which are required to define the
database. \ E.g., CREATE, ALTER, DROP, TRUNCATE, RENAME, etc.
DML(Data Manipulation Language): It contains commands which are required to
manipulate the data present in the database.
E.g., SELECT, UPDATE, INSERT, DELETE, etc.
DCL(Data Control Language): It contains commands which are required to deal with the
user permissions and controls of the database system.
E.g., GRANT and REVOKE.
TCL(Transaction Control Language): It contains commands which are required to deal
with the transaction of the database.
E.g., COMMIT, ROLLBACK, and SAVEPOINT.
ACID stands for Atomicity, Consistency, Isolation, and Durability in a DBMS these are those
properties that ensure a safe and secure way of sharing data among multiple users.
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 after a
transaction in a database.
Isolation: This property ensures that each transaction is occurring independently of the
others. This implies that the state of an ongoing transaction doesn’t affect the state of
another ongoing transaction.
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.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
7) Difference between the DELETE and TRUNCATE command in a
DBMS?
DELETE Command:
TRUNCATE Command:
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Separate tables should be created for each group of related data and each row
should be identified with a unique column.
2NF: It is known as the second normal form. A table to be in its second normal form
should satisfy the following conditions:
The table should be in its 1NF i.e. satisfy all the conditions of 1NF.
Every non-prime attribute of the table should be fully functionally dependent on the
primary key i.e. every non-key attribute should be dependent on the primary key in
such a way that if any key element is deleted then even the non_key element will be
saved in the database.
3NF: It is known as the third normal form. A table to be in its third normal form should
satisfy the following conditions:
The table should be in its 2NF i.e. satisfy all the conditions of 2NF.
There is no transitive functional dependency of one attribute on any attribute in the
same table.
BCNF: BCNF stands for Boyce-Codd Normal Form and is an advanced form of 3NF. It is
also referred to as 3.5NF for the same reason. A table to be in its BCNF normal form
should satisfy the following conditions:
The table should be in its 3NF i.e. satisfy all the conditions of 3NF.
For every functional dependency of any attribute A on B (A->B), A should be the
super key of the table. It simply implies that A can’t be a non-prime attribute if B is a
prime attribute.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
12) What is a lock. Explain the difference between a shared lock and
an exclusive lock?
A database lock is a mechanism to protect a shared piece of data from getting updated by
two or more database users at the same time. When a single database user or session has
acquired a lock then no other database user or session can modify that data until the lock is
released.
Shared lock: Shared lock is required for reading a data item. In the shared lock, many
transactions may hold a lock on the same data item. When more than one transaction is
allowed to read the data items then that is known as the shared lock.
Exclusive lock: When any transaction is about to perform the write operation, then the
lock on the data item is an exclusive lock. Because, if we allow more than one transaction
then that will lead to the inconsistency in the database.
Data Abstraction: Views allow users to work with a simplified representation of the data,
hiding unnecessary details and complexity.
Security: Views can be used to restrict access to certain columns or rows, providing a
level of security by only showing specific data to specific users.
Simplified Querying: Complex queries can be encapsulated within views, making it
easier for users to retrieve the desired information without writing complex SQL
statements.
Data Independence: If the underlying schema changes, views can remain the same, and
applications using the views will not be affected.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
There are four different types of JOINs in SQL:
INNER JOIN: Retrieves records that have matching values in both tables involved in the
join. This is the widely used join for queries.
LEFT OUTER JOIN: Retrieves all the records/rows from the left and the matched
records/rows from the right table.
RIGHT OUTER JOIN: Retrieves all the records/rows from the right and the matched
records/rows from the left table.
FULL OUTER JOIN: Retrieves all the records where there is a match in either the left or
right table.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
at the cost of additional writes and memory to maintain the index data structure.
Clustered index modifies the way records are stored in a database based on the indexed
column. A non-clustered index creates a separate entity within the table which references
the original table.
Clustered index is used for easy and speedy retrieval of data from the database, whereas,
fetching records from the non-clustered index is relatively slower.
In SQL, a table can have a single clustered index whereas it can have multiple non-
clustered indexes.
Join us for all the latest offcampus job updates, webinar, hackathons, resume review
and a lot more ❤❤
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com