Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 478 new columns ({'2-15123149-2', '1-15652027-1', '2-15740666-6', '2-1636806-2', '2-13012165-2', '2-11772511-8', '1-11734041-2', '2-16832887-1', '1-17265535-6', '2-16198456-2', '2-16215078-1', '2-15715109-1', '2-14323142-16', '1-1449169-1', '2-18566436-1', '2-16079809-1', '2-14176339-3', '2-1750185-2', '2-17206737-3', '2-18951015-2', '2-1054502-1', '1-1682026-2', '2-14176339-2', 'course_teach', '2-1198472-1', '1-10733530-3', '1-20549371-3', 'student_transcripts_tracking', '2-14177667-3', '1-224672-2', '2-15525566-1', '2-15097334-5', '2-15715109-12', '2-18814912-4', '1-1449176-1', 'european_football_2', '1-1341604-11', '1-16381914-1', '1-11602885-1', '2-18802185-4', '2-12005739-2', '1-1342370-39', '1-1342233-5', '2-11241317-2', '2-18942405-11', 'california_schools', '1-254776-1', '2-17440650-2', '2-18395166-2', '1-22962745-12', '1-16729063-1', '1-13762472-4', '2-16792781-1', '2-18624773-3', '1-157826-1', '2-10721054-4', '2-14423756-3', '1-12547903-3', '2-15322952-2', '1-2523809-1', '1-14345690-4', '2-10538989-2', '2-17357560-1', '2-10581768-2', '1-28730873-2', '2-17304621-5', '1-16275828-4', '2-10780927-1', '1-1708050-1', '2-1543845-2', '2-11786147-5', '2-13071896-2', '1-24565004-15', '2-10882501-8', '1-2308381-2', '1-19753079-35', '1-10798421-1', '1-22496344-1', '2-16234974-1', '2-17577144-2', '1-2231241-1', '1-14342367-13', '2-18259953-4', '1-13833770-3', '1-16796625-1', '2-14415326-2', '2-10560886-3', '2-10600564-2', '2-10648431-3', 'superhero', '2-1780045-1', '2-1126723-3', '2-14010415-1',
...
17239112-7', '1-1342359-39', '2-12791809-1', '1-2840500-6', '1-1714685-1', '2-13986492-14', '1-1342359-5', '2-15715109-40', '1-14946657-3', '2-10777895-2', '1-2562572-11', '1-21907770-4', '1-1342249-5', 'student_club', '1-1211545-2', 'flight_2', '2-18632367-4', '1-2679061-6', '1-1014206-2', '2-17029703-3', '2-11565999-3', '1-2387790-2', '2-14509824-5', '2-1364210-1', '2-13554889-6', '2-16275828-7', '1-13677808-1', '1-1963459-2', 'debit_card_specializing', '1-14342592-8', 'thrombosis_prediction', '2-14687922-2', '1-225102-4', '2-17371250-13', '2-16271198-1', '2-14302613-17', '2-156618-3', '1-1341672-14', '2-14639905-3', '2-1137707-2', '2-15503252-3', '1-10712301-5', '1-140297-1', '2-14027795-2', '1-1342218-17', '2-17093870-5', '2-10325248-2', '2-11099297-12', '2-163231-4', '2-1014206-2', '1-28885977-1', '1-224837-4', '1-1506950-4', '2-11803648-12', '1-1341453-15', '2-14305653-31', '2-15362194-1', '2-11771022-3', '1-2076463-2', '2-1473124-1', '1-18183850-12', '2-13910113-4', '1-12094609-1', '2-15550233-3', '2-17034845-3', '2-18073616-2', '2-17524651-3', '1-11677691-1', '2-16785053-2', '2-12592245-1', '2-17387421-1', '2-18965848-4', 'financial', '1-1473672-8', '2-16250642-1', '2-13909437-6', '2-1028380-5', '1-1220125-4', '1-2668416-7', '2-10122032-1', '1-11609814-1', '1-1857216-1', '2-16772687-18', '2-1055707-1', '1-1341604-10', '2-11763491-1', '2-18579281-5', '2-18807607-2', '1-29202276-2', '1-1206583-2', '1-10601843-2', '1-20925393-3', '1-20823568-2', 'singer', '2-18982988-2'}) and 7 missing columns ({'schema_text_with_content', 'ori_query', 'question', 'evidence', 'db_id', 'schema_text_wo_content', 'amb_query'}).

This happened while the json dataset builder was generating data using

hf://datasets/griffith-bigdata/ambival/dbschema_test.json (at revision 352cc953aeef3d7c49ab2706e49dfbde0b792eb9)

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1831, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 644, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              car_1: struct<continents: list<item: string>, countries: list<item: string>, car_makers: list<item: string>, model_list: list<item: string>, car_names: list<item: string>, cars_data: list<item: string>>
                child 0, continents: list<item: string>
                    child 0, item: string
                child 1, countries: list<item: string>
                    child 0, item: string
                child 2, car_makers: list<item: string>
                    child 0, item: string
                child 3, model_list: list<item: string>
                    child 0, item: string
                child 4, car_names: list<item: string>
                    child 0, item: string
                child 5, cars_data: list<item: string>
                    child 0, item: string
              2-18868206-3: struct<2-18868206-3: list<item: string>>
                child 0, 2-18868206-3: list<item: string>
                    child 0, item: string
              2-17077948-1: struct<2-17077948-1: list<item: string>>
                child 0, 2-17077948-1: list<item: string>
                    child 0, item: string
              1-14850099-18: struct<1-14850099-18: list<item: string>>
                child 0, 1-14850099-18: list<item: string>
                    child 0, item: string
              1-1963459-2: struct<1-1963459-2: list<item: string>>
                child 0, 1-1963459-2: list<item: string>
                    child 0, item: string
              flight_2: struct<airlines: list<item: string>, airports: list<item: string>, flights: list<item: string>>
                child 0, airlines: list<item: string>
                    child 0, item: string
                child 1, airports: list<item: string>
                    child 0, item: string
                child 2, flights: list<item: string>
                    child 0, item: string
              cre_Doc_Template_Mgt: struct<ref_template_types: list<item: str
              ...
              t<2-15313481-14: list<item: string>>
                child 0, 2-15313481-14: list<item: string>
                    child 0, item: string
              2-1332289-1: struct<2-1332289-1: list<item: string>>
                child 0, 2-1332289-1: list<item: string>
                    child 0, item: string
              1-12078626-1: struct<1-12078626-1: list<item: string>>
                child 0, 1-12078626-1: list<item: string>
                    child 0, item: string
              1-17822401-1: struct<1-17822401-1: list<item: string>>
                child 0, 1-17822401-1: list<item: string>
                    child 0, item: string
              1-22357065-1: struct<1-22357065-1: list<item: string>>
                child 0, 1-22357065-1: list<item: string>
                    child 0, item: string
              1-24302700-2: struct<1-24302700-2: list<item: string>>
                child 0, 1-24302700-2: list<item: string>
                    child 0, item: string
              1-2679061-6: struct<1-2679061-6: list<item: string>>
                child 0, 1-2679061-6: list<item: string>
                    child 0, item: string
              1-29483673-1: struct<1-29483673-1: list<item: string>>
                child 0, 1-29483673-1: list<item: string>
                    child 0, item: string
              2-13555999-1: struct<2-13555999-1: list<item: string>>
                child 0, 2-13555999-1: list<item: string>
                    child 0, item: string
              2-16181798-1: struct<2-16181798-1: list<item: string>>
                child 0, 2-16181798-1: list<item: string>
                    child 0, item: string
              2-16250642-1: struct<2-16250642-1: list<item: string>>
                child 0, 2-16250642-1: list<item: string>
                    child 0, item: string
              2-17577144-2: struct<2-17577144-2: list<item: string>>
                child 0, 2-17577144-2: list<item: string>
                    child 0, item: string
              to
              {'db_id': Value('string'), 'question': Value('string'), 'evidence': Value('string'), 'schema_text_wo_content': Value('string'), 'schema_text_with_content': Value('string'), 'ori_query': Value('string'), 'amb_query': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1451, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 994, in stream_convert_to_parquet
                  builder._prepare_split(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1833, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 478 new columns ({'2-15123149-2', '1-15652027-1', '2-15740666-6', '2-1636806-2', '2-13012165-2', '2-11772511-8', '1-11734041-2', '2-16832887-1', '1-17265535-6', '2-16198456-2', '2-16215078-1', '2-15715109-1', '2-14323142-16', '1-1449169-1', '2-18566436-1', '2-16079809-1', '2-14176339-3', '2-1750185-2', '2-17206737-3', '2-18951015-2', '2-1054502-1', '1-1682026-2', '2-14176339-2', 'course_teach', '2-1198472-1', '1-10733530-3', '1-20549371-3', 'student_transcripts_tracking', '2-14177667-3', '1-224672-2', '2-15525566-1', '2-15097334-5', '2-15715109-12', '2-18814912-4', '1-1449176-1', 'european_football_2', '1-1341604-11', '1-16381914-1', '1-11602885-1', '2-18802185-4', '2-12005739-2', '1-1342370-39', '1-1342233-5', '2-11241317-2', '2-18942405-11', 'california_schools', '1-254776-1', '2-17440650-2', '2-18395166-2', '1-22962745-12', '1-16729063-1', '1-13762472-4', '2-16792781-1', '2-18624773-3', '1-157826-1', '2-10721054-4', '2-14423756-3', '1-12547903-3', '2-15322952-2', '1-2523809-1', '1-14345690-4', '2-10538989-2', '2-17357560-1', '2-10581768-2', '1-28730873-2', '2-17304621-5', '1-16275828-4', '2-10780927-1', '1-1708050-1', '2-1543845-2', '2-11786147-5', '2-13071896-2', '1-24565004-15', '2-10882501-8', '1-2308381-2', '1-19753079-35', '1-10798421-1', '1-22496344-1', '2-16234974-1', '2-17577144-2', '1-2231241-1', '1-14342367-13', '2-18259953-4', '1-13833770-3', '1-16796625-1', '2-14415326-2', '2-10560886-3', '2-10600564-2', '2-10648431-3', 'superhero', '2-1780045-1', '2-1126723-3', '2-14010415-1',
              ...
              17239112-7', '1-1342359-39', '2-12791809-1', '1-2840500-6', '1-1714685-1', '2-13986492-14', '1-1342359-5', '2-15715109-40', '1-14946657-3', '2-10777895-2', '1-2562572-11', '1-21907770-4', '1-1342249-5', 'student_club', '1-1211545-2', 'flight_2', '2-18632367-4', '1-2679061-6', '1-1014206-2', '2-17029703-3', '2-11565999-3', '1-2387790-2', '2-14509824-5', '2-1364210-1', '2-13554889-6', '2-16275828-7', '1-13677808-1', '1-1963459-2', 'debit_card_specializing', '1-14342592-8', 'thrombosis_prediction', '2-14687922-2', '1-225102-4', '2-17371250-13', '2-16271198-1', '2-14302613-17', '2-156618-3', '1-1341672-14', '2-14639905-3', '2-1137707-2', '2-15503252-3', '1-10712301-5', '1-140297-1', '2-14027795-2', '1-1342218-17', '2-17093870-5', '2-10325248-2', '2-11099297-12', '2-163231-4', '2-1014206-2', '1-28885977-1', '1-224837-4', '1-1506950-4', '2-11803648-12', '1-1341453-15', '2-14305653-31', '2-15362194-1', '2-11771022-3', '1-2076463-2', '2-1473124-1', '1-18183850-12', '2-13910113-4', '1-12094609-1', '2-15550233-3', '2-17034845-3', '2-18073616-2', '2-17524651-3', '1-11677691-1', '2-16785053-2', '2-12592245-1', '2-17387421-1', '2-18965848-4', 'financial', '1-1473672-8', '2-16250642-1', '2-13909437-6', '2-1028380-5', '1-1220125-4', '1-2668416-7', '2-10122032-1', '1-11609814-1', '1-1857216-1', '2-16772687-18', '2-1055707-1', '1-1341604-10', '2-11763491-1', '2-18579281-5', '2-18807607-2', '1-29202276-2', '1-1206583-2', '1-10601843-2', '1-20925393-3', '1-20823568-2', 'singer', '2-18982988-2'}) and 7 missing columns ({'schema_text_with_content', 'ori_query', 'question', 'evidence', 'db_id', 'schema_text_wo_content', 'amb_query'}).
              
              This happened while the json dataset builder was generating data using
              
              hf://datasets/griffith-bigdata/ambival/dbschema_test.json (at revision 352cc953aeef3d7c49ab2706e49dfbde0b792eb9)
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

db_id
string
question
string
evidence
string
schema_text_wo_content
string
schema_text_with_content
string
ori_query
string
amb_query
string
department_management
What are the names of the heads who are born outside the California state?
Table department, columns = [`department_id` (department id), `name` (name), `creation` (creation), `ranking` (ranking), `budget_in_billions` (budget in billions), `num_employees` (num employees)] Table head, columns = [`head_id` (head id), `name` (name), `born_state` (born state), `age` (age)] Table management, columns = [`department_id` (department id), `head_id` (head id), `temporary_acting` (temporary acting)] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
Table department, columns = [`department_id` (department id. Example values: [1, 2, 3]), `name` (name. Example values: [State, Treasury, Defense]), `creation` (creation. Example values: [1789, 1947, 1870]), `ranking` (ranking. Example values: [1, 2, 3]), `budget_in_billions` (budget in billions. Example values: [9.96, 11.1, 439.3]), `num_employees` (num employees. Example values: [30266.0, 115897.0, 3000000.0])] Table head, columns = [`head_id` (head id. Example values: [1, 2, 3]), `name` (name. Example values: [Tiger Woods, Sergio García, K. J. Choi]), `born_state` (born state. Example values: [AL, USA, California state, Alabama]), `age` (age. Example values: [67.0, 68.0, 69.0])] Table management, columns = [`department_id` (department id. Example values: [2, 7, 11]), `head_id` (head id. Example values: [5, 6, 3]), `temporary_acting` (temporary acting. Example values: [Yes, True, Affirmative])] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
SELECT name FROM head WHERE born_state != 'California'
SELECT name FROM head WHERE NOT born_state IN ('California', 'Golden State')
department_management
What are the distinct creation years of the departments managed by a secretary born in state 'Alabama'?
Table department, columns = [`department_id` (department id), `name` (name), `creation` (creation), `ranking` (ranking), `budget_in_billions` (budget in billions), `num_employees` (num employees)] Table head, columns = [`head_id` (head id), `name` (name), `born_state` (born state), `age` (age)] Table management, columns = [`department_id` (department id), `head_id` (head id), `temporary_acting` (temporary acting)] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
Table department, columns = [`department_id` (department id. Example values: [1, 2, 3]), `name` (name. Example values: [State, Treasury, Defense]), `creation` (creation. Example values: [1789, 1947, 1870]), `ranking` (ranking. Example values: [1, 2, 3]), `budget_in_billions` (budget in billions. Example values: [9.96, 11.1, 439.3]), `num_employees` (num employees. Example values: [30266.0, 115897.0, 3000000.0])] Table head, columns = [`head_id` (head id. Example values: [1, 2, 3]), `name` (name. Example values: [Tiger Woods, Sergio García, K. J. Choi]), `born_state` (born state. Example values: [AL, USA, California state, Alabama]), `age` (age. Example values: [67.0, 68.0, 69.0])] Table management, columns = [`department_id` (department id. Example values: [2, 7, 11]), `head_id` (head id. Example values: [5, 6, 3]), `temporary_acting` (temporary acting. Example values: [Yes, True, Affirmative])] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama'
SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama'
department_management
Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'?
Table department, columns = [`department_id` (department id), `name` (name), `creation` (creation), `ranking` (ranking), `budget_in_billions` (budget in billions), `num_employees` (num employees)] Table head, columns = [`head_id` (head id), `name` (name), `born_state` (born state), `age` (age)] Table management, columns = [`department_id` (department id), `head_id` (head id), `temporary_acting` (temporary acting)] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
Table department, columns = [`department_id` (department id. Example values: [1, 2, 3]), `name` (name. Example values: [State, Treasury, Defense]), `creation` (creation. Example values: [1789, 1947, 1870]), `ranking` (ranking. Example values: [1, 2, 3]), `budget_in_billions` (budget in billions. Example values: [9.96, 11.1, 439.3]), `num_employees` (num employees. Example values: [30266.0, 115897.0, 3000000.0])] Table head, columns = [`head_id` (head id. Example values: [1, 2, 3]), `name` (name. Example values: [Tiger Woods, Sergio García, K. J. Choi]), `born_state` (born state. Example values: [AL, USA, California state, Alabama]), `age` (age. Example values: [67.0, 68.0, 69.0])] Table management, columns = [`department_id` (department id. Example values: [2, 7, 11]), `head_id` (head id. Example values: [5, 6, 3]), `temporary_acting` (temporary acting. Example values: [Yes, True, Affirmative])] foreign keys = [management.head_ID = head.head_ID, management.department_ID = department.Department_ID]
SELECT T1.name , T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes'
SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting IN ('Yes', 'Affirmative')
shipping
Among all the shipments to Maryland, what is the percentage of the shipment to Davis?
"Florida" is the state; "Jacksonville" is city_name;
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN T2.city_name = 'Davis' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Maryland'
SELECT CAST(SUM(CASE WHEN T2.city_name IN ('City of Davis', 'Davis') THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state IN ('Maryland state', 'Maryland, USA', 'Maryland')
shipping
Among all the shipments to Kentucky, what is the percentage of the shipment to Gardena?
"Florida" is the state; "Jacksonville" is city_name;
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN T2.city_name = 'Gardena' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Kentucky'
SELECT CAST(SUM(CASE WHEN T2.city_name = 'Gardena' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Kentucky'
shipping
Among the shipments shipped to Bristol, DC, how many shipments weighed between 9,000 to 15,000?
"Cicero" is the city; 'Illinois' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Bristol' AND T2.state = 'DC' AND T1.weight BETWEEN 9000 AND 15000
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name IN ('Bristol', 'Bristol city') AND T2.state = 'DC' AND T1.weight BETWEEN 9000 AND 15000
shipping
How many cities are in South Carolina?
"Connecticut" is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM city WHERE state = 'South Carolina'
SELECT COUNT(*) FROM city WHERE state = 'South Carolina'
shipping
How many cities are in Wisconsin?
"Connecticut" is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM city WHERE state = 'Wisconsin'
SELECT COUNT(*) FROM city WHERE state IN ('State of Wisconsin', 'Wisconsin')
shipping
How many cities are in Idaho?
"Connecticut" is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM city WHERE state = 'Idaho'
SELECT COUNT(*) FROM city WHERE state IN ('Idaho', 'Idaho state')
shipping
What is the most populated city in Michigan?
in California refers to state = 'CA'; most populated city refers to Max(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT city_name FROM city WHERE state = 'Michigan' AND population = ( SELECT MAX(population) FROM city WHERE state = 'Michigan' )
SELECT city_name FROM city WHERE state IN ('MI, USA', 'State of Michigan', 'Michigan state', 'Michigan region', 'Michigan') AND population = (SELECT MAX(population) FROM city WHERE state IN ('MI, USA', 'State of Michigan', 'Michigan state', 'Michigan region', 'Michigan'))
shipping
What is the most populated city in Louisiana?
in California refers to state = 'CA'; most populated city refers to Max(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT city_name FROM city WHERE state = 'Louisiana' AND population = ( SELECT MAX(population) FROM city WHERE state = 'Louisiana' )
SELECT city_name FROM city WHERE state IN ('Louisiana', 'Louisiana state') AND population = (SELECT MAX(population) FROM city WHERE state IN ('Louisiana', 'Louisiana state'))
shipping
How many shipments were shipped to the least populated city in Missouri?
"California" is the state; least populated city refers to Min(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'Missouri' ORDER BY T3.population ASC LIMIT 1
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state IN ('Missouri', 'Missouri state', 'Missouri region') ORDER BY T3.population ASC LIMIT 1
shipping
How many shipments were shipped to the least populated city in North Dakota?
"California" is the state; least populated city refers to Min(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'North Dakota' ORDER BY T3.population ASC LIMIT 1
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state IN ('North Dakota state', 'North Dakota') ORDER BY T3.population ASC LIMIT 1
shipping
Among the shipments in 2017, how many of them have the destination in Indiana?
in 2017 refers to Cast(ship_date AS DATE) = 2017; 'New Jersey' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'Indiana'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state IN ('Indiana', 'Indiana territory')
shipping
Among the shipments in 2017, how many of them have the destination in Nebraska?
in 2017 refers to Cast(ship_date AS DATE) = 2017; 'New Jersey' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'Nebraska'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'Nebraska'
shipping
How many cities which belong to Ohio have transported weight greater than 20000?
"New Jersey" is the state; transported weight greater than 20000 refers to Sum(weight) > 20000
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Ohio' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 )
SELECT COUNT(*) FROM (SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Ohio' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000)
shipping
How many cities which belong to Oregon have transported weight greater than 20000?
"New Jersey" is the state; transported weight greater than 20000 refers to Sum(weight) > 20000
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Oregon' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 )
SELECT COUNT(*) FROM (SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state IN ('Oregon state', 'US-OR state', 'Oregon, USA', 'Oregon') GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000)
shipping
How many cities are in Connecticut?
"Connecticut" is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM city WHERE state = 'Connecticut'
SELECT COUNT(*) FROM city WHERE state IN ('Connecticut', 'Connecticut, USA')
shipping
Among all the shipments to Florida, what is the percentage of the shipment to Jacksonville?
"Florida" is the state; "Jacksonville" is city_name;
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN T2.city_name = 'Jacksonville' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'Florida'
SELECT CAST(SUM(CASE WHEN T2.city_name = 'Jacksonville' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state IN ('State of Florida', 'Florida', 'Florida, USA', 'FL state')
shipping
Among the shipments shipped to Cicero, Illinois, how many shipments weighed between 9,000 to 15,000?
"Cicero" is the city; 'Illinois' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.city_name = 'Cicero' AND T2.state = 'Illinois' AND T1.weight BETWEEN 9000 AND 15000
shipping
What is the most populated city in California?
in California refers to state = 'CA'; most populated city refers to Max(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT city_name FROM city WHERE state = 'California' AND population = ( SELECT MAX(population) FROM city WHERE state = 'California' )
SELECT city_name FROM city WHERE state = 'California' AND population = (SELECT MAX(population) FROM city WHERE state = 'California')
shipping
How many shipments were shipped to the least populated city in California?
"California" is the state; least populated city refers to Min(population)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1
SELECT COUNT(T3.city_name) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id INNER JOIN city AS T3 ON T3.city_id = T2.city_id WHERE T3.state = 'California' ORDER BY T3.population ASC LIMIT 1
shipping
Among the shipments in 2017, how many of them have the destination in New Jersey?
in 2017 refers to Cast(ship_date AS DATE) = 2017; 'New Jersey' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state = 'New Jersey'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE STRFTIME('%Y', T1.ship_date) = '2017' AND T2.state IN ('New Jersey, USA', 'State of New Jersey', 'New Jersey')
shipping
How many cities which belong to New Jersey have transported weight greater than 20000?
"New Jersey" is the state; transported weight greater than 20000 refers to Sum(weight) > 20000
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM ( SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state = 'New Jersey' GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000 )
SELECT COUNT(*) FROM (SELECT T2.city_id AS CITYID FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id WHERE T2.state IN ('New Jersey, USA', 'State of New Jersey', 'New Jersey') GROUP BY T2.city_id HAVING SUM(T1.weight) > 20000)
shipping
Among the shipments for Laguna Niguel, how many shipments were shipped to California in 2016?
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Laguna Niguel' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Laguna Niguel' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state IN ('CA', 'Golden State')
shipping
Among the shipments for Ann Arbor, how many shipments were shipped to California in 2016?
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Ann Arbor' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CO'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Ann Arbor' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state IN ('CO', 'Colorado, USA')
shipping
Among the shipments for Las Cruces, how many shipments were shipped to California in 2016?
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Las Cruces' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'IA'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Las Cruces' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'IA'
shipping
Among the shipments for Downey, how many shipments were shipped to California in 2016?
"Downey" is the city_name; 'California' is the state, whose abbreviation is CA; in 2016 refers to year(ship_date) = 2016,
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name = 'Downey' AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state = 'CA'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN city AS T2 ON T1.city_id = T2.city_id INNER JOIN customer AS T3 ON T3.cust_id = T1.cust_id WHERE T2.city_name IN ('Downey, CA', 'Downey') AND STRFTIME('%Y', T1.ship_date) = '2016' AND T3.state IN ('CA', 'Golden State')
shipping
What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, Detroit, California?
"7052 Carroll Road" is the address of customer; 'San Diego' is the city; 'California' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'Detroit' AND T2.state = 'AZ'
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'Detroit' AND T2.state IN ('AZ', 'AZ, United States')
shipping
What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, Sunnyvale, California?
"7052 Carroll Road" is the address of customer; 'San Diego' is the city; 'California' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'Sunnyvale' AND T2.state = 'IL'
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'Sunnyvale' AND T2.state IN ('IL', 'Illinois, USA')
shipping
How many customers who live in California that are retailers?
"retailer" is the cust_type; live in California refers to state = 'CA'
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM customer WHERE cust_type = 'retailer' AND state = 'CA'
SELECT COUNT(*) FROM customer WHERE cust_type IN ('retailer', 'retail company', 'retail seller') AND state IN ('CA', 'Golden State')
shipping
How many shipments were shipped to customers living in California in year 2016?
living in California refers to state = 'CA'; in year 2016 refers to CAST(ship_date AS DATE) = 2016
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state = 'CA'
SELECT COUNT(*) AS per FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE STRFTIME('%Y', T2.ship_date) = '2016' AND T1.state IN ('CA', 'Golden State')
shipping
What is the address of the driver that delivers the shipment for the customer lives at 7052 Carroll Road, San Diego, California?
"7052 Carroll Road" is the address of customer; 'San Diego' is the city; 'California' is the state
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'San Diego' AND T2.state = 'CA'
SELECT T3.address FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id INNER JOIN driver AS T3 ON T3.driver_id = T1.driver_id WHERE T2.address = '7052 Carroll Road' AND T2.city = 'San Diego' AND T2.state IN ('CA', 'Golden State')
shipping
How many shipments were delivered to a customer from New York?
"New York" refers to state = 'NY'
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'NY'
SELECT COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state IN ('New York', 'NY')
shipping
Provide the ship date of the first shipment to customers in South Carolina.
"South Carolina" refers to state = 'SC'; first shipment refers to Min(ship_date)
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT MIN(T1.ship_date) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'SC'
SELECT MIN(T1.ship_date) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'SC'
shipping
How many shipments were ordered by a customer in Florida?
customer in Florida refers to state = 'FL'
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state = 'FL'
SELECT COUNT(T1.cust_id) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.state IN ('FL state', 'FL', 'Florida, USA')
shipping
Determine the percentage of manufacturers who are from Texas among all of Lorenzo's customers.
"Texas" refers to state = 'TX'; 'manufacturer' is the cust_type; percentage = Divide (Count(cust_id where state = 'TX'), Count(cust_id)) * 100
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN cust_type = 'manufacturer' THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer WHERE state = 'TX'
SELECT CAST(SUM(CASE WHEN cust_type IN ('manufacturing company', 'manufacturer type', 'maker', 'manufacturer') THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM customer WHERE state IN ('TX state', 'Texas, USA', 'Lone Star State', 'TX')
shipping
Among the shipments to a customer from Texas, what percentage of the shipments shipped in 2017?
"Texas" refers to state = 'TX'; shipped in 2017 refers to CAST(ship_date AS DATE) = 2017; percentage = Divide (Count (ship_id where CAST(ship_date AS DATE) = 2017), Count (ship_id)) * 100
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS REAL ) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state = 'TX'
SELECT CAST(SUM(CASE WHEN STRFTIME('%Y', T1.ship_date) = '2017' THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM shipment AS T1 INNER JOIN customer AS T2 ON T1.cust_id = T2.cust_id WHERE T2.state IN ('TX state', 'Texas, USA', 'Lone Star State', 'TX')
shipping
Please list the IDs of all the shipments made by a retailer customer.
"retailer" is the cust_type;  IDs of shipments refers to ship_id
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT T2.ship_id FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'retailer'
SELECT T2.ship_id FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type IN ('retailer', 'retail company', 'retail seller')
shipping
How many customers are manufacturer?
"manufacturer" is the cust_type
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT COUNT(*) FROM customer WHERE cust_type = 'manufacturer'
SELECT COUNT(*) FROM customer WHERE cust_type IN ('manufacturing company', 'manufacturer type', 'maker', 'manufacturer')
shipping
What is the percentage of wholesaler customers who have shipment weight of not greater than 70000 pounds?
"wholesaler" is the cust_type; weight of not greater than 70000 pounds refers to weight < 70000; percentage = Divide (Count(cust_id where weight < 70000), Count(cust_id)) * 100
Table city, columns = [`city_id` (city id), `city_name` (city name), `state` (state), `population` (population), `area` (area)] Table customer, columns = [`cust_id` (customer id), `cust_name` (customer name), `annual_revenue` (annual revenue), `cust_type` (customer type), `address` (address), `city` (city), `state` (state), `zip` (zip), `phone` (phone)] Table driver, columns = [`driver_id` (driver id), `first_name` (first name), `last_name` (last name), `address` (address), `city` (city), `state` (state), `zip_code` (zip code), `phone` (phone)] Table truck, columns = [`truck_id` (truck id), `make` (make), `model_year` (model year)] Table shipment, columns = [`ship_id` (ship id), `cust_id` (customer id), `weight` (weight), `truck_id` (truck id), `driver_id` (driver id), `city_id` (city id), `ship_date` (ship date)] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
Table city, columns = [`city_id` (city id. Example values: [100, 101, 102]), `city_name` (city name. Example values: [Union City, Huntington Park, Passaic]), `state` (state. Example values: [State of New Jersey, California, New Jersey, USA]), `population` (population. Example values: [67088, 61348, 67861]), `area` (area. Example values: [1.3, 3.0, 3.1])] Table customer, columns = [`cust_id` (customer id. Example values: [193, 304, 314]), `cust_name` (customer name. Example values: [Advanced Fabricators, Pard's Trailer Sales, Saar Enterprises, Inc.]), `annual_revenue` (annual revenue. Example values: [39588651, 17158109, 47403613]), `cust_type` (customer type. Example values: [manufacturing company, wholesaler client, retail seller]), `address` (address. Example values: [5141 Summit Boulevard, 5910 South 300 West, 11687 192nd Street]), `city` (city. Example values: [West Palm Beach, Salt Lake City, Council Bluffs]), `state` (state. Example values: [State of Florida, UT, Iowa]), `zip` (zip. Example values: [33415.0, 84107.0, 51503.0]), `phone` (phone. Example values: [(561) 683-3535, (801) 262-4864, (712) 366-4929])] Table driver, columns = [`driver_id` (driver id. Example values: [20, 21, 22]), `first_name` (first name. Example values: [Sue, Andrea, Roger]), `last_name` (last name. Example values: [Newell, Simons, McHaney]), `address` (address. Example values: [268 Richmond Ave, 3574 Oak Limb Cv, 1839 S Orleans St]), `city` (city. Example values: [Memphis]), `state` (state. Example values: [TN]), `zip_code` (zip code. Example values: [38106, 38135, 38118]), `phone` (phone. Example values: [(901) 774-6569, (901) 384-0984, (901) 948-1043])] Table truck, columns = [`truck_id` (truck id. Example values: [1, 2, 3]), `make` (make. Example values: [Peterbilt, Mack, Kenworth]), `model_year` (model year. Example values: [2005, 2006, 2007])] Table shipment, columns = [`ship_id` (ship id. Example values: [1000, 1001, 1002]), `cust_id` (customer id. Example values: [3660, 2001, 1669]), `weight` (weight. Example values: [3528.0, 11394.0, 8712.0]), `truck_id` (truck id. Example values: [1, 2, 3]), `driver_id` (driver id. Example values: [23, 27, 21]), `city_id` (city id. Example values: [137, 186, 268]), `ship_date` (ship date. Example values: [2016-01-08, 2016-01-18, 2016-01-19])] foreign keys = [shipment.truck_id = truck.truck_id, shipment.driver_id = driver.driver_id, shipment.city_id = city.city_id, shipment.cust_id = customer.cust_id]
SELECT CAST(SUM(CASE WHEN T2.weight < 70000 THEN 1 ELSE 0 END) AS REAL) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type = 'wholesaler'
SELECT CAST(SUM(CASE WHEN T2.weight < 70000 THEN 1 ELSE 0 END) AS FLOAT) * 100 / COUNT(*) FROM customer AS T1 INNER JOIN shipment AS T2 ON T1.cust_id = T2.cust_id WHERE T1.cust_type IN ('wholesaler', 'wholesaler client', 'wholesaler type')
address
Which district has the largest land area in Delaware? Write the full name of the congress representative and include the postal codes.
"Wisconsin" is the state; largest land area refers to Max(land_area); full name refers to first_name, last_name; postal code refers to zip_code
Table CBSA, columns = [`cbsa` (cbsa), `cbsa_name` (cbsa name), `cbsa_type` (cbsa type)] Table state, columns = [`abbreviation` (abbreviation), `name` (name)] Table congress, columns = [`cognress_rep_id` (congress representative id), `first_name` (first name), `last_name` (last name), `cid` (cid), `party` (party), `state` (state), `abbreviation` (abbreviation), `house` (house), `district` (district), `land_area` (land area)] Table zip_data, columns = [`zip_code` (zip code), `city` (city), `state` (state), `multi_county` (multi country), `type` (type), `organization` (organization), `time_zone` (time zone), `daylight_savings` (daylight savings), `latitude` (latitude), `longitude` (longitude), `elevation` (elevation), `state_fips` (state fips), `county_fips` (country fips), `region` (region), `division` (division), `population_2020` (population 2020), `population_2010` (population 2010), `households` (households), `avg_house_value` (average house value), `avg_income_per_household` (average income per household), `persons_per_household` (persons per household), `white_population` (white population), `black_population` (black population), `hispanic_population` (hispanic population), `asian_population` (asian population), `american_indian_population` (american indian population), `hawaiian_population` (hawaiian population), `other_population` (other population), `male_population` (male population), `female_population` (female population), `median_age` (median age), `male_median_age` (male median age), `female_median_age` (female median age), `residential_mailboxes` (residential mailboxes), `business_mailboxes` (business mailboxes), `total_delivery_receptacles` (total delivery receptacles), `businesses` (businesses), `1st_quarter_payroll` (1st quarter payroll), `annual_payroll` (annual payroll), `employees` (employees), `water_area` (water area), `land_area` (land area), `single_family_delivery_units` (single-family delivery units), `multi_family_delivery_units` (multi-family delivery units), `total_beneficiaries` (total beneficiaries), `retired_workers` (retired workers), `disabled_workers` (disable workers), `parents_and_widowed` (parents and widowed), `spouses` (spouses), `children` (children), `over_65` (over 65), `monthly_benefits_all` (monthly benefits all), `monthly_benefits_retired_workers` (monthly benefits retired workers), `monthly_benefits_widowed` (monthly benefits widowed), `cbsa` (cbsa)] Table alias, columns = [`zip_code` (zip code), `alias` (alias)] Table area_code, columns = [`zip_code` (zip code), `area_code` (area code)] Table avoid, columns = [`zip_code` (zip code), `bad_alias` (bad alias)] Table country, columns = [`zip_code` (zip code), `county` (country), `state` (state)] Table zip_congress, columns = [`zip_code` (zip code), `district` (district)] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
Table CBSA, columns = [`cbsa` (cbsa. Example values: [10300, 10380, 10420]), `cbsa_name` (cbsa name. Example values: [Adrian, MI, Aguadilla-Isabela, PR, Akron, OH]), `cbsa_type` (cbsa type. Example values: [Micro, Metro])] Table state, columns = [`abbreviation` (abbreviation. Example values: [AA, AE, AK]), `name` (name. Example values: [Armed Forces Americas, Armed Forces Europe, Alaska])] Table congress, columns = [`cognress_rep_id` (congress representative id. Example values: [AK, AK-S1, AK-S2]), `first_name` (first name. Example values: [Young, Begich, Murkowski]), `last_name` (last name. Example values: [Don, Mark, Lisa]), `cid` (cid. Example values: [N00008091, N00009585, N00033101]), `party` (party. Example values: [Republican members, Democratic Party, Republican faction]), `state` (state. Example values: [Alaska, Alabama, USA, Alabama state]), `abbreviation` (abbreviation. Example values: [AK, AL, AR]), `house` (house. Example values: [House of Repsentatives, Senate]), `district` (district. Example values: [None, 1, 2]), `land_area` (land area. Example values: [571951.26, 570641.0, 6066.83])] Table zip_data, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `city` (city. Example values: [Holtsville, Adjuntas, Aguada, PR]), `state` (state. Example values: [NY, Puerto Rico, PR state]), `multi_county` (multi country. Example values: [No, Yes]), `type` (type. Example values: [Unique Postal Office, Unique Post Office point, Mailing Office]), `organization` (organization. Example values: [I R S Service Center, Irs Service Center, None]), `time_zone` (time zone. Example values: [Eastern, Atlantic, None]), `daylight_savings` (daylight savings. Example values: [Yes, No]), `latitude` (latitude. Example values: [40.817923, 40.788827, 18.196747]), `longitude` (longitude. Example values: [-73.045317, -73.039405, -66.736735]), `elevation` (elevation. Example values: [25, 0, 70]), `state_fips` (state fips. Example values: [36, 72, 78]), `county_fips` (country fips. Example values: [103, 1, 3]), `region` (region. Example values: [Northeast, None, South region of the United States]), `division` (division. Example values: [Middle Atlantic, None, New England]), `population_2020` (population 2020. Example values: [0, 11737, 24263]), `population_2010` (population 2010. Example values: [0, 18570, 41520]), `households` (households. Example values: [0, 6525, 15002]), `avg_house_value` (average house value. Example values: [0, 86200, 86300]), `avg_income_per_household` (average income per household. Example values: [0, 13092, 16358]), `persons_per_household` (persons per household. Example values: [0.0, 2.84, 2.76]), `white_population` (white population. Example values: [0, 17479, 36828]), `black_population` (black population. Example values: [0, 663, 2860]), `hispanic_population` (hispanic population. Example values: [0, 18486, 41265]), `asian_population` (asian population. Example values: [0, 7, 42]), `american_indian_population` (american indian population. Example values: [0, 113, 291]), `hawaiian_population` (hawaiian population. Example values: [0, 10, 32]), `other_population` (other population. Example values: [0, 558, 2634]), `male_population` (male population. Example values: [0, 9078, 20396]), `female_population` (female population. Example values: [0, 9492, 21124]), `median_age` (median age. Example values: [0.0, 35.9, 37.5]), `male_median_age` (male median age. Example values: [0.0, 34.5, 36.6]), `female_median_age` (female median age. Example values: [0.0, 37.1, 38.5]), `residential_mailboxes` (residential mailboxes. Example values: [0, 4133, 8791]), `business_mailboxes` (business mailboxes. Example values: [1, 0, 221]), `total_delivery_receptacles` (total delivery receptacles. Example values: [1, 0, 5173]), `businesses` (businesses. Example values: [2, 0, 472]), `1st_quarter_payroll` (1st quarter payroll. Example values: [0, 88685000, 109167000]), `annual_payroll` (annual payroll. Example values: [0, 376492000, 472633000]), `employees` (employees. Example values: [0, 9127, 18894]), `water_area` (water area. Example values: [0.0, 0.309, 1.71]), `land_area` (land area. Example values: [0.0, 64.348, 30.621]), `single_family_delivery_units` (single-family delivery units. Example values: [0, 2419, 5473]), `multi_family_delivery_units` (multi-family delivery units. Example values: [0, 1264, 827]), `total_beneficiaries` (total beneficiaries. Example values: [0, None, 5135]), `retired_workers` (retired workers. Example values: [0, None, 2940]), `disabled_workers` (disable workers. Example values: [0, None, 885]), `parents_and_widowed` (parents and widowed. Example values: [0, None, 155]), `spouses` (spouses. Example values: [0, None, 145]), `children` (children. Example values: [0, None, 1010]), `over_65` (over 65. Example values: [0, None, 3245]), `monthly_benefits_all` (monthly benefits all. Example values: [0, None, 6137000]), `monthly_benefits_retired_workers` (monthly benefits retired workers. Example values: [0, None, 4007000]), `monthly_benefits_widowed` (monthly benefits widowed. Example values: [0, None, 185000]), `cbsa` (cbsa. Example values: [35620, 38660, 10380])] Table alias, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `alias` (alias. Example values: [Holtsville, Adjuntas, Aguada])] Table area_code, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `area_code` (area code. Example values: [631, 787, 939])] Table avoid, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `bad_alias` (bad alias. Example values: [Internal Revenue Service, Colinas Del Gigante, Jard De Adjuntas])] Table country, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `county` (country. Example values: [SUFFOLK, ADJUNTAS, AGUADA]), `state` (state. Example values: [NY, PR, VI])] Table zip_congress, columns = [`zip_code` (zip code. Example values: [501, 601, 602]), `district` (district. Example values: [NY-1, PR, VI])] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
SELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Delaware' ORDER BY T1.land_area DESC LIMIT 1
SELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state IN ('Delaware', 'Delaware state', 'Delaware, USA') ORDER BY T1.land_area DESC LIMIT 1
address
How many postal points are there under the congress representative in New York?
postal points refer to zip_code; Puerto Rico refers to state = 'Puerto Rico';
Table CBSA, columns = [`cbsa` (cbsa), `cbsa_name` (cbsa name), `cbsa_type` (cbsa type)] Table state, columns = [`abbreviation` (abbreviation), `name` (name)] Table congress, columns = [`cognress_rep_id` (congress representative id), `first_name` (first name), `last_name` (last name), `cid` (cid), `party` (party), `state` (state), `abbreviation` (abbreviation), `house` (house), `district` (district), `land_area` (land area)] Table zip_data, columns = [`zip_code` (zip code), `city` (city), `state` (state), `multi_county` (multi country), `type` (type), `organization` (organization), `time_zone` (time zone), `daylight_savings` (daylight savings), `latitude` (latitude), `longitude` (longitude), `elevation` (elevation), `state_fips` (state fips), `county_fips` (country fips), `region` (region), `division` (division), `population_2020` (population 2020), `population_2010` (population 2010), `households` (households), `avg_house_value` (average house value), `avg_income_per_household` (average income per household), `persons_per_household` (persons per household), `white_population` (white population), `black_population` (black population), `hispanic_population` (hispanic population), `asian_population` (asian population), `american_indian_population` (american indian population), `hawaiian_population` (hawaiian population), `other_population` (other population), `male_population` (male population), `female_population` (female population), `median_age` (median age), `male_median_age` (male median age), `female_median_age` (female median age), `residential_mailboxes` (residential mailboxes), `business_mailboxes` (business mailboxes), `total_delivery_receptacles` (total delivery receptacles), `businesses` (businesses), `1st_quarter_payroll` (1st quarter payroll), `annual_payroll` (annual payroll), `employees` (employees), `water_area` (water area), `land_area` (land area), `single_family_delivery_units` (single-family delivery units), `multi_family_delivery_units` (multi-family delivery units), `total_beneficiaries` (total beneficiaries), `retired_workers` (retired workers), `disabled_workers` (disable workers), `parents_and_widowed` (parents and widowed), `spouses` (spouses), `children` (children), `over_65` (over 65), `monthly_benefits_all` (monthly benefits all), `monthly_benefits_retired_workers` (monthly benefits retired workers), `monthly_benefits_widowed` (monthly benefits widowed), `cbsa` (cbsa)] Table alias, columns = [`zip_code` (zip code), `alias` (alias)] Table area_code, columns = [`zip_code` (zip code), `area_code` (area code)] Table avoid, columns = [`zip_code` (zip code), `bad_alias` (bad alias)] Table country, columns = [`zip_code` (zip code), `county` (country), `state` (state)] Table zip_congress, columns = [`zip_code` (zip code), `district` (district)] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
Table CBSA, columns = [`cbsa` (cbsa. Example values: [10300, 10380, 10420]), `cbsa_name` (cbsa name. Example values: [Adrian, MI, Aguadilla-Isabela, PR, Akron, OH]), `cbsa_type` (cbsa type. Example values: [Micro, Metro])] Table state, columns = [`abbreviation` (abbreviation. Example values: [AA, AE, AK]), `name` (name. Example values: [Armed Forces Americas, Armed Forces Europe, Alaska])] Table congress, columns = [`cognress_rep_id` (congress representative id. Example values: [AK, AK-S1, AK-S2]), `first_name` (first name. Example values: [Young, Begich, Murkowski]), `last_name` (last name. Example values: [Don, Mark, Lisa]), `cid` (cid. Example values: [N00008091, N00009585, N00033101]), `party` (party. Example values: [Republican members, Democratic Party, Republican faction]), `state` (state. Example values: [Alaska, Alabama, USA, Alabama state]), `abbreviation` (abbreviation. Example values: [AK, AL, AR]), `house` (house. Example values: [House of Repsentatives, Senate]), `district` (district. Example values: [None, 1, 2]), `land_area` (land area. Example values: [571951.26, 570641.0, 6066.83])] Table zip_data, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `city` (city. Example values: [Holtsville, Adjuntas, Aguada, PR]), `state` (state. Example values: [NY, Puerto Rico, PR state]), `multi_county` (multi country. Example values: [No, Yes]), `type` (type. Example values: [Unique Postal Office, Unique Post Office point, Mailing Office]), `organization` (organization. Example values: [I R S Service Center, Irs Service Center, None]), `time_zone` (time zone. Example values: [Eastern, Atlantic, None]), `daylight_savings` (daylight savings. Example values: [Yes, No]), `latitude` (latitude. Example values: [40.817923, 40.788827, 18.196747]), `longitude` (longitude. Example values: [-73.045317, -73.039405, -66.736735]), `elevation` (elevation. Example values: [25, 0, 70]), `state_fips` (state fips. Example values: [36, 72, 78]), `county_fips` (country fips. Example values: [103, 1, 3]), `region` (region. Example values: [Northeast, None, South region of the United States]), `division` (division. Example values: [Middle Atlantic, None, New England]), `population_2020` (population 2020. Example values: [0, 11737, 24263]), `population_2010` (population 2010. Example values: [0, 18570, 41520]), `households` (households. Example values: [0, 6525, 15002]), `avg_house_value` (average house value. Example values: [0, 86200, 86300]), `avg_income_per_household` (average income per household. Example values: [0, 13092, 16358]), `persons_per_household` (persons per household. Example values: [0.0, 2.84, 2.76]), `white_population` (white population. Example values: [0, 17479, 36828]), `black_population` (black population. Example values: [0, 663, 2860]), `hispanic_population` (hispanic population. Example values: [0, 18486, 41265]), `asian_population` (asian population. Example values: [0, 7, 42]), `american_indian_population` (american indian population. Example values: [0, 113, 291]), `hawaiian_population` (hawaiian population. Example values: [0, 10, 32]), `other_population` (other population. Example values: [0, 558, 2634]), `male_population` (male population. Example values: [0, 9078, 20396]), `female_population` (female population. Example values: [0, 9492, 21124]), `median_age` (median age. Example values: [0.0, 35.9, 37.5]), `male_median_age` (male median age. Example values: [0.0, 34.5, 36.6]), `female_median_age` (female median age. Example values: [0.0, 37.1, 38.5]), `residential_mailboxes` (residential mailboxes. Example values: [0, 4133, 8791]), `business_mailboxes` (business mailboxes. Example values: [1, 0, 221]), `total_delivery_receptacles` (total delivery receptacles. Example values: [1, 0, 5173]), `businesses` (businesses. Example values: [2, 0, 472]), `1st_quarter_payroll` (1st quarter payroll. Example values: [0, 88685000, 109167000]), `annual_payroll` (annual payroll. Example values: [0, 376492000, 472633000]), `employees` (employees. Example values: [0, 9127, 18894]), `water_area` (water area. Example values: [0.0, 0.309, 1.71]), `land_area` (land area. Example values: [0.0, 64.348, 30.621]), `single_family_delivery_units` (single-family delivery units. Example values: [0, 2419, 5473]), `multi_family_delivery_units` (multi-family delivery units. Example values: [0, 1264, 827]), `total_beneficiaries` (total beneficiaries. Example values: [0, None, 5135]), `retired_workers` (retired workers. Example values: [0, None, 2940]), `disabled_workers` (disable workers. Example values: [0, None, 885]), `parents_and_widowed` (parents and widowed. Example values: [0, None, 155]), `spouses` (spouses. Example values: [0, None, 145]), `children` (children. Example values: [0, None, 1010]), `over_65` (over 65. Example values: [0, None, 3245]), `monthly_benefits_all` (monthly benefits all. Example values: [0, None, 6137000]), `monthly_benefits_retired_workers` (monthly benefits retired workers. Example values: [0, None, 4007000]), `monthly_benefits_widowed` (monthly benefits widowed. Example values: [0, None, 185000]), `cbsa` (cbsa. Example values: [35620, 38660, 10380])] Table alias, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `alias` (alias. Example values: [Holtsville, Adjuntas, Aguada])] Table area_code, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `area_code` (area code. Example values: [631, 787, 939])] Table avoid, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `bad_alias` (bad alias. Example values: [Internal Revenue Service, Colinas Del Gigante, Jard De Adjuntas])] Table country, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `county` (country. Example values: [SUFFOLK, ADJUNTAS, AGUADA]), `state` (state. Example values: [NY, PR, VI])] Table zip_congress, columns = [`zip_code` (zip code. Example values: [501, 601, 602]), `district` (district. Example values: [NY-1, PR, VI])] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'New York'
SELECT COUNT(T2.zip_code) FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state IN ('New York', 'New York State', 'Queens, New York')
address
Which district has the largest land area in Missouri? Write the full name of the congress representative and include the postal codes.
"Wisconsin" is the state; largest land area refers to Max(land_area); full name refers to first_name, last_name; postal code refers to zip_code
Table CBSA, columns = [`cbsa` (cbsa), `cbsa_name` (cbsa name), `cbsa_type` (cbsa type)] Table state, columns = [`abbreviation` (abbreviation), `name` (name)] Table congress, columns = [`cognress_rep_id` (congress representative id), `first_name` (first name), `last_name` (last name), `cid` (cid), `party` (party), `state` (state), `abbreviation` (abbreviation), `house` (house), `district` (district), `land_area` (land area)] Table zip_data, columns = [`zip_code` (zip code), `city` (city), `state` (state), `multi_county` (multi country), `type` (type), `organization` (organization), `time_zone` (time zone), `daylight_savings` (daylight savings), `latitude` (latitude), `longitude` (longitude), `elevation` (elevation), `state_fips` (state fips), `county_fips` (country fips), `region` (region), `division` (division), `population_2020` (population 2020), `population_2010` (population 2010), `households` (households), `avg_house_value` (average house value), `avg_income_per_household` (average income per household), `persons_per_household` (persons per household), `white_population` (white population), `black_population` (black population), `hispanic_population` (hispanic population), `asian_population` (asian population), `american_indian_population` (american indian population), `hawaiian_population` (hawaiian population), `other_population` (other population), `male_population` (male population), `female_population` (female population), `median_age` (median age), `male_median_age` (male median age), `female_median_age` (female median age), `residential_mailboxes` (residential mailboxes), `business_mailboxes` (business mailboxes), `total_delivery_receptacles` (total delivery receptacles), `businesses` (businesses), `1st_quarter_payroll` (1st quarter payroll), `annual_payroll` (annual payroll), `employees` (employees), `water_area` (water area), `land_area` (land area), `single_family_delivery_units` (single-family delivery units), `multi_family_delivery_units` (multi-family delivery units), `total_beneficiaries` (total beneficiaries), `retired_workers` (retired workers), `disabled_workers` (disable workers), `parents_and_widowed` (parents and widowed), `spouses` (spouses), `children` (children), `over_65` (over 65), `monthly_benefits_all` (monthly benefits all), `monthly_benefits_retired_workers` (monthly benefits retired workers), `monthly_benefits_widowed` (monthly benefits widowed), `cbsa` (cbsa)] Table alias, columns = [`zip_code` (zip code), `alias` (alias)] Table area_code, columns = [`zip_code` (zip code), `area_code` (area code)] Table avoid, columns = [`zip_code` (zip code), `bad_alias` (bad alias)] Table country, columns = [`zip_code` (zip code), `county` (country), `state` (state)] Table zip_congress, columns = [`zip_code` (zip code), `district` (district)] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
Table CBSA, columns = [`cbsa` (cbsa. Example values: [10300, 10380, 10420]), `cbsa_name` (cbsa name. Example values: [Adrian, MI, Aguadilla-Isabela, PR, Akron, OH]), `cbsa_type` (cbsa type. Example values: [Micro, Metro])] Table state, columns = [`abbreviation` (abbreviation. Example values: [AA, AE, AK]), `name` (name. Example values: [Armed Forces Americas, Armed Forces Europe, Alaska])] Table congress, columns = [`cognress_rep_id` (congress representative id. Example values: [AK, AK-S1, AK-S2]), `first_name` (first name. Example values: [Young, Begich, Murkowski]), `last_name` (last name. Example values: [Don, Mark, Lisa]), `cid` (cid. Example values: [N00008091, N00009585, N00033101]), `party` (party. Example values: [Republican members, Democratic Party, Republican faction]), `state` (state. Example values: [Alaska, Alabama, USA, Alabama state]), `abbreviation` (abbreviation. Example values: [AK, AL, AR]), `house` (house. Example values: [House of Repsentatives, Senate]), `district` (district. Example values: [None, 1, 2]), `land_area` (land area. Example values: [571951.26, 570641.0, 6066.83])] Table zip_data, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `city` (city. Example values: [Holtsville, Adjuntas, Aguada, PR]), `state` (state. Example values: [NY, Puerto Rico, PR state]), `multi_county` (multi country. Example values: [No, Yes]), `type` (type. Example values: [Unique Postal Office, Unique Post Office point, Mailing Office]), `organization` (organization. Example values: [I R S Service Center, Irs Service Center, None]), `time_zone` (time zone. Example values: [Eastern, Atlantic, None]), `daylight_savings` (daylight savings. Example values: [Yes, No]), `latitude` (latitude. Example values: [40.817923, 40.788827, 18.196747]), `longitude` (longitude. Example values: [-73.045317, -73.039405, -66.736735]), `elevation` (elevation. Example values: [25, 0, 70]), `state_fips` (state fips. Example values: [36, 72, 78]), `county_fips` (country fips. Example values: [103, 1, 3]), `region` (region. Example values: [Northeast, None, South region of the United States]), `division` (division. Example values: [Middle Atlantic, None, New England]), `population_2020` (population 2020. Example values: [0, 11737, 24263]), `population_2010` (population 2010. Example values: [0, 18570, 41520]), `households` (households. Example values: [0, 6525, 15002]), `avg_house_value` (average house value. Example values: [0, 86200, 86300]), `avg_income_per_household` (average income per household. Example values: [0, 13092, 16358]), `persons_per_household` (persons per household. Example values: [0.0, 2.84, 2.76]), `white_population` (white population. Example values: [0, 17479, 36828]), `black_population` (black population. Example values: [0, 663, 2860]), `hispanic_population` (hispanic population. Example values: [0, 18486, 41265]), `asian_population` (asian population. Example values: [0, 7, 42]), `american_indian_population` (american indian population. Example values: [0, 113, 291]), `hawaiian_population` (hawaiian population. Example values: [0, 10, 32]), `other_population` (other population. Example values: [0, 558, 2634]), `male_population` (male population. Example values: [0, 9078, 20396]), `female_population` (female population. Example values: [0, 9492, 21124]), `median_age` (median age. Example values: [0.0, 35.9, 37.5]), `male_median_age` (male median age. Example values: [0.0, 34.5, 36.6]), `female_median_age` (female median age. Example values: [0.0, 37.1, 38.5]), `residential_mailboxes` (residential mailboxes. Example values: [0, 4133, 8791]), `business_mailboxes` (business mailboxes. Example values: [1, 0, 221]), `total_delivery_receptacles` (total delivery receptacles. Example values: [1, 0, 5173]), `businesses` (businesses. Example values: [2, 0, 472]), `1st_quarter_payroll` (1st quarter payroll. Example values: [0, 88685000, 109167000]), `annual_payroll` (annual payroll. Example values: [0, 376492000, 472633000]), `employees` (employees. Example values: [0, 9127, 18894]), `water_area` (water area. Example values: [0.0, 0.309, 1.71]), `land_area` (land area. Example values: [0.0, 64.348, 30.621]), `single_family_delivery_units` (single-family delivery units. Example values: [0, 2419, 5473]), `multi_family_delivery_units` (multi-family delivery units. Example values: [0, 1264, 827]), `total_beneficiaries` (total beneficiaries. Example values: [0, None, 5135]), `retired_workers` (retired workers. Example values: [0, None, 2940]), `disabled_workers` (disable workers. Example values: [0, None, 885]), `parents_and_widowed` (parents and widowed. Example values: [0, None, 155]), `spouses` (spouses. Example values: [0, None, 145]), `children` (children. Example values: [0, None, 1010]), `over_65` (over 65. Example values: [0, None, 3245]), `monthly_benefits_all` (monthly benefits all. Example values: [0, None, 6137000]), `monthly_benefits_retired_workers` (monthly benefits retired workers. Example values: [0, None, 4007000]), `monthly_benefits_widowed` (monthly benefits widowed. Example values: [0, None, 185000]), `cbsa` (cbsa. Example values: [35620, 38660, 10380])] Table alias, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `alias` (alias. Example values: [Holtsville, Adjuntas, Aguada])] Table area_code, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `area_code` (area code. Example values: [631, 787, 939])] Table avoid, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `bad_alias` (bad alias. Example values: [Internal Revenue Service, Colinas Del Gigante, Jard De Adjuntas])] Table country, columns = [`zip_code` (zip code. Example values: [501, 544, 601]), `county` (country. Example values: [SUFFOLK, ADJUNTAS, AGUADA]), `state` (state. Example values: [NY, PR, VI])] Table zip_congress, columns = [`zip_code` (zip code. Example values: [501, 601, 602]), `district` (district. Example values: [NY-1, PR, VI])] foreign keys = [congress.abbreviation = state.abbreviation, zip_data.CBSA = CBSA.CBSA, zip_data.state = state.abbreviation, alias.zip_code = zip_data.zip_code, area_code.zip_code = zip_data.zip_code, avoid.zip_code = zip_data.zip_code, country.state = state.abbreviation, country.zip_code = zip_data.zip_code, zip_congress.zip_code = zip_data.zip_code, zip_congress.district = congress.cognress_rep_id]
SELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state = 'Missouri' ORDER BY T1.land_area DESC LIMIT 1
SELECT T2.zip_code, T1.first_name, T1.last_name FROM congress AS T1 INNER JOIN zip_congress AS T2 ON T1.cognress_rep_id = T2.district WHERE T1.state IN ('Missouri', 'Missouri state') ORDER BY T1.land_area DESC LIMIT 1
End of preview.
README.md exists but content is empty.
Downloads last month
64

Collection including griffith-bigdata/ambival