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

how view used for security purposes?

In a PL/SQL block,which loop type should be used in a performance point of view & Why (as both loops can do the same task) 1) open - Fetch loop 2) for loop

How to fetch the rows by dynamicaly passing table name through cursor?

What are the two parts of a procedure ?

What are the Diff B/W Cursor and REF Cursor

SELECT flavor, SUM (ice_cream_sales) FROM sales_detail GROUP BY flavor ORDER BY 2 DESC If the "sales_detail" table contains ten records with different values in the flavor column (two "vanilla," three "chocolate," four "strawberry," and one NULL), how many rows are returned by the sample code above? 1. 0 rows 2. 1 row 3. 3 rows 4. 4 rows 5. 10 rows

TABLE A TABLE B EMPNO ENAME EMPNO ENAME 1 A 1 A 2 B 2 B 3 C 3 C 4 D 4 D 5 E 5 E 6 F 7 G HOW TO GET THE UNMATCHED RECORDS IN SQL QUERY?

What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?

Table Order_Name has a column Order_Date which gives the date & Time at which the order is passed.Find the table to write a query to find out the latest order.

Can we have exception part in trigger ?

What is the fastest way of accessing a row in a table?

Which clause of an UPDATE statement allows you to affect only certain rows of a table? 1. The WHERE clause 2. The SET clause 3. The ROWS AFFECTED clause 4. The ORDER BY clause

Categories