Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I have to display ten columns values from diffrent ten
tables.
how many joins are require?

Answers were Sorted based on User's Feedback



I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / praveen mehta

There are 2 possible answers
1. No joins required

Ex:
SELECT Col1 As Col from Tab1
Union
SELECT Col2 As Col from Tab2
Union
SELECT Col1 As Col from Tab3
...

2. 9 Joins Required
Ex:
SELECT
t1.Col1,
t2.Col2,
....
FROM Tab1 t1
inner join Tab2 t2 on t1.Col1=t2.Col2
inner join Tab3 t3 on t1.Col1=t3.Col2
....

Is This Answer Correct ?    44 Yes 2 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / anil sharma

If there is no relation between tables then no joins.And if
there relation and you want to fetch related data then 9
join required if parent table has all foreign key of their
tables.

Is This Answer Correct ?    29 Yes 2 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / nitin

there are 3 answeres
1. No joins are required if do not want to display related
data
2. 9 joins are requred if all tables are related
3. no joins reuquired we can use union if condition is
like following
select cola from a
union
select colb from b
union
select colc from c
.
.
.
like wise ten statements

Is This Answer Correct ?    8 Yes 2 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / srinu

No Join is required

Is This Answer Correct ?    13 Yes 8 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / b.kumar

--MS SQL SERVER

WE CAN DISPLAY RECORDS BY USING 9 JOINS

SELECT TBL1.COLUMN1,TBL2.COLUMN2,---------,TBL10.COLUMN10

FROM TBL1 INNER JOIN TBL2 ON TBL1.ID=TBL2.ID
INNER JOIN TBL3 ON TBL1.ID=TBL3.ID
----
----
----
INNER JOIN TBL10 ON TBL1.ID=TBL10.ID
----------------------------------------
--WE CAN ALSO DISPLAY THE RECORDS WITH OUT USE JOINS

SELECT TBL1.COLUMN1,TBL2.COLUMN2,---------,TBL10.COLUMN10
FROM TBL1,TBLE2,--------,TBL10
WHERE TBL1.ID=TBL2.ID OR TBL1.ID=TBL3.ID OR
----
----
----
TBL1.ID=TBL10.ID
--WE MUST USE WHERE CLAUSE OTHER WISE WE GET Cartesian product.

--------------------------------------------------

WE CAN'T JOIN DIFFERENT TABLES OF COLUMNS BY USING UNION

BECAUSE UNION COMBINES THE TWO OR MORE RESULT SETS
(IT MEANS ROWS)

DIFFERENCE BETWEEN JOIN & UNION

-- JOIN COMBINES TWO OR MORE THE COLUMNS
-- UNION COMBINES TWO OR MORE ROWS

Is This Answer Correct ?    0 Yes 0 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / ask

Select column1, column2, ...., column10 from table1,
table2, ..., table10

Is This Answer Correct ?    2 Yes 3 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / sumesh.s.g

n-1 JOINS
that is 10-1 Join

Or using UNION or UNION all but its not a join

However we will get value from Tables

Is This Answer Correct ?    2 Yes 3 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / sathish

The 10 tables can be joined as,

select table1.columnname,table2.columnname,.....
from table1,table2,.......

It displays 10 fields from 10 different tables.

Is This Answer Correct ?    3 Yes 5 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / sanjay kumar dinda

It will be 9( no. of tables -1)...
As we can join two tables by using two tables ...

Is This Answer Correct ?    0 Yes 2 No

I have to display ten columns values from diffrent ten tables. how many joins are require?..

Answer / sachin

i Think there is formula 2n-1

where n is the number of table
so, answer will be 2*10-1=19

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More SQL Server Interview Questions

What is star, snowflake and star flake schema? : sql server analysis services, ssas

0 Answers  


what is the diffrence between Snap Shot and Transaction Replication

2 Answers   CSC,


Can a table be moved to different filegroup?

0 Answers  


What is sql server replication? : sql server replication

0 Answers  


What will happen if a column containing char type data is changed to the nchar data type?

0 Answers  


1.what is the difference between view and cursor? 2.If we do any change in view will it affect the database,similarly when we do changes in cursor will it affect the databse?with certain example?Thanks

5 Answers  


What is bcnf normalization form?

0 Answers  


I have a table Events Events containing cardno,time,id,name- -each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible

0 Answers  


What is the difference between for xml raw and for xml auto?

0 Answers  


What is a partitioned view?

0 Answers  


SQL Server Performance Tuning for Stored Procedures & reducing debugging time?

1 Answers   CarrizalSoft Technologies,


Is oracle faster than sql server?

0 Answers  


Categories