Questions

Q:

A subquery in an sql select statement.

Answer

A Subquery or Inner query or a Nested query is a query within another SQL query and embedded within the WHERE clause.


Subqueries are most frequently used with the SELECT statement. The basic syntax is as follows::


SELECT column_name [, column_name ]
FROM table1 [, table2 ]
WHERE column_name OPERATOR
(SELECT column_name [, column_name ]
FROM table1 [, table2 ]
[WHERE])



A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.


Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the operators like =, <, >, >=, <=, IN, BETWEEN, etc.


 


There are a few rules that subqueries must follow −


 


1. Subqueries must be enclosed within parentheses.


2. A subquery can have only one column in the SELECT clause, unless multiple columns are in the main query for the subquery to compare its selected columns.


3. An ORDER BY command cannot be used in a subquery, although the main query can use an ORDER BY. The GROUP BY command can be used to perform the same function as the ORDER BY in a subquery.


4. Subqueries that return more than one row can only be used with multiple value operators such as the IN operator.


5. The SELECT list cannot include any references to values that evaluate to a BLOB, ARRAY, CLOB, or NCLOB.


6. A subquery cannot be immediately enclosed in a set function.


7. The BETWEEN operator cannot be used with a subquery. However, the BETWEEN operator can be used within the subquery.

Report Error

View answer Workspace Report Error Discuss

0 2223
Q:

Can You Guess The Missing Numbers In The Given Math Puzzle?

A) B)
C) D)
 
Answer & Explanation Answer: A)

Explanation:

Let the missing numbers be x, y, a and b

x + y = 8 ---- (1)
a - b = 6 ---- (2)
x + a = 13 --- (3)
y + b = 8 ---- (4)

2x + a + y = 21 --- From (1 & 3)
a + y = 14 ----  From (2 & 4)

Substitute (2 & 4) in (1 & 3)

2x + 14 = 21
2x = 7
x = 3.5

From (1) ---> 3.5 + y = 8
=> y = 8 - 3.5 = 4.5

a + y = 14 => a = 14 - y = 14 - 4.5 => a = 9.5
From (4) ---- y + b = 8 => b = 8 - y = 8 - 4.5 = 3.5

Hence,
x = 3.5
y = 4.5
a = 9.5
b = 3.5

Report Error

View Answer Report Error Discuss

Filed Under: Math Puzzles
Exam Prep: CAT , Bank Exams

14 2222
Q:

In a spreadsheet program, how is data organized?

A) Only rows B) Only columns
C) Both rows and columns D) None of the above
 
Answer & Explanation Answer: C) Both rows and columns

Explanation:

A spreadsheet is an interactive computer application for organization, analysis and storage of data in tabular form. This software allows users to store data in rows and columns.

 

In_a_spreadsheet_program,_how_is_data_organized1562222370.png image

Report Error

View Answer Report Error Discuss

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

2 2222
Q:

In India, country's 1st Owl Festival held in

A) Hyderabad B) Pune
C) Kolkata D) Bangalore
 
Answer & Explanation Answer: B) Pune

Explanation:

In India, country's 1st Owl Festival held in Pune, for two days i.e, on Nov 29 and Nov 30. It is a first-of-its-kind festival in the country that is being organised with the intention of creating awareness about owl as a bird and debunking numerous superstitions associated with it.

Report Error

View Answer Report Error Discuss

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

3 2222
Q:

Government is to set to introduce new Rs. 100 coin with image of former PM

A) Jawaharlal Nehru B) Indhira Gandhi
C) Atal Bihari Vajpayee D) Rajiv Gandhi
 
Answer & Explanation Answer: C) Atal Bihari Vajpayee

Explanation:

Government is to set to introduce new Rs. 100 coin with image of former Prime Minister Atal Bihari Vajpayee.

Report Error

View Answer Report Error Discuss

Filed Under: General Awareness
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO

1 2222
Q:

Which gas is a source of natural groundwater pollution?

A) Helium B) Krypton
C) Radon D) Argon
 
Answer & Explanation Answer: C) Radon

Explanation:

Radon gas is a source of natural groundwater pollution.

Report Error

View Answer Report Error Discuss

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

2 2222
Q:

Which country is now the 2nd largest consumer and importer of the LPG in the world?

A) USA B) Japan
C) China D) India
 
Answer & Explanation Answer: D) India

Explanation:

The 2nd largest consumer and importer of the LPG in the worldis India.

Report Error

View Answer Report Error Discuss

0 2221
Q:

Which of the following is not an intrusive igneous body?

A) Stock B) Dike
C) Stope D) Batholith
 
Answer & Explanation Answer: C) Stope

Explanation:

These are called intrusive igneous rocks because the magma has intruded into pre-exiting rock layers. Types of intrusive igneous rocks are granite and basalt .

A batholith is the largest of the intrusive bodies.

Report Error

View Answer Report Error Discuss

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

1 2221