SQL 50 Questions
SQL 50 Questions
1/15
6/7/2015
2/15
6/7/2015
3/15
6/7/2015
4/15
6/7/2015
5/15
6/7/2015
http://career.guru99.com/top-50-sql-question-answers/
6/15
6/7/2015
7/15
6/7/2015
CHECK.
DEFAULT.
UNIQUE.
PRIMARY KEY.
FOREIGN KEY.
27.What is data Integrity?
Data Integrity defines the accuracy and consistency of data stored
in a database. It can also define integrity constraints to enforce
business rules on the data when it is entered into the application
or database.
28.What is Auto Increment?
Auto increment keyword allows the user to create a unique
number to be generated when a new record is inserted into the
table. AUTO INCREMENT keyword can be used in Oracle and
IDENTITY keyword can be used in SQL SERVER.
Mostly this keyword can be used whenever PRIMARY KEY is used.
29.What is the difference between Cluster and Non-Cluster
Index?
Clustered index is used for easy retrieval of data from the
database by altering the way that the records are stored.
Database sorts out rows by the column which is set to be
clustered index.
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.
http://career.guru99.com/top-50-sql-question-answers/
8/15
6/7/2015
31.What is Self-Join?
Self-join is set to be query used to compare to itself. This is used
to compare values in a column with other values in the same
column in the same table. ALIAS ES can be used for the same table
comparison.
32.What is Cross-Join?
Cross join defines as Cartesian product where number of rows in
the first table multiplied by number of rows in the second table. If
suppose, WHERE clause is used in cross join then the query will
work like an INNER JOIN.
33.What is user defined functions?
User defined functions are the functions written to use that logic
whenever required. It is not necessary to write the same logic
several times. Instead, function can be called or executed
whenever needed.
34.What are all types of user defined functions?
Three types of user defined functions are.
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.
35.What is collation?
Collation is defined as set of rules that determine how character
data can be sorted and compared. This can be used to compare A
and, other language characters and also depends on the width of
the characters.
ASCII value can be used to compare these character data.
http://career.guru99.com/top-50-sql-question-answers/
9/15
6/7/2015
10/15
6/7/2015
11/15
6/7/2015
Example -.
Aggregate max(), count Calculated with respect to numeric.
Scalar UCASE(), NOW() Calculated with respect to strings.
45.How can you create an empty table from an existing table?
Example will be -.
1 Select * into studentcopy from student where 1=2
Here, we are copying student table to another table with the same
structure with no rows copied.
46.How to fetch common records from two tables?
Common records result set can be achieved by -.
1 Select studentID from student. <strong>INTERSECT </strong> Select
http://career.guru99.com/top-50-sql-question-answers/
12/15
6/7/2015
SQL Quiz
Start
13/15
6/7/2015
Interview Questions
with Answers
Questions &
[http://career.guru99.com/top-Answers
100-core-java-
[http://career.guru99.com/top-
interview-
100-c-interview-
questions/]
questions-answers/]
Top 72 Perl
[http://career.guru99.com/top-
Interview Questions
and Answers
Top 65 PL/SQL
[http://career.guru99.com/topInterview Questions
50-perl-interview[http://career.guru99.com/top[http://career.guru99.com/topquestions-and50-perl-interview-
50-plsql-interview-
answers/]
questions-and-
questions/]
http://career.guru99.com/top-50-sql-question-answers/
14/15
6/7/2015
WHAT'S THIS?
Instamojo
My Universe
Sara-Freder Horoscope
Stayzilla.com
7 Beautiful Places to
Visit in Jaisalmer
1 comment
0 Comments
Recommend 1
Career Guru99
Share
Login
Sort by Best
http://career.guru99.com/top-50-sql-question-answers/
15/15