This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Jobs Discussion and the fly likes Oracle Q in Java Interview Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Careers » Jobs Discussion
Bookmark "Oracle Q in Java Interview" Watch "Oracle Q in Java Interview" New topic
Author

Oracle Q in Java Interview

prat de
Greenhorn

Joined: Sep 15, 2003
Posts: 22
Hi everybody,
please share your opinions/answer regarding foll. oracle q:
There are two tables, customer and order tables:
Customer
CustomerID CustomerName Phone
Order
OrderID CustomerID Orders
Query:
Select Customer.CustomerID, Order.OrderID, Order.Orders, Customer.CustomerName from Customer, Order
where CustomerID >=1000;
Which part of the query will take maximum time of execution?
- prat.
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
looks like a cartesian join to me...
D. Rose
Ranch Hand

Joined: Apr 25, 2003
Posts: 215
MAximum time of the query will be spent in scanning Orders table as it will be full table scan for that table.
Changing where clause to " where customer.customerId >=1000 and order.customerId=customer.customerId" will avoid this full scan.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle Q in Java Interview
 
Similar Threads
XML insert in Oracle
Linking two tables in JDBC
Inner join in Hibernate
Problem with SYS_CONNECT_BY_PATH
time of Query Execution in Oracle ?