sql interviewquestions (1)
sql interviewquestions (1)
It is a unique identifier for each record in a table. It ensures that each row in the table
has a distinct and non-null value in the primary key column. Primary keys enforce data
integrity and create relationships between tables.
The DELETE command is used by professionals to remove particular rows from a table
based on a condition, allowing you to selectively delete records. TRUNCATE, on the
other hand, removes all rows from a table without specifying conditions. TRUNCATE is
faster and uses fewer system resources than DELETE but does not log individual row
deletions
A JOIN operation merges information from two or more tables by utilizing a common
column that links them together. Various types of JOINs exist, like INNER JOIN, LEFT
JOIN, RIGHT JOIN, and FULL JOIN. These JOIN variations dictate the manner in which
data from the involved tables is paired and retrieved.
5. What do you mean by a NULL value in SQL?
A NULL value in SQL represents the absence of data in a column. It is not the same as
an empty string or zero; it signifies that the data is missing or unknown. NULL values
can be used in columns with optional data or when the actual data is unavailable6.
SQL databases are characterized by their use of structured tables and strict adherence
to a predefined schema, making them ideal for managing structured data with a strong
focus on data consistency and transaction support. In contrast, NoSQL databases are
non-relational and excel in handling unstructured or semi-structured data, frequently
employed for scalable, distributed, and adaptable data storage solutions.
Indexes are a method of retrieving data from the data base in a faster way.it
help me in locating specific rows.it helps in optimizing query perfomance.
9.What is alias in sql?
An SQL view is essentially a virtual table that derives its data from the outcome of a
SELECT query. It does not store data itself, but rather stores the SQL query used to
retrieve the data from one or more tables.
• One-to-One Relationship.
• One to Many Relationships.
• Many to One Relationship.
• Self-Referencing Relationship