1 SELECT a.field1, b.field2, c.field3, d.field4
2 FROM atable a, atable b, ctable c, dtable d
3 ?
4 ORDER BY 1

What is the minimum number of joins that must be specified
on line 3 in the sample code above to properly link the
tables? Notice that the table "atable" is aliased twice:
once as "a" and once as "b."

1. One join
2. Two joins
3. Three joins
4. Four joins
5. Five joins

Answers were Sorted based on User's Feedback

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

generally if n tables will n-1 joins
here 4 tables 3joins

 Is This Answer Correct ? 8 Yes 1 No

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

We need minimum of n-1 joins to join n tables.
here 3 tables are there.
so we need minimum of 2 joins to join the 3 tables

 Is This Answer Correct ? 3 Yes 1 No

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM
atable a, atable b, ctable c, dtable d 3 ? 4 ORDER BY 1
What is the minimum number of joins that must be specified
on line 3 in the sample code above to properly link the
tables? Notice that the table "atable" is aliased twice:
once as "a" and once as "b." 1. One join 2. Two joins 3.
Three joins 4. Four joins 5. Five joins
generally if n tables will n-1 joins
here 4 tables 3joins

 Is This Answer Correct ? 2 Yes 0 No

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

There should be Three joins in where clause. no point of that the table "atable" is aliased twice. It will treat as two separate tables....

 Is This Answer Correct ? 2 Yes 0 No

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

generally if n tables will n-1 joins
here 4 tables 3joins

 Is This Answer Correct ? 3 Yes 2 No

1 SELECT a.field1, b.field2, c.field3, d.field4 2 FROM atable a, atable b, ctable c, dtable d 3 ? ..

HERE WE HAVE TOTAL NO. OF TABLE IS 3 SO NO. OF JOIN REQUIRE
IS 2

Thanks
satya
+919916174212

 Is This Answer Correct ? 2 Yes 2 No

More SQL PLSQL Interview Questions

What is pl sql block in dbms?

Which is faster subquery or join?

what is foreign key? : Sql dba

- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?

i need department wise top 2 employees salary.which logic i will use

select 10 from dual; y its showing all the rows with 10?

What is mutating error in pl sql?

Does sql support programming?

What type of database is cloud sql?

How is a PL/SQL code compiled?

What is pl sql in dbms?

What are stuff and replace function?

Categories