DBMS GFG
DBMS GFG
DBMS GFG
9. What is Join?
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.
1 1000
2 1000
3 1000
1 1002
2 1003
CourseID StudentName
1 geek1
1 geek3
2 geek1
3 geek1
9. What is Identity?
Identity (or AutoNumber) is a column that automatically generates
numeric values. A start and increment value can be set, but most DBA
leave these at 1. A GUID column also generates numbers; the value of
this cannot be controlled. Identity/GUID columns do not need to be
indexed.
A clause in SQL is a part of a query that lets you filter or customize how
you want your data to be queried to you.
20. What is a Live Lock?
Purpose of normalization:
It is helpful to divide the large database table into smaller tables and
link them using relationships.
27.What are the main differences between Primary key and Unique
Key?
The main difference between the Primary key and the Unique key is that
the Primary key can never have a null value while the Unique key may
consist of a null value.
In each table, there can be only one primary key while there can be
more than one unique key in a table.
29. What is the use of the DROP command and what are the
differences between DROP, TRUNCATE and DELETE commands?
DROP and TRUNCATE commands are the DDL commands which are
used to delete tables from the database.
And when we make use of a DROP command, the tables get deleted
permanently all the privileges and indexes that are related to the table
also get deleted. This operation cannot be rolled back and so should be
used only when necessary.
30. What is the main difference between UNION and UNION ALL?
UNION and UNION ALL are used to join the data from 2 or more tables
but UNION removes duplicate rows and picks the rows which are
distinct after combining the data from the tables whereas UNION ALL
does not remove the duplicate rows, it just picks all the data from the
tables.
31. What is Correlated Subquery in DBMS?
Here, the inner query is not executed for each of the rows of the outer
query.
Entity Type is a collection of entities that have the same attributes. For
Example, the STUDENT table contains rows in which each row is an
entity holding the attributes like name, age, and id of the students,
hence STUDENT is an Entity Type that holds the entities having the
same attributes.
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.
There are two major integrity rules that exist in the DBMS.
Entity Integrity: This states a very important rule that the value of a
Primary key can never have a NULL value.
This is the easiest form of the normalization process which states that
the domain of an attribute should have only atomic values. The
objective of this is to remove the duplicate columns that are present in
the table.
BCNF is the Boyce Codd Normal Form which is stricter than the 3NF.
For each of the functional dependencies X->Y that exists, X is the super
key of a table.
This is used with the SQL queries to fetch specific data as per the
requirements on the basis of the conditions that are put in the SQL. This
is very helpful in picking the selective records from the complete set of
records.
For Example, There is a query that has a WHERE condition or the query
with the HAVING clause.
42.How can you get the alternate records from the table in the SQL?
If you want to fetch the odd numbers then the following query can be
used:
Example:
A Join is one of the SQL statements which is used to join the data or the
rows from 2 or more tables on the basis of a common field/column
among them.
Inner Join: This type of join is used to fetch the data among the tables
which are common in both 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 been put and the rows which do not match hold null
values.
One-to-Many: This states that there can be many relationships for one
i.e. a primary key table hold only one record which can have many, one,
or none records in the related table.
Many-to-Many: This states that both the tables can be related to many
other tables.
Logical Database
Parameters Physical Database Design
Design
Statement Failure·
Bad data type
Insufficient space
Insufficient Privileges (e.g., object privileges to a role)
User Process Failure
The user performed an abnormal disconnect
The user’s session was abnormally terminated
The user’s program raised an address exception
User Error
The user drops a table
User damages data by modification
Instance Failure
Media Failure
The user drops a table
User damages data by modification
Alert Logs
Records informational and error messages
All Instance startups and shutdowns are recorded in the log
RAID is a method of combining several hard disk drives into one logical
unit (two or more disks grouped together to appear as a single device to
the host system). RAID technology was developed to address the fault-
tolerance and performance limitations of conventional disk storage. It
can offer fault tolerance and higher throughput levels than a single hard
drive or group of independent hard drives. While arrays were once
considered complex and relatively specialized storage solutions, today
they are easy to use and essential for a broad spectrum of
client/server applications.
GeeksforGeeks 307
Similar Reads
Commonly asked DBMS Interview Questions | Set 2
This article is an extension of Commonly asked DBMS interview questions
| Set 1. Q1. There is a table where only one row is fully repeated. Write a…
5 min read
Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Geeks Community
Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL DSA Interview Questions
R Language Competitive Programming
Android Tutorial
DSA/Placements Development/Testing
DSA - Self Paced Course JavaScript Full Course
DSA in JavaScript - Self Paced Course React JS Course
DSA in Python - Self Paced React Native Course
C Programming Course Online - Learn C with Data Structures Django Web Development Course
Complete Interview Preparation Complete Bootstrap Course
Master Competitive Programming Full Stack Development - [LIVE]
Core CS Subject for Interview Preparation JAVA Backend Development - [LIVE]
Mastering System Design: LLD to HLD Complete Software Testing Course [LIVE]
Tech Interview 101 - From DSA to System Design [LIVE] Android Mastery with Kotlin [LIVE]
DSA to Development [HYBRID]
Placement Preparation Crash Course [LIVE]
Clouds/Devops GATE
DevOps Engineering GATE CS & IT Test Series - 2025
AWS Solutions Architect Certification GATE DA Test Series 2025
Salesforce Certified Administrator Course GATE CS & IT Course - 2025
GATE DA Course 2025