Hosted on SourceForge
and licensed under
Creative Commons GNU GPL.
| Casey Trauer submitted this query on: January 30, 2009 6:58pm EST | |
| TITLE | Motor racing results |
|---|---|
| SPORTS | Motor Racing |
| QUERY | SELECT pe.rank, dn.full_name, p.person_key, mres.lap, mres.laps_remaining FROM participants_events pe JOIN events e ON pe.event_id = e.id JOIN display_names dn ON pe.participant_id = dn.entity_id JOIN persons p ON pe.participant_id = p.id JOIN motor_racing_event_states mres ON mres.event_id = e.id WHERE e.event_key = 'l.nascar.com.nextel-2007-e.687' AND dn.entity_type = 'persons' ORDER BY pe.rank + 1; |
| DESCRIPTION | Returns a listing of race leaders and race status for a given event key. |
| DBs TESTED | MySQL |
| ADDITIONAL NOTES | Data from the Sports Network contains the top 10 drivers mid-race and a full listing of drivers post-race. Post-race data has more information, such as points earned. |
"This query adds a way to retrieve car make and number. It is not perfect: it currently will retrieve only the latest car model and number for that driver. Because it is a property of the driver and not the driver/event, that value will change regardless of event if the make or number changes."
"Adds flag_state column, which usually has a value of green, yellow or checkered. New for 2011."