sert121/SpiderSQL huggingface dataset:
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 followers does each user have?
SQL: SELECT count(*) FROM follows
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 number of followers for each user.
SQL: SELECT count(*) FROM follows GROUP BY f1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 number of tweets in record.
SQL: SELECT count(*) FROM tweets
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 number of users who posted some tweets.
SQL: SELECT count(DISTINCT UID) FROM tweets
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name and email of the user whose name contains the word ‘Swift’.
SQL: SELECT name ,  email FROM user_profiles WHERE name LIKE '%Swift%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 names of users whose emails contain ‘superstar’ or ‘edu’.
SQL: SELECT name FROM user_profiles WHERE email LIKE '%superstar%' OR email LIKE '%edu%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 text of tweets about the topic 'intern'.
SQL: SELECT text FROM tweets WHERE text LIKE '%intern%'
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name and email of the users who have more than 1000 followers.
SQL: SELECT name ,  email FROM user_profiles WHERE followers  >  1000
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 names of the users whose number of followers is greater than that of the user named "Tyler Swift".
SQL: SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  (SELECT count(*) FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 WHERE T1.name  =  'Tyler Swift')
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name and email for the users who have more than one follower.
SQL: SELECT T1.name ,  T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f1 GROUP BY T2.f1 HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 names of users who have more than one tweet.
SQL: SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 id of users who are followed by Mary and Susan.
SQL: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Susan"
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 id of users who are followed by Mary or Susan.
SQL: SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid  =  T2.f2 WHERE T1.name  =  "Mary" OR T1.name  =  "Susan"
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name of the user who has the largest number of followers.
SQL: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name and email of the user followed by the least number of people.
SQL: SELECT name ,  email FROM user_profiles ORDER BY followers LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 the name and number of followers for each user, and sort the results by the number of followers in descending order.
SQL: SELECT name ,  followers FROM user_profiles ORDER BY followers DESC
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 the names of 5 users followed by the largest number of other users.
SQL: SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 the text of all tweets in the order of date.
SQL: SELECT text FROM tweets ORDER BY createdate
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name of each user and number of tweets tweeted by each of them.
SQL: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name and partition id for users who tweeted less than twice.
SQL: SELECT T1.name ,  T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  <  2
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 name of the user who tweeted more than once, and number of tweets tweeted by them.
SQL: SELECT T1.name ,  count(*) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid  =  T2.uid GROUP BY T2.uid HAVING count(*)  >  1
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 average number of followers for the users who do not have any tweet.
SQL: SELECT avg(followers) FROM user_profiles WHERE UID NOT IN (SELECT UID FROM tweets)
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 average number of followers for the users who had some tweets.
SQL: SELECT avg(followers) FROM user_profiles WHERE UID IN (SELECT UID FROM tweets)
-- Language PostgreSQL
        -- Tables: 
             -- Table: follows 
columns : [['user id', 'number'], ['follower id', 'number']]

 -- Table: tweets 
columns : [['id', 'number'], ['user id', 'number'], ['text', 'text'], ['create date', 'time']]

 -- Table: user profiles 
columns : [['uid', 'number'], ['name', 'text'], ['email', 'text'], ['partition id', 'number'], ['followers', '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 total number of followers of all users.
SQL: SELECT max(followers) ,  sum(followers) FROM user_profiles
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 names of all the catalog entries.
SQL: SELECT distinct(catalog_entry_name) FROM catalog_contents
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 all the catalog entry names?
SQL: SELECT distinct(catalog_entry_name) FROM catalog_contents
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 list of attribute data types possessed by more than 3 attribute definitions.
SQL: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 attribute data types with more than 3 attribute definitions?
SQL: SELECT attribute_data_type FROM Attribute_Definitions GROUP BY attribute_data_type HAVING count(*)  >  3
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 attribute data type of the attribute with name "Green"?
SQL: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green"
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 attribute data type for the attribute named "Green".
SQL: SELECT attribute_data_type FROM Attribute_Definitions WHERE attribute_name  =  "Green"
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 name and level of catalog structure with level between 5 and 10.
SQL: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 name and level of catalog structure with level number between 5 and 10
SQL: SELECT catalog_level_name ,  catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 the catalog publishers whose name contains "Murray"
SQL: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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: Which catalog publishers have substring "Murray" in their names?
SQL: SELECT distinct(catalog_publisher) FROM catalogs WHERE catalog_publisher LIKE "%Murray%"
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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: Which catalog publisher has published the most catalogs?
SQL: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 catalog publisher that has the most catalogs.
SQL: SELECT catalog_publisher FROM catalogs GROUP BY catalog_publisher ORDER BY count(*) DESC LIMIT 1
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 names and publication dates of all catalogs that have catalog level number greater than 5.
SQL: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 name and publication date of the catalogs with catalog level number above 5?
SQL: SELECT t1.catalog_name ,  t1.date_of_publication FROM catalogs AS t1 JOIN catalog_structure AS t2 ON t1.catalog_id  =  t2.catalog_id WHERE catalog_level_number  >  5
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 entry names of catalog with the attribute possessed by most entries.
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)
-- Language PostgreSQL
        -- Tables: 
             -- Table: attribute definitions 
columns : [['attribute id', 'number'], ['attribute name', 'text'], ['attribute data type', 'text']]

 -- Table: catalogs 
columns : [['catalog id', 'number'], ['catalog name', 'text'], ['catalog publisher', 'text'], ['date of publication', 'time'], ['date of latest revision', 'time']]

 -- Table: catalog structure 
columns : [['catalog level number', 'number'], ['catalog id', 'number'], ['catalog level name', 'text']]

 -- Table: catalog contents 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['parent entry id', 'number'], ['previous entry id', 'number'], ['next entry id', 'number'], ['catalog entry name', 'text'], ['product stock number', 'text'], ['price in dollars', 'number'], ['price in euros', 'number'], ['price in pounds', 'number'], ['capacity', 'text'], ['length', 'text'], ['height', 'text'], ['width', 'text']]

 -- Table: catalog contents additional attributes 
columns : [['catalog entry id', 'number'], ['catalog level number', 'number'], ['attribute id', 'number'], ['attribute value', 'text']]

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 entry names of the catalog with the attribute that have the most entries.
SQL: SELECT t1.catalog_entry_name FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id  =  t2.catalog_entry_id WHERE t2.attribute_value  =  (SELECT attribute_value FROM Catalog_Contents_Additional_Attributes GROUP BY attribute_value ORDER BY count(*) DESC LIMIT 1)