##Instruction:
Database: formula_1
Total Tables: 13
Total Columns: 94

Table Schemas:

Database: formula_1
Total Tables: 13
Total Columns: 94

Table Schemas:

Table: circuits (9 columns)
---------------------------
• circuitId (integer): unique identification number of the circuit
• circuitRef (text): circuit reference name
• name (text): full name of circuit
• location (text): location of circuit
• country (text): country of circuit
• lat (real): latitude of location of circuit
• lng (real): longitude of location of circuit
  Values: commonsense evidence: 
Location coordinates: (lat, lng)
• alt (integer)
  Values: not useful
• url (text): url

Table: constructorResults (5 columns)
-------------------------------------
• constructorResultsId (integer): constructor Results Id
• raceId (integer): race id
• constructorId (integer): constructor id
• points (real): points
• status (text): status

Table: constructorStandings (7 columns)
---------------------------------------
• constructorStandingsId (integer): unique identification of the constructor standing records
• raceId (integer): id number identifying which races
• constructorId (integer): id number identifying which id
• points: how many points acquired in each race
• position (integer): position or track of circuits
• positionText (text)
  Values: same with position, not quite useful
• wins (integer): wins

Table: constructors (5 columns)
-------------------------------
• constructorId (integer): the unique identification number identifying constructors
• constructorRef (text): Constructor Reference name
• name (text): full name of the constructor
• nationality (text): nationality of the constructor
• url (text): the introduction website of the constructor
  Values: commonsense evidence: How to find out the detailed introduction of the constructor: through its url

Table: driverStandings (7 columns)
----------------------------------
• driverStandingsId (integer): the unique identification number identifying driver standing records
• raceId (integer): id number identifying which races
• driverId (integer): id number identifying which drivers
• points (real): how many points acquired in each race
• position (integer): position or track of circuits
• wins (integer): wins
• positionText (text)
  Values: same with position, not quite useful

Table: drivers (9 columns)
--------------------------
• driverId (integer): the unique identification number identifying each driver
• driverRef (text): driver reference name
• number (integer): number
• code (text): abbreviated code for drivers
  Values: if "null" or empty, it means it doesn't have code
• forename (text): forename
• surname (text): surname
• dob (date): date of birth
• nationality (text): nationality of drivers
• url (text): the introduction website of the drivers

Table: lapTimes (6 columns)
---------------------------
• raceId (integer): the identification number identifying race
• driverId (integer): the identification number identifying each driver
• lap (integer): lap number
• position (integer): position or track of circuits
• time (text): lap time
  Values: in minutes / seconds / ...
• milliseconds (integer): milliseconds

Table: pitStops (7 columns)
---------------------------
• raceId (integer): the identification number identifying race
• driverId (integer): the identification number identifying each driver
• stop (integer): stop number
• lap (integer): lap number
• time (text): time
  Values: exact time
• duration (text): duration time
  Values: seconds/
• milliseconds (integer): milliseconds

Table: qualifying (9 columns)
-----------------------------
• qualifyId (integer): the unique identification number identifying qualifying
  Values: How does F1 Sprint qualifying work? Sprint qualifying is essentially a short-form Grand Prix  a rac...
• raceId (integer): the identification number identifying each race
• driverId (integer): the identification number identifying each driver
• constructorId (integer): constructor Id
• number (integer): number
• position (integer): position or track of circuit
• q1 (text): time in qualifying 1
  Values: in minutes / seconds / ... 
commonsense evidence: 
Q1 lap times determine pole position and the orde...
• q2 (text): time in qualifying 2
  Values: in minutes / seconds / ... 
commonsense evidence: 
only top 15 in the q1 has the record of q2 
Q2 is...
• q3 (text): time in qualifying 3
  Values: in minutes / seconds / ... 
commonsense evidence: 
only top 10 in the q2 has the record of q3

Table: races (8 columns)
------------------------
• raceId (integer): the unique identification number identifying the race
• year (integer): year
• round (integer): round
• circuitId (integer): circuit Id
• name (text): name of the race
• date (date): duration time
• time (text): time of the location
• url (text): introduction of races

Table: results (18 columns)
---------------------------
• resultId (integer): the unique identification number identifying race result
• raceId (integer): the identification number identifying the race
• driverId (integer): the identification number identifying the driver
• constructorId (integer): the identification number identifying which constructors
• number (integer): number
• grid (integer): the number identifying the area where cars are set into a grid formation in order to start the race.
• position (integer): The finishing position or track of circuits
• positionText (text)
  Values: not quite useful
• positionOrder (integer): the finishing order of positions
• points (real): points
• laps (integer): lap number
• time (text): finish time
  Values: commonsense evidence: 
1. if the value exists, it means the driver finished the race. 
2. Only the t...
• milliseconds (integer): the actual finishing time of drivers in milliseconds
  Values: the actual finishing time of drivers
• fastestLap (integer): fastest lap number
• rank (integer): starting rank positioned by fastest lap speed
• fastestLapTime (text): fastest Lap Time
  Values: faster (smaller in the value) "fastestLapTime" leads to higher rank (smaller is higher rank)
• fastestLapSpeed (text): fastest Lap Speed
  Values: (km / h)
• statusId (integer): status ID
  Values: its category description appear in the table status

Table: seasons (2 columns)
--------------------------
• year (integer): the unique identification number identifying the race
• url (text): website link of season race introduction

Table: status (2 columns)
-------------------------
• statusId (integer): the unique identification number identifying status
• status (text): full name of status

##Evidence:
born before 1985 refers to year(dob)<1985; in 2000 to 2005 refers to year between 2000 and 2005; percentage = Divide(COUNT(driverId where year (dob) <1985 and laps >50),COUNT(DriverID where year between 2000 and 2005) *100;

##Role Access Policy (Column-Level):
Role: DriverManager
Accessible Columns: drivers: driverId, driverRef, number, code, forename, surname, dob, nationality; races: raceId, year, round, name, date; driverStandings: driverStandingsId, raceId, driverId, points, position, positionText, wins; results: resultId, raceId, driverId, constructorId, number, grid, position, positionText, positionOrder, points, laps, statusId

Based on the above schema and your role's column-level access policy, generate a SQL query to answer the question. If your role does not have access to the required columns, respond with: "Sorry, I cannot answer."


Question: From 2000 to 2005, what percentage of drivers who were born before 1985 and the lap numbers were over 50?
Evidence: born before 1985 refers to year(dob)<1985; in 2000 to 2005 refers to year between 2000 and 2005; percentage = Divide(COUNT(driverId where year (dob) <1985 and laps >50),COUNT(DriverID where year between 2000 and 2005) *100;
Answer: SELECT CAST(SUM(IIF(STRFTIME('%Y', T3.dob) < '1985' AND T1.laps > 50, 1, 0)) AS REAL) * 100 / COUNT(*)
FROM results AS T1
INNER JOIN races AS T2 ON T1.raceId = T2.raceId
INNER JOIN drivers AS T3 ON T1.driverId = T3.driverId
WHERE T2.year BETWEEN 2000 AND 2005;
Permission: allowed (All required columns are permitted)
Gold SQL: SELECT CAST(SUM(IIF(STRFTIME('%Y', T3.dob) < '1985' AND T1.laps > 50, 1, 0)) AS REAL) * 100 / COUNT(*)
FROM results AS T1
INNER JOIN races AS T2 ON T1.raceId = T2.raceId
INNER JOIN drivers AS T3 ON T1.driverId = T3.driverId
WHERE T2.year BETWEEN 2000 AND 2005;