sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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 dates of the assessment notes?
SQL: SELECT date_of_notes FROM Assessment_Notes
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: How many addresses have zip code 197?
SQL: SELECT count(*) FROM ADDRESSES WHERE zip_postcode  =  "197"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: How many distinct incident type codes are there?
SQL: SELECT count(DISTINCT incident_type_code) FROM Behavior_Incident
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Return all distinct detention type codes.
SQL: SELECT DISTINCT detention_type_code FROM Detention
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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 start and end dates for incidents with incident type code "NOISE"?
SQL: SELECT date_incident_start ,  date_incident_end FROM Behavior_Incident WHERE incident_type_code  =  "NOISE"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Return all detention summaries.
SQL: SELECT detention_summary FROM Detention
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Return the cell phone number and email address for all students.
SQL: SELECT cell_mobile_number ,  email_address FROM STUDENTS
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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 is the email of the student with first name "Emma" and last name "Rohan"?
SQL: SELECT email_address FROM Students WHERE first_name  =  "Emma" AND last_name  =  "Rohan"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: How many distinct students have been in detention?
SQL: SELECT count(DISTINCT student_id) FROM Students_in_Detention
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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 is the gender of the teacher with last name "Medhurst"?
SQL: SELECT gender FROM TEACHERS WHERE last_name  =  "Medhurst"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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 is the incident type description for the incident type with code "VIOLENCE"?
SQL: SELECT incident_type_description FROM Ref_Incident_Type WHERE incident_type_code  =  "VIOLENCE"
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Find the maximum and minimum monthly rental for all student addresses.
SQL: SELECT max(monthly_rental) ,  min(monthly_rental) FROM Student_Addresses
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Find the first names of teachers whose email address contains the word "man".
SQL: SELECT first_name FROM Teachers WHERE email_address LIKE '%man%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: List all information about the assessment notes sorted by date in ascending order.
SQL: SELECT * FROM Assessment_Notes ORDER BY date_of_notes ASC
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: List all cities of addresses in alphabetical order.
SQL: SELECT city FROM Addresses ORDER BY city
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Find the first names and last names of teachers in alphabetical order of last name.
SQL: SELECT first_name ,  last_name FROM Teachers ORDER BY last_name
-- Language PostgreSQL
        -- Tables: 
             -- Table: reference address types 
columns : [['address type code', 'text'], ['address type description', 'text']]

 -- Table: reference detention type 
columns : [['detention type code', 'text'], ['detention type description', 'text']]

 -- Table: reference incident type 
columns : [['incident type code', 'text'], ['incident type description', 'text']]

 -- Table: addresses 
columns : [['address id', 'number'], ['line 1', 'text'], ['line 2', 'text'], ['line 3', 'text'], ['city', 'text'], ['zip postcode', 'text'], ['state province county', 'text'], ['country', 'text'], ['other address details', 'text']]

 -- Table: students 
columns : [['student id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['date first rental', 'time'], ['date left university', 'time'], ['other student details', 'text']]

 -- Table: teachers 
columns : [['teacher id', 'number'], ['address id', 'number'], ['first name', 'text'], ['middle name', 'text'], ['last name', 'text'], ['gender', 'text'], ['cell mobile number', 'text'], ['email address', 'text'], ['other details', 'text']]

 -- Table: assessment notes 
columns : [['notes id', 'number'], ['student id', 'number'], ['teacher id', 'number'], ['date of notes', 'time'], ['text of notes', 'text'], ['other details', 'text']]

 -- Table: behavior incident 
columns : [['incident id', 'number'], ['incident type code', 'text'], ['student id', 'number'], ['date incident start', 'time'], ['date incident end', 'time'], ['incident summary', 'text'], ['recommendations', 'text'], ['other details', 'text']]

 -- Table: detention 
columns : [['detention id', 'number'], ['detention type code', 'text'], ['teacher id', 'number'], ['datetime detention start', 'time'], ['datetime detention end', 'time'], ['detention summary', 'text'], ['other details', 'text']]

 -- Table: student addresses 
columns : [['student id', 'number'], ['address id', 'number'], ['date address from', 'time'], ['date address to', 'time'], ['monthly rental', 'number'], ['other details', 'text']]

 -- Table: students in detention 
columns : [['student id', 'number'], ['detention id', 'number'], ['incident id', '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: Find all information about student addresses, and sort by monthly rental in descending order.
SQL: SELECT * FROM Student_Addresses ORDER BY monthly_rental DESC