SQL Interview Questions
SQL Interview Questions
What is DBMS?
Inner join return rows when there is at least one match of rows
between the tables.
Right Join.
Right join return rows which are common between the tables
and all rows of Right hand side table. Simply, it returns all the
rows from the right hand side table even though there are no
matches in the left hand side table.
Left Join.
Left join return rows which are common between the tables
and all rows of Left hand side table. Simply, it returns all the
rows from Left hand side table even though there are no
matches in the Right hand side table.
Full Join.
Full join return rows when there are matching rows in any one
of the tables. This means, it returns all the rows from the left
hand side table and all the rows from the right hand side table.
11. What is normalization?
The normal forms can be divided into 5 forms, and they are
explained below -.
First Normal Form (1NF):.
This should remove all the duplicate columns from the table.
Creation of tables for the related data and identification of
unique columns.
This indexing does not allow the field to have duplicate values if
the column is unique indexed. Unique index can be applied
automatically when primary key is defined.
Clustered Index.
This type of index reorders the physical order of the table and
search based on the key values. Each table can have only one
clustered index.
NonClustered Index.
NOT NULL.
CHECK.
DEFAULT.
UNIQUE.
PRIMARY KEY.
FOREIGN KEY.
27. What is data Integrity?
A nonclustered index does not alter the way it was stored but
creates a complete separate object within the table. It point
back to the original table rows after searching.
30. What is Datawarehouse?
Datawarehouse is a central repository of data from multiple
sources of information. Those data are consolidated,
transformed and made available for the mining and online
processing. Warehouse data have a subset of data called Data
Marts.
31. What is Self-Join?
Scalar Functions.
Inline Table valued functions.
Multi statement valued functions.
Scalar returns unit, variant defined the return clause. Other two
types return table as a return.
TRUNCATE removes all the rows from the table, and it cannot
be rolled back. DROP command removes a table from the
database and operation cannot be rolled back.
44. What are aggregate and scalar functions?