Tag Info

New answers tagged


Yes, there are cases where applying the filter after the join is preferable. But they are rare. Consider this example: SELECT ... FROM a INNER JOIN b ON b.key = a.key WHERE a.some_string LIKE '%foo%' Now, assume that very few rows in a has a matching row in b. It is now faster to first join and remove the rows from a that does not match and then apply ...


Journey.CustomerIDis a foreign key to Customer.CustomerID. Journey.TrainNo is a foreign key to TrainRide.TrainNo. The relationship here is many to many. A TrainRide can have many customers. A customer could ride many TrainRides. The table Journey is used to associate the two. You can see the same customer more than once in this table such as 834 or the ...

Top 50 recent answers are included