SQL Interview Questions and Answers
SQL Interview Questions and Answers
Home Data Warehouse Informatica Informatica Scenarios Informatica Cloud Oracle Unix Hadoop
Search... Search
SQL Interview Questions and Answers
1. What is Normalization?
Popular Posts
First Normal Form: Duplicate columns from the same table needs to be eliminated. Design/Implement/Create SCD Type 2 Effective Date
Mapping in Informatica
We have to create separate tables for each group of related data and identify each
row with a unique column or set of columns (Primary Key) Date Functions in Hive
Second Normal Form: First it should meet the requirement of first normal form.
Removes the subsets of data that apply to multiple rows of a table and place them in SQL Queries Interview Questions - Oracle Part 1
separate tables. Relationships must be created between the new tables and their
predecessors through the use of foreign keys. Top Unix Interview Questions - Part 1
Third Normal Form: First it should meet the requirements of second normal form. Update Strategy Transformation in Informatica
Remove columns that are not depending upon the primary key.
Fourth Normal Form: There should not be any multi-valued dependencies.
Have Questions? Follow Me
Most databases will be in Third Normal Form
3. What is De-normalization?
vijay bhaskar
4. What is a Transaction? Add to circles
A transaction is a logical unit of work performed against a database in which all steps must be
performed or none.
MOLAP: The data is stored in multi-dimensional cube. The storage is not in the
relational database, but in proprietary formats.
ROLAP: ROLAP relies on manipulating the data stored in the RDBMS for slicing and
dicing functionality.
HOLAP: HOLAP combines the advantages of both MOLAP and ROLAP. For
summary type information, HOLAP leverages on cube technology for faster
performance. For detail information, HOLAP can drill through the cube.
One to one relationship is a simple reference between two tables. Consider Customer and
Address tables as an example. A customer can have only one address and an address
references only one customer.
One-to-many relationships can be implemented by splitting the data into two tables with a
https://www.folkstalk.com/2012/01/sql-interview-questions-basics-part-1.html 2/5
11/29/2018 SQL Interview Questions and Answers
primary key and foreign key relationship. Here the row in one table is referenced by one or more
rows in the other table. An example is the Employees and Departments table, where the row in
the Departments table is referenced by one or more rows in the Employees table.
Many-to-Many relationship is created between two tables by creating a junction table with the
key from both the tables forming the composite primary key of the junction table.
An example is Students, Subjects and Stud_Sub_junc tables. A student can opt for one or more
subjects in a year. Similarly a subject can be opted by one or more students. So a junction table
is created to implement the many-to-many relationship.
SELECT Columns | *
FROM Table_Name
[WHERE Search_Condition]
[GROUP BY Group_By_Expression]
[HAVING Search_Condition]
[ORDER BY Order_By_Expression [ASC|DESC]]
Both truncate and delete are used to delete data from a table. The following are the differences
between the truncate and delete statements.
Truncate is a DDL statement. Delete is a DML statement
Truncate does not generate rollback segments. Whereas Delete does.
In case of delete, rollback recovers data before issuing a commit. In case of truncate,
you cannot recover data.
Truncate does not fire any delete triggers created on the table. Whereas the delete
does.
https://www.folkstalk.com/2012/01/sql-interview-questions-basics-part-1.html 3/5
11/29/2018 SQL Interview Questions and Answers
12. What are the differences between Having and Where clause?
The Where clause filters rows before grouping. Having clause filters rows after
grouping.
You cannot use aggregate functions in Where clause. In Having clause, you can use
aggregate functions.
14. What are the differences between UNION and UNION ALL.
Union and union all are used to merge rows from two or more tables.
Union set operator removes duplicate records. Whereas union all does not.
Union operator sorts the data in ascending order. union all does not.
Union all is faster than union operator.
https://www.folkstalk.com/2012/01/sql-interview-questions-basics-part-1.html 4/5
11/29/2018 SQL Interview Questions and Answers
No comments:
Post a Comment
Publish Preview
https://www.folkstalk.com/2012/01/sql-interview-questions-basics-part-1.html 5/5