-- Language PostgreSQL
        -- Tables: 
             -- Table: circuits 
columns : [['circuit id', 'number'], ['circuit reference', 'text'], ['name', 'text'], ['location', 'text'], ['country', 'text'], ['latitude', 'number'], ['longitude', 'number'], ['altitude', 'number'], ['url', 'text']]

 -- Table: races 
columns : [['race id', 'number'], ['year', 'number'], ['round', 'number'], ['circuit id', 'number'], ['name', 'text'], ['date', 'text'], ['time', 'text'], ['url', 'text']]

 -- Table: drivers 
columns : [['driver id', 'number'], ['driver reference', 'text'], ['number', 'number'], ['code', 'text'], ['forename', 'text'], ['surname', 'text'], ['dob', 'text'], ['nationality', 'text'], ['url', 'text']]

 -- Table: status 
columns : [['status id', 'number'], ['status', 'text']]

 -- Table: seasons 
columns : [['year', 'number'], ['url', 'text']]

 -- Table: constructors 
columns : [['constructor id', 'number'], ['constructor reference', 'text'], ['name', 'text'], ['nationality', 'text'], ['url', 'text']]

 -- Table: constructor standings 
columns : [['constructor standings id', 'number'], ['race id', 'number'], ['constructor id', 'number'], ['points', 'number'], ['position', 'number'], ['position text', 'text'], ['wins', 'number']]

 -- Table: results 
columns : [['result id', 'number'], ['race id', 'number'], ['driver id', 'number'], ['constructor id', 'number'], ['number', 'number'], ['grid', 'number'], ['position', 'number'], ['position text', 'text'], ['position order', 'number'], ['points', 'number'], ['laps', 'number'], ['time', 'text'], ['milliseconds', 'number'], ['fastest lap', 'number'], ['rank', 'number'], ['fastest lap time', 'text'], ['fastest lap speed', 'text'], ['status id', 'number']]

 -- Table: driver standings 
columns : [['driver standings id', 'number'], ['race id', 'number'], ['driver id', 'number'], ['points', 'number'], ['position', 'number'], ['position text', 'text'], ['wins', 'number']]

 -- Table: constructor results 
columns : [['constructor results id', 'number'], ['race id', 'number'], ['constructor id', 'number'], ['points', 'number'], ['status', 'number']]

 -- Table: qualifying 
columns : [['qualify id', 'number'], ['race id', 'number'], ['driver id', 'number'], ['constructor id', 'number'], ['number', 'number'], ['position', 'number'], ['q1', 'text'], ['q2', 'text'], ['q3', 'text']]

 -- Table: pit stops 
columns : [['race id', 'number'], ['driver id', 'number'], ['stop', 'number'], ['lap', 'number'], ['time', 'text'], ['duration', 'text'], ['milliseconds', 'number']]

 -- Table: lap times 
columns : [['race id', 'number'], ['driver id', 'number'], ['lap', 'number'], ['position', 'number'], ['time', 'text'], ['milliseconds', 'number']]

You are a SQL code translator. You have been given the Table data above. Your role is to translate natural language to PostgreSQL. 
You should not select columns that are not part of the tables provided to you. Think step by step.
Your only output should be SQL code. Do not include any other text. Only SQL code.



Question: What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results?
SQL: SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  8 UNION SELECT T1.forename ,  T1.surname ,  T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid  =  T2.driverid GROUP BY T1.driverid HAVING count(*)  >  5