Question
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Table T1 |
|
|
Table T2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column A |
Column B |
|
ColumnB |
Code |
|
|
|
|
1 |
4 |
|
4 |
XYZ |
|
|
|
|
2 |
5 |
|
5 |
ABC |
|
|
|
|
3 |
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1>What
will be Output if we use inner join between T1 and T2 |
|
|
|
|
|
|
|
2>What
will be Output if we use Left outer join between T1 and T2 |
|
|
|
|
|
|
|
3>What
will be Output if we use Right outer join
between T1 and T2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Question 2 |
|
|
|
|
|
|
|
|
1.Write a
Query for below requirement |
|
|
|
|
|
|
|
Table A |
|
|
Lookup Table B |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column A |
Column B |
|
ColumnF |
Code |
|
|
|
|
1 |
1 |
F |
|
XYZ |
|
|
|
|
2 |
Null |
|
Null |
-99 |
|
|
|
|
3 |
-1 |
|
|
|
|
|
|
|
-1 |
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.Retrive
Code value by doing a lookup between Table A.Column B=Table B.ColumnF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Coditions |
|
|
|
|
|
|
|
|
If Column
A>0 then retrive code value from Table B |
|
|
|
|
|
|
|
If Column
A>0 and Column B is Null then do null value transformation |
|
|
|
|
|
|
If Column
A>0 and Column B=-1 then convert -1 to Null and do the Null value
transformation |
|
|
|
|
|
If Column
A<0 as="" blank="" code="" td="" the="" then="" update="" value="">
| |
|
|
|
|
|
|
0>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So Output should be |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column A |
Column B |
Code |
|
|
|
|
|
|
1 |
1 |
XYZ |
|
|
|
|
|
|
2 |
Null |
-99 |
|
|
|
|
|
|
3 |
-1 |
-99 |
|
|
|
|
|
|
-1 |
22 |
Null |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Question 3 |
|
|
|
|
|
|
|
|
1 . Write a query to retrive data exists
before '@' in email id.It should work dynamicaly for all the email ids. |
|
|
|
2. Remove all the specical characters and
number from the email id column dynamicaly. |
|
|
|
|
|
Examples |
|
|
|
|
|
|
|
|
Email Id |
Expected result after transformation |
|
|
|
|
|
|
|
abcd@gmail.com |
abcd |
|
|
|
|
|
|
|
abcdefgh@facebook.com |
abcdefgh |
|
|
|
|
|
|
|
abcd12@yahoo.co.in |
abcd12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you provide with answers for all the question will be good. Thanks, my id is harisundar81@gmail.com
ReplyDeleteIf you provide with answers for all the question will be good. Thanks, my id is teja.shravan21@gmail.com
ReplyDelete