exam
exam
ANSWER 2 - A .
ANSWER 4 – A. Truncate frees the table space while delete does not
ANSWER 5 - D. 4
--------------------------------------------------------------------------------------------------------------------------------------
DESCRIPTIVE QUESTIONS :
ANSWER 1 -
Joins is used to combine rows from two or more tables based on a related column between them .
Types of Joins :
1.INNER JOIN
2.OUTER JOIN
3.LEFT JOIN
4.RIGHT JOIN
5.SELF JOIN
INNER JOIN :
Inner join returns only those rows that have matching values in both the tables . If there is no match ,
the row is not included (excluded) from the result .
Example :
1 A 101
2 B 102
3 C 103
4 D NULL
Departments with column
DepartmentID DepartmentName
101 IT
102 HR
103 MARKETING
QUERY -
RESULT -
Name DepartmentName
A IT
B HR
C MARKETING
---------------------------------
ANSWER 2 -
Window functions: These functions perform calculations across a set of rows related to the current
row. They are different from aggregate functions (like SUM, AVG) because they return a result for
each row in the partition.
Row number: This function assigns a sequential number to each row within a partition.
------------------------------
ANSWER 3 -
Normalization: This is a database design technique that aims to organize data in a way that reduces
redundancy and improves data integrity. It involves breaking down a large table into smaller, related
tables.
First Normal Form (1NF): Each column should contain only one value and should not have repeating
groups.
Second Normal Form (2NF): Every non-key column must depend on the whole primary key.
Third Normal Form (3NF): Every non-key column must depend only on the primary key and not on
any other non-key column.
--------------------------------
ANSWER 4 -
SQL SERVER :
SQL Server is a relational database management system (RDBMS) developed by Microsoft. It is used
for storing and retrieving data in a structured format.
RDBMS :
RDBMS stands for Relational Database Management System. It is a type of database management
system that organizes data into tables with rows and columns. Relationships between tables are
defined using keys.
NESTED QUERIES :
----------------------
ANSWER 5 -
ORDER BY CLAUSE :
Order by clause