id
int64 1
60
| question
stringlengths 31
140
| possible_query
stringlengths 29
217
| complexity
stringclasses 2
values | answer
stringlengths 17
73.1k
| schema_compSemEx
stringclasses 1
value | schema_compComEx
stringclasses 1
value | schema_redSemEx
stringclasses 10
values | schema_redComEx
stringclasses 10
values | sql_example_90
stringlengths 0
290
| sql_example_95
stringlengths 0
290
|
---|---|---|---|---|---|---|---|---|---|---|
1 | List basic cnpj for the 'RN' state in the 'establishment' table. | SELECT basic_cnpj FROM establishment WHERE state = 'RN'; | Easy | [{'basic_cnpj': '27817200'}, {'basic_cnpj': '32859505'}, {'basic_cnpj': '32999742'}, {'basic_cnpj': '04087496'}, {'basic_cnpj': '24191952'}, {'basic_cnpj': '38530104'}, {'basic_cnpj': '33169122'}, {'basic_cnpj': '38226259'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/ | ||
2 | Show the state of all 'Branch' establishments | SELECT state FROM establishment WHERE main_or_branch = 'Branch'; | Easy | [{'state': 'SP'}, {'state': 'RS'}, {'state': 'SP'}, {'state': 'CE'}, {'state': 'TO'}, {'state': 'MA'}, {'state': 'MG'}, {'state': 'MA'}, {'state': 'SP'}, {'state': 'RJ'}, {'state': 'SP'}, {'state': 'PR'}, {'state': 'AM'}, {'state': 'SP'}, {'state': 'ES'}, {'state': 'PR'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'GO'}, {'state': 'CE'}, {'state': 'RS'}, {'state': 'SP'}, {'state': 'PA'}, {'state': 'PR'}, {'state': 'MG'}, {'state': 'SP'}, {'state': 'SE'}, {'state': 'SP'}, {'state': 'RN'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'RO'}, {'state': 'BA'}, {'state': 'SP'}, {'state': 'GO'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'RS'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'SP'}, {'state': 'RJ'}, {'state': 'RJ'}, {'state': 'SC'}, {'state': 'SP'}, {'state': 'CE'}, {'state': 'RJ'}, {'state': 'SP'}, {'state': 'MG'}, {'state': 'RJ'}, {'state': 'MG'}, {'state': 'MG'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]List the branch name and city without any registered members.[/QUESTION]
[SQL]SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)[/SQL] | [QUESTION]List the branch name and city without any registered members.[/QUESTION]
[SQL]SELECT name , city FROM branch WHERE branch_id NOT IN (SELECT branch_id FROM membership_register_branch)[/SQL] |
3 | What is the total capital in the company table? | SELECT SUM(capital) FROM company; | Easy | [{'SUM(capital)': 87806087.0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] |
4 | List the basic cnpj of the companies with a capital below 1000 | SELECT basic_cnpj FROM company WHERE capital < 1000; | Easy | [{'basic_cnpj': '13003307'}, {'basic_cnpj': '2031566'}, {'basic_cnpj': '4348741'}, {'basic_cnpj': '11774782'}, {'basic_cnpj': '7358688'}, {'basic_cnpj': '2873491'}, {'basic_cnpj': '23939025'}, {'basic_cnpj': '9037731'}, {'basic_cnpj': '20935870'}, {'basic_cnpj': '5228431'}, {'basic_cnpj': '22276844'}, {'basic_cnpj': '97154173'}, {'basic_cnpj': '93776896'}, {'basic_cnpj': '15318975'}, {'basic_cnpj': '63779334'}, {'basic_cnpj': '13866855'}, {'basic_cnpj': '1932535'}, {'basic_cnpj': '75958801'}, {'basic_cnpj': '65767980'}, {'basic_cnpj': '13244647'}, {'basic_cnpj': '12277301'}, {'basic_cnpj': '1902956'}, {'basic_cnpj': '7132536'}, {'basic_cnpj': '97087027'}, {'basic_cnpj': '1875060'}, {'basic_cnpj': '38752818'}, {'basic_cnpj': '5340872'}, {'basic_cnpj': '13772725'}, {'basic_cnpj': '33903363'}, {'basic_cnpj': '207354'}, {'basic_cnpj': '1344996'}, {'basic_cnpj': '6566241'}, {'basic_cnpj': '37260275'}, {'basic_cnpj': '18695702'}, {'basic_cnpj': '6903226'}, {'basic_cnpj': '74780875'}, {'basic_cnpj': '42010978'}, {'basic_cnpj': '21621404'}, {'basic_cnpj': '117680'}, {'basic_cnpj': '5121920'}, {'basic_cnpj': '8200080'}, {'basic_cnpj': '3586148'}, {'basic_cnpj': '85477677'}, {'basic_cnpj': '92490044'}, {'basic_cnpj': '30559192'}, {'basic_cnpj': '16860944'}, {'basic_cnpj': '4813154'}, {'basic_cnpj': '25992774'}, {'basic_cnpj': '63174577'}, {'basic_cnpj': '8121987'}, {'basic_cnpj': '48854731'}, {'basic_cnpj': '19031053'}, {'basic_cnpj': '18510843'}, {'basic_cnpj': '5984610'}, {'basic_cnpj': '3764833'}, {'basic_cnpj': '48341736'}, {'basic_cnpj': '62791785'}, {'basic_cnpj': '62157086'}, {'basic_cnpj': '14300394'}, {'basic_cnpj': '15436398'}, {'basic_cnpj': '869781'}, {'basic_cnpj': '36126802'}, {'basic_cnpj': '41733122'}, {'basic_cnpj': '44743003'}, {'basic_cnpj': '5959575'}, {'basic_cnpj': '1141330'}, {'basic_cnpj': '321337'}, {'basic_cnpj': '49988950'}, {'basic_cnpj': '13491047'}, {'basic_cnpj': '28337913'}, {'basic_cnpj': '28269512'}, {'basic_cnpj': '2643961'}, {'basic_cnpj': '49573827'}, {'basic_cnpj': '80884299'}, {'basic_cnpj': '38839181'}, {'basic_cnpj': '46411455'}, {'basic_cnpj': '532248'}, {'basic_cnpj': '79467130'}, {'basic_cnpj': '68126382'}, {'basic_cnpj': '35126077'}, {'basic_cnpj': '12781555'}, {'basic_cnpj': '16452886'}, {'basic_cnpj': '1356691'}, {'basic_cnpj': '52019940'}, {'basic_cnpj': '16535499'}, {'basic_cnpj': '30688382'}, {'basic_cnpj': '84533520'}, {'basic_cnpj': '5771134'}, {'basic_cnpj': '29353596'}, {'basic_cnpj': '5139584'}, {'basic_cnpj': '31970380'}, {'basic_cnpj': '3322675'}, {'basic_cnpj': '51613813'}, {'basic_cnpj': '6705714'}, {'basic_cnpj': '53333450'}, {'basic_cnpj': '8354845'}, {'basic_cnpj': '9967967'}, {'basic_cnpj': '5648957'}, {'basic_cnpj': '91822270'}, {'basic_cnpj': '8511440'}, {'basic_cnpj': '46020803'}, {'basic_cnpj': '14209951'}, {'basic_cnpj': '13614732'}, {'basic_cnpj': '16108294'}, {'basic_cnpj': '31966211'}, {'basic_cnpj': '33649208'}, {'basic_cnpj': '99655'}, {'basic_cnpj': '36301665'}, {'basic_cnpj': '2584719'}, {'basic_cnpj': '73186090'}, {'basic_cnpj': '55659122'}, {'basic_cnpj': '38701828'}, {'basic_cnpj': '16024168'}, {'basic_cnpj': '22382495'}, {'basic_cnpj': '15709847'}, {'basic_cnpj': '7580759'}, {'basic_cnpj': '12319108'}, {'basic_cnpj': '1122106'}, {'basic_cnpj': '5342405'}, {'basic_cnpj': '54227681'}, {'basic_cnpj': '12079669'}, {'basic_cnpj': '2034635'}, {'basic_cnpj': '2691102'}, {'basic_cnpj': '13063662'}, {'basic_cnpj': '28098813'}, {'basic_cnpj': '16376281'}, {'basic_cnpj': '75254292'}, {'basic_cnpj': '39481767'}, {'basic_cnpj': '4801290'}, {'basic_cnpj': '17455122'}, {'basic_cnpj': '44658507'}, {'basic_cnpj': '95104303'}, {'basic_cnpj': '3341783'}, {'basic_cnpj': '36435998'}, {'basic_cnpj': '8076049'}, {'basic_cnpj': '39000809'}, {'basic_cnpj': '24623738'}, {'basic_cnpj': '42135438'}, {'basic_cnpj': '93197408'}, {'basic_cnpj': '43167545'}, {'basic_cnpj': '5223335'}, {'basic_cnpj': '60549276'}, {'basic_cnpj': '51992928'}, {'basic_cnpj': '38680382'}, {'basic_cnpj': '67240143'}, {'basic_cnpj': '40573002'}, {'basic_cnpj': '80488794'}, {'basic_cnpj': '65716565'}, {'basic_cnpj': '5290492'}, {'basic_cnpj': '4400983'}, {'basic_cnpj': '2781940'}, {'basic_cnpj': '4316478'}, {'basic_cnpj': '14951900'}, {'basic_cnpj': '38747738'}, {'basic_cnpj': '50633859'}, {'basic_cnpj': '19610307'}, {'basic_cnpj': '6035742'}, {'basic_cnpj': '53010211'}, {'basic_cnpj': '45707300'}, {'basic_cnpj': '9853498'}, {'basic_cnpj': '85209914'}, {'basic_cnpj': '21934961'}, {'basic_cnpj': '16129023'}, {'basic_cnpj': '97317382'}, {'basic_cnpj': '11621889'}, {'basic_cnpj': '48171770'}, {'basic_cnpj': '12437357'}, {'basic_cnpj': '2768590'}, {'basic_cnpj': '32159535'}, {'basic_cnpj': '52706462'}, {'basic_cnpj': '61701413'}, {'basic_cnpj': '12531725'}, {'basic_cnpj': '24541856'}, {'basic_cnpj': '25791479'}, {'basic_cnpj': '25496049'}, {'basic_cnpj': '19272665'}, {'basic_cnpj': '57437022'}, {'basic_cnpj': '21082896'}, {'basic_cnpj': '9526443'}, {'basic_cnpj': '62916770'}, {'basic_cnpj': '6056241'}, {'basic_cnpj': '20156442'}, {'basic_cnpj': '6225771'}, {'basic_cnpj': '52106846'}, {'basic_cnpj': '38773580'}, {'basic_cnpj': '7358778'}, {'basic_cnpj': '322150'}, {'basic_cnpj': '34346469'}, {'basic_cnpj': '37831803'}, {'basic_cnpj': '2623731'}, {'basic_cnpj': '5833526'}, {'basic_cnpj': '18913325'}, {'basic_cnpj': '6638729'}, {'basic_cnpj': '7606825'}, {'basic_cnpj': '16229965'}, {'basic_cnpj': '4925976'}, {'basic_cnpj': '54246780'}, {'basic_cnpj': '52023835'}, {'basic_cnpj': '5903629'}, {'basic_cnpj': '22167605'}, {'basic_cnpj': '247765'}, {'basic_cnpj': '4816019'}, {'basic_cnpj': '53850623'}, {'basic_cnpj': '52630704'}, {'basic_cnpj': '14240764'}, {'basic_cnpj': '14832381'}, {'basic_cnpj': '3613313'}, {'basic_cnpj': '38633749'}, {'basic_cnpj': '74217019'}, {'basic_cnpj': '63756332'}, {'basic_cnpj': '959712'}, {'basic_cnpj': '7176252'}, {'basic_cnpj': '45500477'}, {'basic_cnpj': '22724340'}, {'basic_cnpj': '18297556'}, {'basic_cnpj': '16432310'}, {'basic_cnpj': '19905678'}, {'basic_cnpj': '24744383'}, {'basic_cnpj': '85064814'}, {'basic_cnpj': '10023639'}, {'basic_cnpj': '12625169'}, {'basic_cnpj': '41566688'}, {'basic_cnpj': '13156741'}, {'basic_cnpj': '8515576'}, {'basic_cnpj': '12338918'}, {'basic_cnpj': '41630635'}, {'basic_cnpj': '7129118'}, {'basic_cnpj': '2172253'}, {'basic_cnpj': '25596807'}, {'basic_cnpj': '2063511'}, {'basic_cnpj': '15048502'}, {'basic_cnpj': '93623429'}, {'basic_cnpj': '26066941'}, {'basic_cnpj': '5056187'}, {'basic_cnpj': '2352891'}, {'basic_cnpj': '23026196'}, {'basic_cnpj': '9121432'}, {'basic_cnpj': '25719807'}, {'basic_cnpj': '21729337'}, {'basic_cnpj': '1701846'}, {'basic_cnpj': '3679319'}, {'basic_cnpj': '4789880'}, {'basic_cnpj': '97553225'}, {'basic_cnpj': '59252866'}, {'basic_cnpj': '78385085'}, {'basic_cnpj': '62903026'}, {'basic_cnpj': '11407524'}, {'basic_cnpj': '8453628'}, {'basic_cnpj': '12347697'}, {'basic_cnpj': '21096417'}, {'basic_cnpj': '8285526'}, {'basic_cnpj': '3461200'}, {'basic_cnpj': '1703185'}, {'basic_cnpj': '971829'}, {'basic_cnpj': '37889384'}, {'basic_cnpj': '14478369'}, {'basic_cnpj': '6257897'}, {'basic_cnpj': '41909920'}, {'basic_cnpj': '19676546'}, {'basic_cnpj': '1235249'}, {'basic_cnpj': '1188292'}, {'basic_cnpj': '74858556'}, {'basic_cnpj': '40194128'}, {'basic_cnpj': '74379983'}, {'basic_cnpj': '16137535'}, {'basic_cnpj': '50620764'}, {'basic_cnpj': '5784969'}, {'basic_cnpj': '28697485'}, {'basic_cnpj': '7199500'}, {'basic_cnpj': '61635801'}, {'basic_cnpj': '22304469'}, {'basic_cnpj': '21001007'}, {'basic_cnpj': '21747867'}, {'basic_cnpj': '17451857'}, {'basic_cnpj': '5900313'}, {'basic_cnpj': '37343161'}, {'basic_cnpj': '48871763'}, {'basic_cnpj': '25416385'}, {'basic_cnpj': '13794974'}, {'basic_cnpj': '14673370'}, {'basic_cnpj': '7030423'}, {'basic_cnpj': '38676877'}, {'basic_cnpj': '16731048'}, {'basic_cnpj': '27529964'}, {'basic_cnpj': '72971575'}, {'basic_cnpj': '46086491'}, {'basic_cnpj': '1655468'}, {'basic_cnpj': '50356414'}, {'basic_cnpj': '811429'}, {'basic_cnpj': '97168967'}, {'basic_cnpj': '36523204'}, {'basic_cnpj': '14121463'}, {'basic_cnpj': '5762165'}, {'basic_cnpj': '39966090'}, {'basic_cnpj': '37520273'}, {'basic_cnpj': '7418879'}, {'basic_cnpj': '41289117'}, {'basic_cnpj': '40868159'}, {'basic_cnpj': '322094'}, {'basic_cnpj': '3332991'}, {'basic_cnpj': '43077615'}, {'basic_cnpj': '373942'}, {'basic_cnpj': '27568510'}, {'basic_cnpj': '27166367'}, {'basic_cnpj': '36699708'}, {'basic_cnpj': '3768030'}, {'basic_cnpj': '2326659'}, {'basic_cnpj': '23226110'}, {'basic_cnpj': '25629003'}, {'basic_cnpj': '12282304'}, {'basic_cnpj': '10555386'}, {'basic_cnpj': '89851695'}, {'basic_cnpj': '12769620'}, {'basic_cnpj': '92741990'}, {'basic_cnpj': '13149674'}, {'basic_cnpj': '97421036'}, {'basic_cnpj': '26254536'}, {'basic_cnpj': '20672630'}, {'basic_cnpj': '70079769'}, {'basic_cnpj': '27017480'}, {'basic_cnpj': '1634075'}, {'basic_cnpj': '15415483'}, {'basic_cnpj': '32410442'}, {'basic_cnpj': '4819381'}, {'basic_cnpj': '8544564'}, {'basic_cnpj': '44209955'}, {'basic_cnpj': '18373191'}, {'basic_cnpj': '5807964'}, {'basic_cnpj': '79683249'}, {'basic_cnpj': '5407931'}, {'basic_cnpj': '48760805'}, {'basic_cnpj': '87273306'}, {'basic_cnpj': '82722968'}, {'basic_cnpj': '26753544'}, {'basic_cnpj': '7365436'}, {'basic_cnpj': '16258186'}, {'basic_cnpj': '3257396'}, {'basic_cnpj': '1240716'}, {'basic_cnpj': '39335483'}, {'basic_cnpj': '16820665'}, {'basic_cnpj': '65667511'}, {'basic_cnpj': '41415050'}, {'basic_cnpj': '19976422'}, {'basic_cnpj': '40192932'}, {'basic_cnpj': '1117344'}, {'basic_cnpj': '26382853'}, {'basic_cnpj': '73580102'}, {'basic_cnpj': '39766240'}, {'basic_cnpj': '2501782'}, {'basic_cnpj': '62076823'}, {'basic_cnpj': '3546784'}, {'basic_cnpj': '3476181'}, {'basic_cnpj': '53251473'}, {'basic_cnpj': '10624115'}, {'basic_cnpj': '105852'}, {'basic_cnpj': '8400365'}, {'basic_cnpj': '86990439'}, {'basic_cnpj': '920693'}, {'basic_cnpj': '12122718'}, {'basic_cnpj': '22983652'}, {'basic_cnpj': '9700819'}, {'basic_cnpj': '51981769'}, {'basic_cnpj': '48334721'}, {'basic_cnpj': '10047354'}, {'basic_cnpj': '25980318'}, {'basic_cnpj': '56430309'}, {'basic_cnpj': '29638321'}, {'basic_cnpj': '14508563'}, {'basic_cnpj': '16234342'}, {'basic_cnpj': '6854350'}, {'basic_cnpj': '93595288'}, {'basic_cnpj': '37400066'}, {'basic_cnpj': '28144142'}, {'basic_cnpj': '7217949'}, {'basic_cnpj': '10046876'}, {'basic_cnpj': '81242158'}, {'basic_cnpj': '45034444'}, {'basic_cnpj': '93926988'}, {'basic_cnpj': '12596757'}, {'basic_cnpj': '7423324'}, {'basic_cnpj': '7301817'}, {'basic_cnpj': '27639186'}, {'basic_cnpj': '35010936'}, {'basic_cnpj': '92130145'}, {'basic_cnpj': '29121121'}, {'basic_cnpj': '69135432'}, {'basic_cnpj': '12613039'}, {'basic_cnpj': '11092246'}, {'basic_cnpj': '2593691'}, {'basic_cnpj': '2686004'}, {'basic_cnpj': '51439966'}, {'basic_cnpj': '3913403'}, {'basic_cnpj': '11377224'}, {'basic_cnpj': '3727072'}, {'basic_cnpj': '13425673'}, {'basic_cnpj': '5366103'}, {'basic_cnpj': '9994893'}, {'basic_cnpj': '29561501'}, {'basic_cnpj': '88839154'}, {'basic_cnpj': '3234574'}, {'basic_cnpj': '94056561'}, {'basic_cnpj': '14553300'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]List the names of companies in descending order of market value.[/QUESTION]
[SQL]SELECT name FROM Companies ORDER BY Market_Value_billion DESC[/SQL] | [QUESTION]List the names of companies in descending order of market value.[/QUESTION]
[SQL]SELECT name FROM Companies ORDER BY Market_Value_billion DESC[/SQL] |
5 | What are the distinct states of the establishments | SELECT DISTINCT state FROM establishment; | Easy | [{'state': 'BA'}, {'state': 'GO'}, {'state': 'MG'}, {'state': 'SC'}, {'state': 'RS'}, {'state': 'RJ'}, {'state': 'PR'}, {'state': 'SP'}, {'state': 'AC'}, {'state': 'PE'}, {'state': 'MT'}, {'state': 'CE'}, {'state': 'AL'}, {'state': 'PB'}, {'state': 'DF'}, {'state': 'SE'}, {'state': 'PA'}, {'state': 'RO'}, {'state': 'MA'}, {'state': 'TO'}, {'state': 'AM'}, {'state': 'RN'}, {'state': 'PI'}, {'state': 'ES'}, {'state': 'AP'}, {'state': 'MS'}, {'state': 'EX'}, {'state': 'RR'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What are the names of the states that have 2 to 4 employees living there?[/QUESTION]
[SQL]SELECT T1.state_province_county FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id GROUP BY T1.state_province_county HAVING count(*) BETWEEN 2 AND 4;[/SQL] |
|
6 | What is the name of each company with capital gratter than 1 million? | SELECT name FROM company WHERE capital > 1000000; | Easy | [{'name': 'CONCEICAO FIT ACADEMIA DE GINASTICA E CONDICIONAMENTO FISICO LTDA'}, {'name': 'GEBB WORK INDUSTRIA DE MOVEIS LTDA'}, {'name': 'REECICLAR DO BRASIL LTDA'}, {'name': 'ENGIE TRADING COMERCIALIZADORA DE ENERGIA LTDA'}, {'name': 'RESERVA COLIBRIS SPE LTDA'}, {'name': 'EBI ECIA BUZIOS INCORPORACOES LTDA - EM LIQUIDACAO'}, {'name': 'FEMESC COMERCIO DE MATERIAL ESCOLAR E ESCRITORIO LTDA'}, {'name': 'PAX EMPREENDIMENTOS E PARTICIPACOES S.A.'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]How many distinct companies are there?[/QUESTION]
[SQL]SELECT count(DISTINCT Company) FROM entrepreneur[/SQL] | [QUESTION]How many distinct companies are there?[/QUESTION]
[SQL]SELECT count(DISTINCT Company) FROM entrepreneur[/SQL] |
7 | What is the name of the companies with capital gratter than 1 million? | SELECT name FROM company WHERE capital > 1000000; | Easy | [{'name': 'CONCEICAO FIT ACADEMIA DE GINASTICA E CONDICIONAMENTO FISICO LTDA'}, {'name': 'GEBB WORK INDUSTRIA DE MOVEIS LTDA'}, {'name': 'REECICLAR DO BRASIL LTDA'}, {'name': 'ENGIE TRADING COMERCIALIZADORA DE ENERGIA LTDA'}, {'name': 'RESERVA COLIBRIS SPE LTDA'}, {'name': 'EBI ECIA BUZIOS INCORPORACOES LTDA - EM LIQUIDACAO'}, {'name': 'FEMESC COMERCIO DE MATERIAL ESCOLAR E ESCRITORIO LTDA'}, {'name': 'PAX EMPREENDIMENTOS E PARTICIPACOES S.A.'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]How many companies are there?[/QUESTION]
[SQL]SELECT count(*) FROM Companies[/SQL] | [QUESTION]How many companies are there?[/QUESTION]
[SQL]SELECT count(*) FROM Companies[/SQL] |
8 | What is the total capital for all companies? | SELECT SUM(capital) FROM company | Easy | [{'SUM(capital)': 87806087.0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] |
9 | What is the total capital for all companies with size code 3? | SELECT SUM(capital) FROM company WHERE company_size_code = 3; | Easy | [{'SUM(capital)': 6026000.0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
) |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] | [QUESTION]What is the total number of companies?[/QUESTION]
[SQL]SELECT count(*) FROM company[/SQL] |
10 | List the basic cnpj of th establishments with '5612100' as primary economic activity code | SELECT basic_cnpj FROM establishment WHERE primary_economic_activity_code = 5612100; | Easy | [{'basic_cnpj': '40010763'}, {'basic_cnpj': '18825347'}, {'basic_cnpj': '21085810'}, {'basic_cnpj': '33880625'}, {'basic_cnpj': '23971113'}, {'basic_cnpj': '37476156'}, {'basic_cnpj': '24133510'}, {'basic_cnpj': '28142097'}, {'basic_cnpj': '35662537'}, {'basic_cnpj': '14549079'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | ||
11 | How many simple taxation was excluded between 2021-01-01 and 2022-12-31? | SELECT COUNT(*) FROM taxation WHERE simples_taxation_exclusion_date > 2021-01-01 AND simples_taxation_exclusion_date <2022-12-31; | Easy | [{'COUNT(*)': 0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ | ||
12 | What is the minimum and maximum capital of companies? | SELECT MIN(capital), MAX(capital) FROM company; | Easy | [{'MIN(capital)': 0.0, 'MAX(capital)': 36000000.0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/ | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] |
13 | What is the minimum and maximum capital of companies with size_code equal to 3? | SELECT MIN(capital), MAX(capital) FROM company WHERE company_size_code=3; | Easy | [{'MIN(capital)': 0.0, 'MAX(capital)': 3000000.0}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] |
14 | Show the names and states of all establishments who have registration status code equal to 1 | SELECT name, state FROM establishment WHERE registration_status_code=1; | Easy | [{'name': 'NIBA ELETRONICA', 'state': 'SP'}, {'name': None, 'state': 'PE'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/ | [QUESTION]List all customer status codes and the number of customers having each status code.[/QUESTION]
[SQL]SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;[/SQL] | [QUESTION]List all customer status codes and the number of customers having each status code.[/QUESTION]
[SQL]SELECT customer_status_code , count(*) FROM Customers GROUP BY customer_status_code;[/SQL] |
15 | What is the highest number of a age range code?; | SELECT MAX(age_range_code) FROM age_range | Easy | [{'MAX(age_range_code)': 9}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the minimum, mean, and maximum age across all students?[/QUESTION]
[SQL]SELECT min(age) , avg(age) , max(age) FROM Student[/SQL] | [QUESTION]What is the minimum, mean, and maximum age across all students?[/QUESTION]
[SQL]SELECT min(age) , avg(age) , max(age) FROM Student[/SQL] |
16 | List the basic cnpj of establishments with a name starting with 'S' | SELECT basic_cnpj FROM establishment WHERE name LIKE 'S%'; | Easy | [{'basic_cnpj': '09518509'}, {'basic_cnpj': '24603935'}, {'basic_cnpj': '17876726'}, {'basic_cnpj': '01672396'}, {'basic_cnpj': '26949728'}, {'basic_cnpj': '07237287'}, {'basic_cnpj': '21123601'}, {'basic_cnpj': '23647289'}, {'basic_cnpj': '47391473'}, {'basic_cnpj': '30133972'}, {'basic_cnpj': '05862915'}, {'basic_cnpj': '01062023'}, {'basic_cnpj': '10762620'}, {'basic_cnpj': '18613843'}, {'basic_cnpj': '03602260'}, {'basic_cnpj': '04800673'}, {'basic_cnpj': '05320871'}, {'basic_cnpj': '07168317'}, {'basic_cnpj': '65848731'}, {'basic_cnpj': '21861583'}, {'basic_cnpj': '21427940'}, {'basic_cnpj': '21132658'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]List the name of a building along with the name of a company whose office is in the building.[/QUESTION]
[SQL]SELECT T3.name , T2.name FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id[/SQL] |
|
17 | What is the basic cnpj of companies that have capital between 1000 and 10000? | SELECT basic_cnpj FROM company WHERE capital BETWEEN 1000 AND 10000; | Easy | [{'basic_cnpj': '15605651'}, {'basic_cnpj': '23389598'}, {'basic_cnpj': '19540179'}, {'basic_cnpj': '52974497'}, {'basic_cnpj': '53694224'}, {'basic_cnpj': '38613993'}, {'basic_cnpj': '49051313'}, {'basic_cnpj': '34739822'}, {'basic_cnpj': '46167585'}, {'basic_cnpj': '36127465'}, {'basic_cnpj': '48191370'}, {'basic_cnpj': '24576055'}, {'basic_cnpj': '36367904'}, {'basic_cnpj': '41269038'}, {'basic_cnpj': '30159820'}, {'basic_cnpj': '51870663'}, {'basic_cnpj': '42404412'}, {'basic_cnpj': '11129790'}, {'basic_cnpj': '33363302'}, {'basic_cnpj': '48438957'}, {'basic_cnpj': '25241797'}, {'basic_cnpj': '52834012'}, {'basic_cnpj': '11416501'}, {'basic_cnpj': '26016573'}, {'basic_cnpj': '21500077'}, {'basic_cnpj': '49586906'}, {'basic_cnpj': '28801138'}, {'basic_cnpj': '28981450'}, {'basic_cnpj': '40851582'}, {'basic_cnpj': '23418028'}, {'basic_cnpj': '44934862'}, {'basic_cnpj': '53594504'}, {'basic_cnpj': '47704377'}, {'basic_cnpj': '35852539'}, {'basic_cnpj': '59179416'}, {'basic_cnpj': '32668986'}, {'basic_cnpj': '25326820'}, {'basic_cnpj': '46146930'}, {'basic_cnpj': '31906962'}, {'basic_cnpj': '29557149'}, {'basic_cnpj': '48861767'}, {'basic_cnpj': '45848416'}, {'basic_cnpj': '23872833'}, {'basic_cnpj': '45701772'}, {'basic_cnpj': '38540294'}, {'basic_cnpj': '32407523'}, {'basic_cnpj': '40788237'}, {'basic_cnpj': '23036869'}, {'basic_cnpj': '32737984'}, {'basic_cnpj': '24455048'}, {'basic_cnpj': '50596016'}, {'basic_cnpj': '41878156'}, {'basic_cnpj': '42974443'}, {'basic_cnpj': '38267831'}, {'basic_cnpj': '10324030'}, {'basic_cnpj': '47745204'}, {'basic_cnpj': '28379227'}, {'basic_cnpj': '33194190'}, {'basic_cnpj': '49980483'}, {'basic_cnpj': '49419687'}, {'basic_cnpj': '43552202'}, {'basic_cnpj': '29395484'}, {'basic_cnpj': '10535694'}, {'basic_cnpj': '43839119'}, {'basic_cnpj': '37562025'}, {'basic_cnpj': '27928630'}, {'basic_cnpj': '40920578'}, {'basic_cnpj': '40243124'}, {'basic_cnpj': '21678236'}, {'basic_cnpj': '29117859'}, {'basic_cnpj': '43009677'}, {'basic_cnpj': '26755034'}, {'basic_cnpj': '26881126'}, {'basic_cnpj': '22197520'}, {'basic_cnpj': '39466020'}, {'basic_cnpj': '27625361'}, {'basic_cnpj': '42913197'}, {'basic_cnpj': '20853045'}, {'basic_cnpj': '25183879'}, {'basic_cnpj': '47103709'}, {'basic_cnpj': '9559932'}, {'basic_cnpj': '37214870'}, {'basic_cnpj': '34445034'}, {'basic_cnpj': '24022830'}, {'basic_cnpj': '52741442'}, {'basic_cnpj': '23645123'}, {'basic_cnpj': '21042632'}, {'basic_cnpj': '52174225'}, {'basic_cnpj': '24246458'}, {'basic_cnpj': '47433984'}, {'basic_cnpj': '32496642'}, {'basic_cnpj': '20325302'}, {'basic_cnpj': '49215271'}, {'basic_cnpj': '40327497'}, {'basic_cnpj': '42758159'}, {'basic_cnpj': '52296717'}, {'basic_cnpj': '28386833'}, {'basic_cnpj': '51987455'}, {'basic_cnpj': '3176300'}, {'basic_cnpj': '49846941'}, {'basic_cnpj': '31853865'}, {'basic_cnpj': '43203622'}, {'basic_cnpj': '47489536'}, {'basic_cnpj': '41606910'}, {'basic_cnpj': '26202693'}, {'basic_cnpj': '28364423'}, {'basic_cnpj': '46527630'}, {'basic_cnpj': '28632667'}, {'basic_cnpj': '27939038'}, {'basic_cnpj': '27548837'}, {'basic_cnpj': '37485063'}, {'basic_cnpj': '18848985'}, {'basic_cnpj': '28149618'}, {'basic_cnpj': '53382071'}, {'basic_cnpj': '47035260'}, {'basic_cnpj': '12915357'}, {'basic_cnpj': '17812620'}, {'basic_cnpj': '12525230'}, {'basic_cnpj': '20930691'}, {'basic_cnpj': '4636404'}, {'basic_cnpj': '41428031'}, {'basic_cnpj': '51101888'}, {'basic_cnpj': '36574771'}, {'basic_cnpj': '36615195'}, {'basic_cnpj': '34085240'}, {'basic_cnpj': '36260194'}, {'basic_cnpj': '16880283'}, {'basic_cnpj': '51566372'}, {'basic_cnpj': '46218799'}, {'basic_cnpj': '10140736'}, {'basic_cnpj': '42042525'}, {'basic_cnpj': '8662265'}, {'basic_cnpj': '23581316'}, {'basic_cnpj': '50255352'}, {'basic_cnpj': '27104757'}, {'basic_cnpj': '35498667'}, {'basic_cnpj': '37850199'}, {'basic_cnpj': '38242168'}, {'basic_cnpj': '45899136'}, {'basic_cnpj': '45344328'}, {'basic_cnpj': '37986603'}, {'basic_cnpj': '43199088'}, {'basic_cnpj': '50896431'}, {'basic_cnpj': '21935161'}, {'basic_cnpj': '14722232'}, {'basic_cnpj': '22306354'}, {'basic_cnpj': '32151311'}, {'basic_cnpj': '17929284'}, {'basic_cnpj': '52990583'}, {'basic_cnpj': '28514824'}, {'basic_cnpj': '16829808'}, {'basic_cnpj': '40826966'}, {'basic_cnpj': '24211544'}, {'basic_cnpj': '46864902'}, {'basic_cnpj': '67432922'}, {'basic_cnpj': '36455880'}, {'basic_cnpj': '47903424'}, {'basic_cnpj': '52815153'}, {'basic_cnpj': '46975841'}, {'basic_cnpj': '53629273'}, {'basic_cnpj': '18204067'}, {'basic_cnpj': '26520170'}, {'basic_cnpj': '53335439'}, {'basic_cnpj': '44954562'}, {'basic_cnpj': '11223841'}, {'basic_cnpj': '51923154'}, {'basic_cnpj': '2603988'}, {'basic_cnpj': '42453948'}, {'basic_cnpj': '20712383'}, {'basic_cnpj': '36593521'}, {'basic_cnpj': '35420243'}, {'basic_cnpj': '52360943'}, {'basic_cnpj': '9171343'}, {'basic_cnpj': '26473427'}, {'basic_cnpj': '35312114'}, {'basic_cnpj': '22376177'}, {'basic_cnpj': '53273882'}, {'basic_cnpj': '47583362'}, {'basic_cnpj': '49499418'}, {'basic_cnpj': '43087565'}, {'basic_cnpj': '49154597'}, {'basic_cnpj': '35204813'}, {'basic_cnpj': '44005889'}, {'basic_cnpj': '31106624'}, {'basic_cnpj': '46010232'}, {'basic_cnpj': '15059552'}, {'basic_cnpj': '17536052'}, {'basic_cnpj': '28419404'}, {'basic_cnpj': '19014794'}, {'basic_cnpj': '20040087'}, {'basic_cnpj': '8061508'}, {'basic_cnpj': '24188034'}, {'basic_cnpj': '27818508'}, {'basic_cnpj': '22732807'}, {'basic_cnpj': '24846982'}, {'basic_cnpj': '53105325'}, {'basic_cnpj': '48200834'}, {'basic_cnpj': '9199281'}, {'basic_cnpj': '52561807'}, {'basic_cnpj': '29613998'}, {'basic_cnpj': '33332249'}, {'basic_cnpj': '34302072'}, {'basic_cnpj': '12984657'}, {'basic_cnpj': '30211330'}, {'basic_cnpj': '34247206'}, {'basic_cnpj': '9299388'}, {'basic_cnpj': '22457312'}, {'basic_cnpj': '30182338'}, {'basic_cnpj': '39310971'}, {'basic_cnpj': '31688892'}, {'basic_cnpj': '34920935'}, {'basic_cnpj': '26585719'}, {'basic_cnpj': '39923762'}, {'basic_cnpj': '11566671'}, {'basic_cnpj': '28697106'}, {'basic_cnpj': '47927484'}, {'basic_cnpj': '51691559'}, {'basic_cnpj': '8338189'}, {'basic_cnpj': '159552'}, {'basic_cnpj': '36313597'}, {'basic_cnpj': '39695450'}, {'basic_cnpj': '16594030'}, {'basic_cnpj': '20794017'}, {'basic_cnpj': '49078737'}, {'basic_cnpj': '28406779'}, {'basic_cnpj': '47711995'}, {'basic_cnpj': '21256923'}, {'basic_cnpj': '24094921'}, {'basic_cnpj': '29348578'}, {'basic_cnpj': '13681913'}, {'basic_cnpj': '12024813'}, {'basic_cnpj': '37415962'}, {'basic_cnpj': '36377403'}, {'basic_cnpj': '28924171'}, {'basic_cnpj': '33414207'}, {'basic_cnpj': '47016404'}, {'basic_cnpj': '23950945'}, {'basic_cnpj': '41861201'}, {'basic_cnpj': '20393603'}, {'basic_cnpj': '34643683'}, {'basic_cnpj': '39659612'}, {'basic_cnpj': '38905256'}, {'basic_cnpj': '52934321'}, {'basic_cnpj': '51557465'}, {'basic_cnpj': '19352019'}, {'basic_cnpj': '14257610'}, {'basic_cnpj': '9150937'}, {'basic_cnpj': '32437490'}, {'basic_cnpj': '22082229'}, {'basic_cnpj': '38036486'}, {'basic_cnpj': '38121199'}, {'basic_cnpj': '10844570'}, {'basic_cnpj': '50862451'}, {'basic_cnpj': '15109320'}, {'basic_cnpj': '37110042'}, {'basic_cnpj': '12883300'}, {'basic_cnpj': '47710555'}, {'basic_cnpj': '26415419'}, {'basic_cnpj': '45891675'}, {'basic_cnpj': '28031483'}, {'basic_cnpj': '19282218'}, {'basic_cnpj': '51818313'}, {'basic_cnpj': '13114540'}, {'basic_cnpj': '45952772'}, {'basic_cnpj': '25999807'}, {'basic_cnpj': '24178895'}, {'basic_cnpj': '53590414'}, {'basic_cnpj': '51580582'}, {'basic_cnpj': '49445460'}, {'basic_cnpj': '24811195'}, {'basic_cnpj': '24468983'}, {'basic_cnpj': '19099618'}, {'basic_cnpj': '11689975'}, {'basic_cnpj': '21833329'}, {'basic_cnpj': '32794473'}, {'basic_cnpj': '28754421'}, {'basic_cnpj': '13789035'}, {'basic_cnpj': '33261377'}, {'basic_cnpj': '32247800'}, {'basic_cnpj': '15496662'}, {'basic_cnpj': '3334849'}, {'basic_cnpj': '48712597'}, {'basic_cnpj': '49698116'}, {'basic_cnpj': '39153595'}, {'basic_cnpj': '12057515'}, {'basic_cnpj': '41388772'}, {'basic_cnpj': '26689070'}, {'basic_cnpj': '42229185'}, {'basic_cnpj': '12336792'}, {'basic_cnpj': '36985688'}, {'basic_cnpj': '33298736'}, {'basic_cnpj': '34074893'}, {'basic_cnpj': '44877851'}, {'basic_cnpj': '40520646'}, {'basic_cnpj': '31065242'}, {'basic_cnpj': '52014517'}, {'basic_cnpj': '49514059'}, {'basic_cnpj': '43555482'}, {'basic_cnpj': '28373289'}, {'basic_cnpj': '6073319'}, {'basic_cnpj': '51204512'}, {'basic_cnpj': '36318024'}, {'basic_cnpj': '18908726'}, {'basic_cnpj': '17996112'}, {'basic_cnpj': '25131250'}, {'basic_cnpj': '48141242'}, {'basic_cnpj': '25227025'}, {'basic_cnpj': '27303300'}, {'basic_cnpj': '29349938'}, {'basic_cnpj': '51708722'}, {'basic_cnpj': '34534611'}, {'basic_cnpj': '8881191'}, {'basic_cnpj': '45532373'}, {'basic_cnpj': '31834809'}, {'basic_cnpj': '30712140'}, {'basic_cnpj': '33653659'}, {'basic_cnpj': '42932803'}, {'basic_cnpj': '26168143'}, {'basic_cnpj': '23649447'}, {'basic_cnpj': '45192203'}, {'basic_cnpj': '8981141'}, {'basic_cnpj': '11342170'}, {'basic_cnpj': '17285656'}, {'basic_cnpj': '14725752'}, {'basic_cnpj': '10520749'}, {'basic_cnpj': '5858263'}, {'basic_cnpj': '34316442'}, {'basic_cnpj': '52529931'}, {'basic_cnpj': '35397509'}, {'basic_cnpj': '32528080'}, {'basic_cnpj': '43162711'}, {'basic_cnpj': '39765973'}, {'basic_cnpj': '53412154'}, {'basic_cnpj': '43405314'}, {'basic_cnpj': '21527542'}, {'basic_cnpj': '52245763'}, {'basic_cnpj': '50419304'}, {'basic_cnpj': '53593426'}, {'basic_cnpj': '46044810'}, {'basic_cnpj': '50324793'}, {'basic_cnpj': '44288937'}, {'basic_cnpj': '27141190'}, {'basic_cnpj': '24169612'}, {'basic_cnpj': '25001136'}, {'basic_cnpj': '52927313'}, {'basic_cnpj': '47226325'}, {'basic_cnpj': '31049218'}, {'basic_cnpj': '28508985'}, {'basic_cnpj': '51376506'}, {'basic_cnpj': '52785325'}, {'basic_cnpj': '19564761'}, {'basic_cnpj': '28973286'}, {'basic_cnpj': '53178084'}, {'basic_cnpj': '21759612'}, {'basic_cnpj': '48571209'}, {'basic_cnpj': '17880243'}, {'basic_cnpj': '26727240'}, {'basic_cnpj': '51226136'}, {'basic_cnpj': '10014638'}, {'basic_cnpj': '39379528'}, {'basic_cnpj': '34394330'}, {'basic_cnpj': '46116235'}, {'basic_cnpj': '53132174'}, {'basic_cnpj': '19704632'}, {'basic_cnpj': '17189349'}, {'basic_cnpj': '7563724'}, {'basic_cnpj': '44576640'}, {'basic_cnpj': '35702390'}, {'basic_cnpj': '28690797'}, {'basic_cnpj': '21331910'}, {'basic_cnpj': '38078400'}, {'basic_cnpj': '44624080'}, {'basic_cnpj': '46322769'}, {'basic_cnpj': '48264132'}, {'basic_cnpj': '34831926'}, {'basic_cnpj': '11659816'}, {'basic_cnpj': '19589950'}, {'basic_cnpj': '40506020'}, {'basic_cnpj': '47900300'}, {'basic_cnpj': '27879837'}, {'basic_cnpj': '20483175'}, {'basic_cnpj': '41001831'}, {'basic_cnpj': '35817601'}, {'basic_cnpj': '31010779'}, {'basic_cnpj': '23289306'}, {'basic_cnpj': '50860480'}, {'basic_cnpj': '51538765'}, {'basic_cnpj': '42114190'}, {'basic_cnpj': '56269798'}, {'basic_cnpj': '44855306'}, {'basic_cnpj': '29326198'}, {'basic_cnpj': '26267032'}, {'basic_cnpj': '30954435'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] | [QUESTION]What is the maximum and minimum market value of companies?[/QUESTION]
[SQL]SELECT max(Market_Value_in_Billion) , min(Market_Value_in_Billion) FROM company[/SQL] |
18 | What is the firts start activity date for establishments that contain 'Y' in their name? | SELECT MIN(start_activity_date) FROM establishment WHERE name LIKE '%Y%'; | Easy | [{'MIN(start_activity_date)': '1980-03-21'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]What are the names of shops in ascending order of open year?[/QUESTION]
[SQL]SELECT Shop_Name FROM shop ORDER BY Open_Year ASC[/SQL] | [QUESTION]What are the names of shops in ascending order of open year?[/QUESTION]
[SQL]SELECT Shop_Name FROM shop ORDER BY Open_Year ASC[/SQL] |
19 | What is the codes of the economic activities that contain 'Z' in their name? | SELECT economic_activity_code FROM economic_activity WHERE economic_activity_name LIKE '%Z%'; | Easy | [{'economic_activity_code': 5611205}, {'economic_activity_code': 9329899}, {'economic_activity_code': 111301}, {'economic_activity_code': 899102}, {'economic_activity_code': 6492100}, {'economic_activity_code': 4756300}, {'economic_activity_code': 2449101}, {'economic_activity_code': 9412000}, {'economic_activity_code': 1340501}, {'economic_activity_code': 4211102}, {'economic_activity_code': 1061901}, {'economic_activity_code': 2062200}, {'economic_activity_code': 4649409}, {'economic_activity_code': 2012600}, {'economic_activity_code': 9609208}, {'economic_activity_code': 5211701}, {'economic_activity_code': 8230001}, {'economic_activity_code': 2342702}, {'economic_activity_code': 9529104}, {'economic_activity_code': 4713002}, {'economic_activity_code': 4752100}, {'economic_activity_code': 4683400}, {'economic_activity_code': 729404}, {'economic_activity_code': 161001}, {'economic_activity_code': 6202300}, {'economic_activity_code': 4689399}, {'economic_activity_code': 4679601}, {'economic_activity_code': 3317102}, {'economic_activity_code': 2013400}, {'economic_activity_code': 8640205}, {'economic_activity_code': 8640207}, {'economic_activity_code': 2342701}, {'economic_activity_code': 9103100}, {'economic_activity_code': 2790202}, {'economic_activity_code': 4213800}, {'economic_activity_code': 9001906}, {'economic_activity_code': 4618499}, {'economic_activity_code': 2071100}, {'economic_activity_code': 2592602}, {'economic_activity_code': 4929904}, {'economic_activity_code': 2592601}, {'economic_activity_code': 9493600}, {'economic_activity_code': 4729699}, {'economic_activity_code': 8219999}, {'economic_activity_code': 4619200}, {'economic_activity_code': 1061902}, {'economic_activity_code': 1422300}, {'economic_activity_code': 9200399}, {'economic_activity_code': 891600}, {'economic_activity_code': 4329104}, {'economic_activity_code': 9602502}, {'economic_activity_code': 6190602}, {'economic_activity_code': 4681802}, {'economic_activity_code': 1093702}, {'economic_activity_code': 4633801}, {'economic_activity_code': 4712100}, {'economic_activity_code': 8630501}, {'economic_activity_code': 8121400}, {'economic_activity_code': 9412001}, {'economic_activity_code': 4751200}, {'economic_activity_code': 4311802}, {'economic_activity_code': 9491000}, {'economic_activity_code': 2073800}, {'economic_activity_code': 8129000}, {'economic_activity_code': 4649408}, {'economic_activity_code': 3314701}, {'economic_activity_code': 9420100}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | ||
20 | Display the names of cities with codes with codes less than 10 | SELECT city_name FROM city WHERE city_code < 10; | Easy | [{'city_name': 'JI-PARANA'}, {'city_name': 'BURITIS'}, {'city_name': 'CUJUBIM'}, {'city_name': 'PORTO VELHO'}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
) |
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/ | [QUESTION]Find the state and country of all cities with post code starting with 4.[/QUESTION]
[SQL]SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE "4%"[/SQL] | [QUESTION]Find the state and country of all cities with post code starting with 4.[/QUESTION]
[SQL]SELECT state_province_county , country FROM addresses WHERE zip_postcode LIKE "4%"[/SQL] |
21 | List all unique primary economic activities codes of establishments in 'SP' state | SELECT DISTINCT primary_economic_activity_code FROM establishment WHERE state = 'SP'; | Easy | [{'primary_economic_activity_code': 7112000}, {'primary_economic_activity_code': 8650006}, {'primary_economic_activity_code': 5813100}, {'primary_economic_activity_code': 9602501}, {'primary_economic_activity_code': 4330499}, {'primary_economic_activity_code': 4399103}, {'primary_economic_activity_code': 7420003}, {'primary_economic_activity_code': 6920601}, {'primary_economic_activity_code': 8299707}, {'primary_economic_activity_code': 4789001}, {'primary_economic_activity_code': 121101}, {'primary_economic_activity_code': 4759801}, {'primary_economic_activity_code': 5611203}, {'primary_economic_activity_code': 9700500}, {'primary_economic_activity_code': 9312300}, {'primary_economic_activity_code': 5223100}, {'primary_economic_activity_code': 210101}, {'primary_economic_activity_code': 9602502}, {'primary_economic_activity_code': 4712100}, {'primary_economic_activity_code': 4751201}, {'primary_economic_activity_code': 4321500}, {'primary_economic_activity_code': 8888888}, {'primary_economic_activity_code': 8599699}, {'primary_economic_activity_code': 5250803}, {'primary_economic_activity_code': 4771701}, {'primary_economic_activity_code': 4781400}, {'primary_economic_activity_code': 4729699}, {'primary_economic_activity_code': 2593400}, {'primary_economic_activity_code': 3101200}, {'primary_economic_activity_code': 4520005}, {'primary_economic_activity_code': 6470101}, {'primary_economic_activity_code': 8219999}, {'primary_economic_activity_code': 4649408}, {'primary_economic_activity_code': 113000}, {'primary_economic_activity_code': 4722901}, {'primary_economic_activity_code': 9492800}, {'primary_economic_activity_code': 4924800}, {'primary_economic_activity_code': 7319002}, {'primary_economic_activity_code': 4724500}, {'primary_economic_activity_code': 8630503}, {'primary_economic_activity_code': 1091101}, {'primary_economic_activity_code': 5612100}, {'primary_economic_activity_code': 4616800}, {'primary_economic_activity_code': 4772500}, {'primary_economic_activity_code': 4511103}, {'primary_economic_activity_code': 2814301}, {'primary_economic_activity_code': 4743100}, {'primary_economic_activity_code': 9001901}, {'primary_economic_activity_code': 6432800}, {'primary_economic_activity_code': 8211300}, {'primary_economic_activity_code': 4723700}, {'primary_economic_activity_code': 8599605}, {'primary_economic_activity_code': 8650003}, {'primary_economic_activity_code': 4221905}, {'primary_economic_activity_code': 5819100}, {'primary_economic_activity_code': 8720499}, {'primary_economic_activity_code': 8230001}, {'primary_economic_activity_code': 6821801}, {'primary_economic_activity_code': 8650004}, {'primary_economic_activity_code': 131800}, {'primary_economic_activity_code': 8030700}, {'primary_economic_activity_code': 8299799}, {'primary_economic_activity_code': 4783102}, {'primary_economic_activity_code': 9313100}, {'primary_economic_activity_code': 9430800}, {'primary_economic_activity_code': 1412601}, {'primary_economic_activity_code': 5620104}, {'primary_economic_activity_code': 9521500}, {'primary_economic_activity_code': 4774100}, {'primary_economic_activity_code': 9511800}, {'primary_economic_activity_code': 5620101}, {'primary_economic_activity_code': 1340599}, {'primary_economic_activity_code': 4110700}, {'primary_economic_activity_code': 4789004}, {'primary_economic_activity_code': 3292202}, {'primary_economic_activity_code': 2539001}, {'primary_economic_activity_code': 6499901}, {'primary_economic_activity_code': 8599604}, {'primary_economic_activity_code': 4713004}, {'primary_economic_activity_code': 139306}, {'primary_economic_activity_code': 7119704}, {'primary_economic_activity_code': 7490104}, {'primary_economic_activity_code': 5510802}, {'primary_economic_activity_code': 133404}, {'primary_economic_activity_code': 7810800}, {'primary_economic_activity_code': 8630504}, {'primary_economic_activity_code': 4763603}, {'primary_economic_activity_code': 8112500}, {'primary_economic_activity_code': 4633801}, {'primary_economic_activity_code': 4530701}, {'primary_economic_activity_code': 4729601}, {'primary_economic_activity_code': 4530703}, {'primary_economic_activity_code': 4639701}, {'primary_economic_activity_code': 2815102}, {'primary_economic_activity_code': 4930201}, {'primary_economic_activity_code': 3314799}, {'primary_economic_activity_code': 4755503}, {'primary_economic_activity_code': 4672900}, {'primary_economic_activity_code': 6499999}, {'primary_economic_activity_code': 1352900}, {'primary_economic_activity_code': 4742300}, {'primary_economic_activity_code': 6204000}, {'primary_economic_activity_code': 7722500}, {'primary_economic_activity_code': 1422300}, {'primary_economic_activity_code': 5611201}, {'primary_economic_activity_code': 4923001}, {'primary_economic_activity_code': 4759899}, {'primary_economic_activity_code': 4689399}, {'primary_economic_activity_code': 6619399}, {'primary_economic_activity_code': 4782201}, {'primary_economic_activity_code': 111302}, {'primary_economic_activity_code': 7111100}, {'primary_economic_activity_code': 4721103}, {'primary_economic_activity_code': 1053800}, {'primary_economic_activity_code': 5229099}, {'primary_economic_activity_code': 4785799}, {'primary_economic_activity_code': 7490199}, {'primary_economic_activity_code': 5212500}, {'primary_economic_activity_code': 8121400}, {'primary_economic_activity_code': 4752100}, {'primary_economic_activity_code': 5611204}, {'primary_economic_activity_code': 2543800}, {'primary_economic_activity_code': 4330404}, {'primary_economic_activity_code': 4783101}, {'primary_economic_activity_code': 4689302}, {'primary_economic_activity_code': 4663000}, {'primary_economic_activity_code': 4711301}, {'primary_economic_activity_code': 312401}, {'primary_economic_activity_code': 4754701}, {'primary_economic_activity_code': 1412602}, {'primary_economic_activity_code': 9529102}, {'primary_economic_activity_code': 5912099}, {'primary_economic_activity_code': 4930202}, {'primary_economic_activity_code': 6462000}, {'primary_economic_activity_code': 134200}, {'primary_economic_activity_code': 4322302}, {'primary_economic_activity_code': 4789099}, {'primary_economic_activity_code': 4520006}, {'primary_economic_activity_code': 4322301}, {'primary_economic_activity_code': 4784900}, {'primary_economic_activity_code': 4646001}, {'primary_economic_activity_code': 8130300}, {'primary_economic_activity_code': 6470102}, {'primary_economic_activity_code': 151201}, {'primary_economic_activity_code': 5320202}, {'primary_economic_activity_code': 4399101}, {'primary_economic_activity_code': 4520001}, {'primary_economic_activity_code': 4741500}, {'primary_economic_activity_code': 6209100}] |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
) |
CREATE TABLE age_range (
age_range_code INTEGER,
age_range_description TEXT,
PRIMARY KEY (age_range_code)
)
/*
2 rows from age_range table:
age_range_code age_range_description
1 0 a 12 anos
2 13 a 20 anos
*/
CREATE TABLE city (
city_name TEXT,
city_code INTEGER
)
/*
2 rows from city table:
city_name city_code
CAARAPO 9055
UMBUZEIRO 2241
*/
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE company_size (
company_size_code INTEGER,
company_size_description TEXT,
PRIMARY KEY (company_size_code)
)
/*
2 rows from company_size table:
company_size_code company_size_description
0 NÃO INFORMADO
1 MICRO EMPRESA
*/
CREATE TABLE country (
country_name TEXT,
country_code INTEGER
)
/*
2 rows from country table:
country_name country_code
NOVA ZELANDIA 548
OMA 556
*/
CREATE TABLE economic_activity (
economic_activity_name TEXT,
economic_activity_code INTEGER
)
/*
2 rows from economic_activity table:
economic_activity_name economic_activity_code
Fabricação de fios, cabos e condutores elétricos isolados 2733300
Fabricação de bijuterias e artefatos semelhantes 3212400
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE partner (
basic_cnpj TEXT,
partner_type_code INTEGER,
partner_age_range_code INTEGER
)
/*
2 rows from partner table:
basic_cnpj partner_type_code partner_age_range_code
43400143 2 7
22954290 2 4
*/
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
)
/*
2 rows from partner_type table:
partner_type_code partner_type_description
1 PESSOA JURÍDICA
2 PESSOA FÍSICA
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/
CREATE TABLE taxation (
basic_cnpj TEXT,
option_for_simples_taxation CHAR,
simples_taxation_option_date DATE,
simples_taxation_exclusion_date DATE,
option_for_mei_taxation CHAR,
mei_taxation_option_date DATE,
mei_taxation_exclusion_date DATE
)
/*
2 rows from taxation table:
basic_cnpj option_for_simples_taxation simples_taxation_option_date simples_taxation_exclusion_date option_for_mei_taxation mei_taxation_option_date mei_taxation_exclusion_date
51578629 S 2023-07-27 None N None None
53144319 S 2023-12-08 None S 2023-12-08 None
*/ |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
CREATE TABLE partner_type (
partner_type_code INTEGER,
partner_type_description TEXT,
PRIMARY KEY (partner_type_code)
) |
CREATE TABLE company (
name TEXT,
basic_cnpj TEXT,
capital DOUBLE,
company_size_code INTEGER
)
/*
2 rows from company table:
name basic_cnpj capital company_size_code
RAIMUNDO NONATO CARDOSO 48031968187 15605651 1000.0 1
ROSILENE PEDRO DE SOUZA 04320775619 13003307 1.0 1
*/
CREATE TABLE establishment (
basic_cnpj TEXT,
order_cnpj TEXT,
main_or_branch TEXT,
name TEXT,
secondary_economic_activity_code TEXT,
state TEXT,
registration_status_code INTEGER,
country_code INTEGER,
city_code INTEGER,
start_activity_date DATE,
primary_economic_activity_code INTEGER
)
/*
2 rows from establishment table:
basic_cnpj order_cnpj main_or_branch name secondary_economic_activity_code state registration_status_code country_code city_code start_activity_date primary_economic_activity_code
40515767 0001 Main None 4623106,4623108,4635403 BA 2 None 3279 2021-01-22 4639701
40010763 0001 Main None None GO 4 None 9373 2020-12-03 5612100
*/
CREATE TABLE registration_status (
registration_status_code INTEGER,
registration_status_description TEXT,
PRIMARY KEY (registration_status_code)
)
/*
2 rows from registration_status table:
registration_status_code registration_status_description
1 NULA
2 ATIVA
*/ |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 34