SQL Questions

Q:

What is the difference between UNION and UNION ALL?

Answer

UNION selects only distinct values whereas UNION ALL selects all values and not just distinct ones

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 2077
Q:

Difference between a query and a statement in SQL?

Answer

An SQL statement is a string of characters that conforms to the syntax and format specified in the international standard.


A query is a statement that returns a record-set.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 2076
Q:

The arranging of data in a logical sequence is called

A) Summarizing B) Classifying
C) Sorting D) Rearranging
 
Answer & Explanation Answer: C) Sorting

Explanation:

The process of arranging any items in a systematic manner in a logical sequence is called as Sorting. It can be of two types :

1. Ordering

Arranging items following some criterion like ascending or descending order

2. Categorizing

Grouping items with similar properties together.

Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT

2 2023
Q:

What are the difference between clustered and a non-clustered index?

Answer

- A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.


- A non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 2007
Q:

Embedded SQL is which of the following?

A) The process of making an application capable of generating specific SQL code on the fly. B) Hard-coded SQL statements in a trigger.
C) Hard-coded SQL statements in a program language such as Java. D) Hard-coded SQL statements in a procedure.
 
Answer & Explanation Answer: C) Hard-coded SQL statements in a program language such as Java.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 1996
Q:

The multi part identifier could not be bound is

Answer

One of the most common errors that you might face in join statements is 


 


Server: Msg 4104, Level 16, State 1, Line 1
The multi-part identifier could not be bound.


 


A multipart identifier is any description of a field or table that contains multiple parts - for instance MyTable.SomeRow - if it can't be bound that means there's something wrong with it - either you've got a simple typo, or a confusion between table and column. It can also be caused by using reserved words in your table or field names and not surrounding them with [].


 


The main reason for this error is that the source table cannot be found, for example if you have statement such as Table1.OrderDate, and then if you get error above, this means that Table1 cannot be found in the query. Sometimes you can see that source table exists in the query, but T-SQL cannot understand it, especially when you write join statements.

Report Error

View answer Workspace Report Error Discuss

0 1954
Q:

What is Aggregate Functions?

Answer

Aggregate functions perform a calculation on a set of values and return a single value. Aggregate functions ignore NULL values except COUNT function. HAVING clause is used, along with GROUP BY, for filtering query using aggregate values.


Following functions are aggregate functions. 


AVG, MIN CHECKSUM_AGG, SUM, COUNT, STDEV, COUNT_BIG, STDEVP, GROUPING, VAR, MAX. VARP

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 1933
Q:

What are PL/SQL cursor exceptions?

Answer

Cursor_Already_Open,  Invalid_Cursor.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 1921