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_compComExInfoChaves
stringclasses
1 value
schema_redComEx
stringclasses
10 values
schema_redComExInfoChaves
stringclasses
10 values
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, 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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
22
Calculate the average capital of companies
SELECT AVG(capital) FROM company;
Easy
[{'AVG(capital)': 87806.087}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
23
Calculate the average capital in the 'company' table.
SELECT AVG(capital) FROM company;
Easy
[{'AVG(capital)': 87806.087}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
24
How many companies are registered
SELECT COUNT(*) FROM company;
Easy
[{'COUNT(*)': 1000}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
25
What are the description of the types of partners registered?
SELECT partner_type_description FROM partner_type;
Easy
[{'partner_type_description': 'PESSOA JURÍDICA'}, {'partner_type_description': 'PESSOA FÍSICA'}, {'partner_type_description': 'ESTRANGEIRO'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
26
How many companies have a capital greater than 1 million?
SELECT COUNT(*) FROM company WHERE capital > 1000000;
Easy
[{'COUNT(*)': 8}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
27
List the basic cnpj of the companies that have a capital greater than 1 million reais?
SELECT basic_cnpj FROM company WHERE capital > 1000000;
Easy
[{'basic_cnpj': '38252387'}, {'basic_cnpj': '9634476'}, {'basic_cnpj': '39881324'}, {'basic_cnpj': '31635668'}, {'basic_cnpj': '46670546'}, {'basic_cnpj': '40392706'}, {'basic_cnpj': '45364480'}, {'basic_cnpj': '9117176'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
28
What is the description of the age range with code equal to 5?
SELECT age_range_description FROM age_range WHERE age_range_code = 5;
Easy
[{'age_range_description': '41 a 50 anos'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
29
How many establishments have any secondary economic activity registered?
SELECT COUNT(*) FROM establishment WHERE secondary_economic_activity_code IS NOT NULL;
Easy
[{'COUNT(*)': 440}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
30
How many 'Main' establishments?
SELECT COUNT(*) FROM establishment WHERE main_or_branch = 'Main';
Easy
[{'COUNT(*)': 946}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
31
What is the maximum capital of a company?
SELECT MAX(capital) FROM company;
Easy
[{'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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
32
What is the min date an establishment stated activity?
SELECT MIN(start_activity_date) FROM establishment;
Easy
[{'MIN(start_activity_date)': '1966-06-30'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
33
What is the earliest start activity date of a establishment?
SELECT MIN(start_activity_date) FROM establishment;
Easy
[{'MIN(start_activity_date)': '1966-06-30'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
34
What are the age ranges description and their respective codes?
SELECT age_range_description, age_range_code FROM age_range;
Easy
[{'age_range_description': '0 a 12 anos', 'age_range_code': 1}, {'age_range_description': '13 a 20 anos', 'age_range_code': 2}, {'age_range_description': '21 a 30 anos', 'age_range_code': 3}, {'age_range_description': '31 a 40 anos', 'age_range_code': 4}, {'age_range_description': '41 a 50 anos', 'age_range_code': 5}, {'age_range_description': '51 a 60 anos', 'age_range_code': 6}, {'age_range_description': '61 a 70 anos', 'age_range_code': 7}, {'age_range_description': '71 a 80 anos', 'age_range_code': 8}, {'age_range_description': 'Maiores de 80 anos', 'age_range_code': 9}, {'age_range_description': 'Não se aplica', 'age_range_code': 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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
35
List the the country names and their respective codes?
SELECT country_name, country_code FROM country;
Easy
[{'country_name': 'NOVA ZELANDIA', 'country_code': 548}, {'country_name': 'OMA', 'country_code': 556}, {'country_name': 'GEORGIA, REPUBLICA DA', 'country_code': 291}, {'country_name': 'GRANADA', 'country_code': 297}, {'country_name': 'ALBORAN-PEREJIL,ILHAS', 'country_code': 20}, {'country_name': 'Bahrein, Ilhas', 'country_code': 80}, {'country_name': 'EMIRADOS ARABES UNIDOS', 'country_code': 244}, {'country_name': 'GUADALUPE', 'country_code': 309}, {'country_name': 'FIJI', 'country_code': 870}, {'country_name': 'VIETNAME DO NORTE', 'country_code': 855}, {'country_name': 'BRASIL (AFRETAMENTO)', 'country_code': 106}, {'country_name': 'HUNGRIA', 'country_code': 355}, {'country_name': 'BURUNDI', 'country_code': 115}, {'country_name': 'CANADA', 'country_code': 149}, {'country_name': 'WALLIS E FUTURNA, ILHAS', 'country_code': 875}, {'country_name': 'CATAR', 'country_code': 154}, {'country_name': 'MALI', 'country_code': 464}, {'country_name': 'SAO TOME E PRINCIPE', 'country_code': 720}, {'country_name': 'NAO DECLARADO PRELIMINAR', 'country_code': 998}, {'country_name': 'GUAM', 'country_code': 313}, {'country_name': 'REUNIAO', 'country_code': 660}, {'country_name': 'EL SALVADOR', 'country_code': 687}, {'country_name': 'JORDANIA', 'country_code': 403}, {'country_name': 'FORMOSA (PROVINCIA DA CHINA)', 'country_code': 161}, {'country_name': 'REINO UNIDO', 'country_code': 628}, {'country_name': 'PROV. DE NAVIOS E AERONAVES', 'country_code': 990}, {'country_name': 'PORTUGAL', 'country_code': 607}, {'country_name': 'NAO DECLARADOS', 'country_code': 997}, {'country_name': 'ANDORRA', 'country_code': 37}, {'country_name': 'ARGELIA', 'country_code': 59}, {'country_name': 'CAMAROES', 'country_code': 145}, {'country_name': 'MARSHALL, ILHA', 'country_code': 476}, {'country_name': 'COCOS (KEELING),ILHAS', 'country_code': 165}, {'country_name': 'Pacífico, Ilhas do', 'country_code': 566}, {'country_name': 'TUNISIA', 'country_code': 820}, {'country_name': 'SENEGAL', 'country_code': 728}, {'country_name': 'ZONA DO CANAL DO PANAMA', 'country_code': 895}, {'country_name': 'QUIRGUIZIA, REPUBLICA DA', 'country_code': 625}, {'country_name': 'SEYCHELLES', 'country_code': 731}, {'country_name': 'COMORES, ILHAS', 'country_code': 173}, {'country_name': 'SUICA', 'country_code': 767}, {'country_name': 'NIUE', 'country_code': 531}, {'country_name': 'PORTO RICO', 'country_code': 611}, {'country_name': 'CINGAPURA', 'country_code': 741}, {'country_name': 'Mianmar (Birmânia)', 'country_code': 93}, {'country_name': 'ITALIA', 'country_code': 386}, {'country_name': 'BIELO-RUSSIA (BELARUS) REP. DA', 'country_code': 85}, {'country_name': 'LEBUAN(ILHA)', 'country_code': 423}, {'country_name': 'U.R.S.S.', 'country_code': 840}, {'country_name': 'SERRA LEOA', 'country_code': 735}, {'country_name': 'SUDAO', 'country_code': 759}, {'country_name': 'ESTONIA, REPUBLICA DA', 'country_code': 251}, {'country_name': 'FEROE, ILHAS', 'country_code': 259}, {'country_name': 'TANZANIA', 'country_code': 780}, {'country_name': 'PANAMA', 'country_code': 580}, {'country_name': 'BELISE', 'country_code': 88}, {'country_name': 'BELGICA', 'country_code': 87}, {'country_name': 'ANGUILLA', 'country_code': 41}, {'country_name': 'MICRONESIA, EST.FED.DA', 'country_code': 499}, {'country_name': 'China, República Popular', 'country_code': 160}, {'country_name': 'ALEMANHA', 'country_code': 23}, {'country_name': 'CASAQUISTAO, REPUBLICA DO', 'country_code': 153}, {'country_name': 'NORUEGA', 'country_code': 538}, {'country_name': 'TOGO', 'country_code': 800}, {'country_name': 'MAURICIO', 'country_code': 485}, {'country_name': 'LIBERIA', 'country_code': 434}, {'country_name': 'BERMUDAS', 'country_code': 90}, {'country_name': 'Países Baixos (Holanda)', 'country_code': 573}, {'country_name': 'POLINESIA FRANCESA', 'country_code': 599}, {'country_name': 'BRUNEI', 'country_code': 108}, {'country_name': 'SAMOA', 'country_code': 690}, {'country_name': 'COLIS POSTAUX', 'country_code': 0}, {'country_name': 'GANA', 'country_code': 289}, {'country_name': 'SALOMAO, ILHAS', 'country_code': 677}, {'country_name': 'CONGO', 'country_code': 177}, {'country_name': 'MOCAMBIQUE', 'country_code': 505}, {'country_name': 'GIBRALTAR', 'country_code': 293}, {'country_name': 'Território Britânico no Oceano Índico', 'country_code': 782}, {'country_name': 'LIBIA', 'country_code': 438}, {'country_name': 'SANTA HELENA', 'country_code': 710}, {'country_name': 'SAO PEDRO E MIQUELLON', 'country_code': 700}, {'country_name': 'AFRICA DO SUL', 'country_code': 756}, {'country_name': 'ESLOVENIA, REPUBLICA DA', 'country_code': 246}, {'country_name': 'FRANCA', 'country_code': 275}, {'country_name': 'IRLANDA', 'country_code': 375}, {'country_name': 'NIGERIA', 'country_code': 528}, {'country_name': 'Pacífico, Ilhas do (Administ.dos Eua)', 'country_code': 563}, {'country_name': 'SAO CRISTOVAO E NEVES', 'country_code': 695}, {'country_name': 'Christmas,Ilhas (Navidad)', 'country_code': 511}, {'country_name': 'TCHECOSLOVAQUIA', 'country_code': 790}, {'country_name': 'BARBADOS', 'country_code': 83}, {'country_name': 'CHILE', 'country_code': 158}, {'country_name': 'PALAU, REPUBLICA DO', 'country_code': 575}, {'country_name': 'CACHEMIRA', 'country_code': 131}, {'country_name': 'TOQUELAU', 'country_code': 805}, {'country_name': 'NOVA CALEDONIA', 'country_code': 542}, {'country_name': 'TURQUIA', 'country_code': 827}, {'country_name': 'IEMEN, REPUBLICA DO', 'country_code': 357}, {'country_name': 'LAOS, REP. POP. E DEMOCR. DO', 'country_code': 420}, {'country_name': 'REPUBLICA DOMINICANA', 'country_code': 647}, {'country_name': 'LIECHTENSTEIN', 'country_code': 440}, {'country_name': 'PAPUA, TERRITORIO DE', 'country_code': 583}, {'country_name': 'COSTA DO MARFIM', 'country_code': 193}, {'country_name': 'RUANDA', 'country_code': 675}, {'country_name': 'PERU', 'country_code': 589}, {'country_name': 'IRAQUE', 'country_code': 369}, {'country_name': 'ARGENTINA', 'country_code': 63}, {'country_name': 'MARIANAS DO NORTE', 'country_code': 472}, {'country_name': 'TERR. ALTA COMISS. PAC. OCEAN.', 'country_code': 785}, {'country_name': 'TIMOR ORIENTAL', 'country_code': 795}, {'country_name': 'TADJIQUISTAO, REPUBLICA DO', 'country_code': 772}, {'country_name': 'SAN MARINO', 'country_code': 697}, {'country_name': 'ALBANIA', 'country_code': 17}, {'country_name': 'SOMALIA', 'country_code': 748}, {'country_name': 'COVEITE', 'country_code': 198}, {'country_name': 'ESLOVACA, REPUBLICA', 'country_code': 247}, {'country_name': 'GUINE BISSAU', 'country_code': 334}, {'country_name': 'ESPANHA', 'country_code': 245}, {'country_name': 'ANTIGUA E BARBUDA', 'country_code': 43}, {'country_name': 'Turcomenistão, República do', 'country_code': 824}, {'country_name': 'MONSERRAT', 'country_code': 501}, {'country_name': 'GRECIA', 'country_code': 301}, {'country_name': 'ARUBA', 'country_code': 65}, {'country_name': 'POLONIA', 'country_code': 603}, {'country_name': 'ANTILHAS HOLANDESAS', 'country_code': 47}, {'country_name': 'MEXICO', 'country_code': 493}, {'country_name': 'VIETNA', 'country_code': 858}, {'country_name': 'MARTINICA', 'country_code': 477}, {'country_name': 'RUSSIA, FEDERACAO DA', 'country_code': 676}, {'country_name': 'ETIOPIA', 'country_code': 253}, {'country_name': 'Cabo Verde,República de', 'country_code': 127}, {'country_name': 'COSTA RICA', 'country_code': 196}, {'country_name': 'JAPAO', 'country_code': 399}, {'country_name': 'HONG-KONG', 'country_code': 351}, {'country_name': 'QUENIA', 'country_code': 623}, {'country_name': 'DUBAI', 'country_code': 237}, {'country_name': 'VIRGENS, ILHAS (BRITANICAS)', 'country_code': 863}, {'country_name': 'ALEMANHA, REP. DEMOCRATICA DA', 'country_code': 25}, {'country_name': 'MONGOLIA', 'country_code': 497}, {'country_name': 'LIBANO', 'country_code': 431}, {'country_name': 'DOMINICA', 'country_code': 235}, {'country_name': 'AFEGANISTAO', 'country_code': 13}, {'country_name': 'CAMBOJA', 'country_code': 141}, {'country_name': 'BUTAO', 'country_code': 119}, {'country_name': 'COREIA REPUBLICA DA', 'country_code': 190}, {'country_name': 'ARMENIA, REPUBLICA DA', 'country_code': 64}, {'country_name': 'SIKKIM', 'country_code': 738}, {'country_name': 'CHIPRE', 'country_code': 163}, {'country_name': 'THECA, REPUBLICA', 'country_code': 791}, {'country_name': 'NIGER', 'country_code': 525}, {'country_name': 'SAO VICENTE E GRANADINAS', 'country_code': 705}, {'country_name': 'KIRIBATI', 'country_code': 411}, {'country_name': 'SANTA LUCIA', 'country_code': 715}, {'country_name': 'NEPAL', 'country_code': 517}, {'country_name': 'DINAMARCA', 'country_code': 232}, {'country_name': 'MACAU', 'country_code': 447}, {'country_name': 'VIRGENS, ILHAS (EUA)', 'country_code': 866}, {'country_name': 'MALTA', 'country_code': 467}, {'country_name': 'REPUBLICA CENTRO AFRICANA', 'country_code': 640}, {'country_name': 'TONGA', 'country_code': 810}, {'country_name': 'Bosnia-Herzegovina (Republica da)', 'country_code': 98}, {'country_name': 'FALKLAND (ILHAS MALVINAS)', 'country_code': 255}, {'country_name': 'ZAMBIA', 'country_code': 890}, {'country_name': 'SUECIA', 'country_code': 764}, {'country_name': 'NICARAGUA', 'country_code': 521}, {'country_name': '1', 'country_code': 0}, {'country_name': 'VATICANO, CIDADE DO (SANTA SE)', 'country_code': 848}, {'country_name': 'Coréia, Rep.Pop.Democrática', 'country_code': 187}, {'country_name': 'EGITO', 'country_code': 240}, {'country_name': 'COLOMBIA', 'country_code': 169}, {'country_name': 'BOLIVIA', 'country_code': 97}, {'country_name': 'GROENLANDIA', 'country_code': 305}, {'country_name': 'JAMMU', 'country_code': 395}, {'country_name': 'GAMBIA', 'country_code': 285}, {'country_name': 'Irã, República Islamica do', 'country_code': 372}, {'country_name': 'ISRAEL', 'country_code': 383}, {'country_name': 'COOK, ILHAS', 'country_code': 183}, {'country_name': 'AUSTRALIA', 'country_code': 69}, {'country_name': 'SIRIA, REP. ARABE DA', 'country_code': 744}, {'country_name': 'JAMAICA', 'country_code': 391}, {'country_name': 'FILIPINAS', 'country_code': 267}, {'country_name': 'ZAIRE', 'country_code': 888}, {'country_name': 'GUIANA FRANCESA', 'country_code': 325}, {'country_name': 'AUSTRIA', 'country_code': 72}, {'country_name': 'TURCAS E CAICOS, ILHAS', 'country_code': 823}, {'country_name': 'CAYMAN,ILHAS', 'country_code': 137}, {'country_name': 'AZERBAIJAO, REPUBLICA DO', 'country_code': 73}, {'country_name': 'FINLANDIA', 'country_code': 271}, {'country_name': 'LESOTO', 'country_code': 426}, {'country_name': 'LITUANIA, REPUBLICA DA', 'country_code': 442}, {'country_name': 'IEMEN DEMOCRATICO', 'country_code': 358}, {'country_name': 'URUGUAI', 'country_code': 845}, {'country_name': 'MALAVI', 'country_code': 458}, {'country_name': 'INDIA', 'country_code': 361}, {'country_name': 'EQUADOR', 'country_code': 239}, {'country_name': 'CUBA', 'country_code': 199}, {'country_name': 'PITCAIRN, ILHA DE', 'country_code': 593}, {'country_name': 'ANGOLA', 'country_code': 40}, {'country_name': 'PAQUISTAO', 'country_code': 576}, {'country_name': 'TUVALU', 'country_code': 828}, {'country_name': 'BENIN', 'country_code': 229}, {'country_name': 'ARABIA SAUDITA', 'country_code': 53}, {'country_name': 'PARAGUAI', 'country_code': 586}, {'country_name': 'TAILANDIA', 'country_code': 776}, {'country_name': 'MOLDAVIA (MOLDAVA),REP. DA', 'country_code': 494}, {'country_name': 'DJIBUTI', 'country_code': 783}, {'country_name': 'GABAO', 'country_code': 281}, {'country_name': 'BURKINA FASO', 'country_code': 31}, {'country_name': 'MONACO', 'country_code': 495}, {'country_name': 'GUIANA', 'country_code': 337}, {'country_name': 'SOMOA AMERICANA', 'country_code': 691}, {'country_name': 'BRASIL', 'country_code': 105}, {'country_name': 'MARROCOS', 'country_code': 474}, {'country_name': 'ZIMBABUE', 'country_code': 665}, {'country_name': 'GUATEMALA', 'country_code': 317}, {'country_name': 'LUXEMBURGO', 'country_code': 445}, {'country_name': 'ESTADOS UNIDOS', 'country_code': 249}, {'country_name': 'VENEZUELA', 'country_code': 850}, {'country_name': 'FEZZAN', 'country_code': 263}, {'country_name': 'CROACIA, REPUBLICA DA', 'country_code': 195}, {'country_name': 'MADAGASCAR', 'country_code': 450}, {'country_name': 'BAHAMAS', 'country_code': 77}, {'country_name': 'NAO DECLARADOS', 'country_code': 999}, {'country_name': 'ISLANDIA', 'country_code': 379}, {'country_name': 'HONDURAS', 'country_code': 345}, {'country_name': 'CANAL (ILHAS NORMANDAS)', 'country_code': 152}, {'country_name': 'MAURITANIA', 'country_code': 488}, {'country_name': 'ZONA FRANCA DE MANAUS', 'country_code': 100}, {'country_name': 'PACIF. ILHAS TERR. USA', 'country_code': 569}, {'country_name': 'SRI-LANKA', 'country_code': 750}, {'country_name': 'NORFOLK, ILHA', 'country_code': 535}, {'country_name': 'TRINIDAD E TOBAGO', 'country_code': 815}, {'country_name': 'INDONESIA', 'country_code': 365}, {'country_name': 'NAURU', 'country_code': 508}, {'country_name': 'SAARA OCIDENTAL', 'country_code': 685}, {'country_name': 'UCRANIA', 'country_code': 831}, {'country_name': 'BOTSUANA', 'country_code': 101}, {'country_name': 'NAMIBIA', 'country_code': 507}, {'country_name': 'BANGLADESH', 'country_code': 81}, {'country_name': 'MALAISIA', 'country_code': 455}, {'country_name': 'CHADE', 'country_code': 788}, {'country_name': 'UZBEQUISTAO, REPUBLICA DO', 'country_code': 847}, {'country_name': 'PAPUA NOVA GUINE', 'country_code': 545}, {'country_name': 'GUINE, REPUBLICA DA', 'country_code': 329}, {'country_name': 'MALDIVAS', 'country_code': 461}, {'country_name': 'SURINAME', 'country_code': 770}, {'country_name': 'COMUNIDADE ECONOMICA EUROPEIA', 'country_code': 666}, {'country_name': 'SUAZILANDIA', 'country_code': 754}, {'country_name': 'VANUATU', 'country_code': 551}, {'country_name': 'HAITI', 'country_code': 341}, {'country_name': 'Sérvia E Montenegro(Iugoslávia,Rep. Fede', 'country_code': 388}, {'country_name': 'BULGARIA', 'country_code': 111}, {'country_name': 'ROMENIA', 'country_code': 670}, {'country_name': 'LETONIA, REPUBLICA DA', 'country_code': 427}, {'country_name': 'UGANDA', 'country_code': 833}, {'country_name': 'GUINE-EQUATORIAL', 'country_code': 331}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
36
How many unique economic activities name exist?
SELECT COUNT(DISTINCT economic_activity_name) AS total_activities FROM economic_activity;
Easy
[{'total_activities': 998}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
37
What is the name of company with the highest capital?
SELECT name FROM company ORDER BY capital DESC LIMIT 1;
Easy
[{'name': 'ENGIE TRADING COMERCIALIZADORA DE ENERGIA LTDA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
38
Which company size code have the lowest capital?
SELECT company_size_code FROM company ORDER BY capital ASC LIMIT 1;
Easy
[{'company_size_code': 1}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
39
What are the basic cnpj of the top 3 companies based on their capital?
SELECT basic_cnpj FROM company ORDER BY capital DESC LIMIT 3;
Easy
[{'basic_cnpj': '31635668'}, {'basic_cnpj': '9117176'}, {'basic_cnpj': '38252387'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
40
What is the average capital of companies by each size code, along with their respective size code?
SELECT company_size_code, AVG(capital) FROM company GROUP BY company_size_code;
Easy
[{'company_size_code': 0, 'AVG(capital)': 0.0}, {'company_size_code': 1, 'AVG(capital)': 15367.907539118065}, {'company_size_code': 3, 'AVG(capital)': 177235.29411764705}, {'company_size_code': 5, 'AVG(capital)': 271940.4137931034}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
41
Calculate the average capital of companies by each size?
SELECT company_size_code, AVG(capital) FROM company GROUP BY company_size_code;
Easy
[{'company_size_code': 0, 'AVG(capital)': 0.0}, {'company_size_code': 1, 'AVG(capital)': 15367.907539118065}, {'company_size_code': 3, 'AVG(capital)': 177235.29411764705}, {'company_size_code': 5, 'AVG(capital)': 271940.4137931034}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
42
How many unique primary activity code are in the establishment table for each state?
SELECT state, COUNT(DISTINCT primary_economic_activity_code) FROM establishment GROUP BY state;
Easy
[{'state': 'AC', 'COUNT(DISTINCT primary_economic_activity_code)': 3}, {'state': 'AL', 'COUNT(DISTINCT primary_economic_activity_code)': 13}, {'state': 'AM', 'COUNT(DISTINCT primary_economic_activity_code)': 9}, {'state': 'AP', 'COUNT(DISTINCT primary_economic_activity_code)': 5}, {'state': 'BA', 'COUNT(DISTINCT primary_economic_activity_code)': 36}, {'state': 'CE', 'COUNT(DISTINCT primary_economic_activity_code)': 20}, {'state': 'DF', 'COUNT(DISTINCT primary_economic_activity_code)': 15}, {'state': 'ES', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'EX', 'COUNT(DISTINCT primary_economic_activity_code)': 3}, {'state': 'GO', 'COUNT(DISTINCT primary_economic_activity_code)': 28}, {'state': 'MA', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'MG', 'COUNT(DISTINCT primary_economic_activity_code)': 75}, {'state': 'MS', 'COUNT(DISTINCT primary_economic_activity_code)': 10}, {'state': 'MT', 'COUNT(DISTINCT primary_economic_activity_code)': 17}, {'state': 'PA', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'PB', 'COUNT(DISTINCT primary_economic_activity_code)': 15}, {'state': 'PE', 'COUNT(DISTINCT primary_economic_activity_code)': 20}, {'state': 'PI', 'COUNT(DISTINCT primary_economic_activity_code)': 5}, {'state': 'PR', 'COUNT(DISTINCT primary_economic_activity_code)': 55}, {'state': 'RJ', 'COUNT(DISTINCT primary_economic_activity_code)': 62}, {'state': 'RN', 'COUNT(DISTINCT primary_economic_activity_code)': 7}, {'state': 'RO', 'COUNT(DISTINCT primary_economic_activity_code)': 8}, {'state': 'RR', 'COUNT(DISTINCT primary_economic_activity_code)': 1}, {'state': 'RS', 'COUNT(DISTINCT primary_economic_activity_code)': 48}, {'state': 'SC', 'COUNT(DISTINCT primary_economic_activity_code)': 37}, {'state': 'SE', 'COUNT(DISTINCT primary_economic_activity_code)': 10}, {'state': 'SP', 'COUNT(DISTINCT primary_economic_activity_code)': 149}, {'state': 'TO', 'COUNT(DISTINCT primary_economic_activity_code)': 6}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
43
How many unique primary activity code are in the establishment table for each state order by state ?
SELECT state, COUNT(DISTINCT primary_economic_activity_code) FROM establishment GROUP BY state ORDER BY state;
Easy
[{'state': 'AC', 'COUNT(DISTINCT primary_economic_activity_code)': 3}, {'state': 'AL', 'COUNT(DISTINCT primary_economic_activity_code)': 13}, {'state': 'AM', 'COUNT(DISTINCT primary_economic_activity_code)': 9}, {'state': 'AP', 'COUNT(DISTINCT primary_economic_activity_code)': 5}, {'state': 'BA', 'COUNT(DISTINCT primary_economic_activity_code)': 36}, {'state': 'CE', 'COUNT(DISTINCT primary_economic_activity_code)': 20}, {'state': 'DF', 'COUNT(DISTINCT primary_economic_activity_code)': 15}, {'state': 'ES', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'EX', 'COUNT(DISTINCT primary_economic_activity_code)': 3}, {'state': 'GO', 'COUNT(DISTINCT primary_economic_activity_code)': 28}, {'state': 'MA', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'MG', 'COUNT(DISTINCT primary_economic_activity_code)': 75}, {'state': 'MS', 'COUNT(DISTINCT primary_economic_activity_code)': 10}, {'state': 'MT', 'COUNT(DISTINCT primary_economic_activity_code)': 17}, {'state': 'PA', 'COUNT(DISTINCT primary_economic_activity_code)': 21}, {'state': 'PB', 'COUNT(DISTINCT primary_economic_activity_code)': 15}, {'state': 'PE', 'COUNT(DISTINCT primary_economic_activity_code)': 20}, {'state': 'PI', 'COUNT(DISTINCT primary_economic_activity_code)': 5}, {'state': 'PR', 'COUNT(DISTINCT primary_economic_activity_code)': 55}, {'state': 'RJ', 'COUNT(DISTINCT primary_economic_activity_code)': 62}, {'state': 'RN', 'COUNT(DISTINCT primary_economic_activity_code)': 7}, {'state': 'RO', 'COUNT(DISTINCT primary_economic_activity_code)': 8}, {'state': 'RR', 'COUNT(DISTINCT primary_economic_activity_code)': 1}, {'state': 'RS', 'COUNT(DISTINCT primary_economic_activity_code)': 48}, {'state': 'SC', 'COUNT(DISTINCT primary_economic_activity_code)': 37}, {'state': 'SE', 'COUNT(DISTINCT primary_economic_activity_code)': 10}, {'state': 'SP', 'COUNT(DISTINCT primary_economic_activity_code)': 149}, {'state': 'TO', 'COUNT(DISTINCT primary_economic_activity_code)': 6}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
44
Exists how many companies in each company size code?
SELECT company_size_code, COUNT(*) AS total_companies FROM company GROUP BY company_size_code;
Easy
[{'company_size_code': 0, 'total_companies': 2}, {'company_size_code': 1, 'total_companies': 703}, {'company_size_code': 3, 'total_companies': 34}, {'company_size_code': 5, 'total_companies': 261}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
45
What are the top 5 states with the highest number of establishments with their respective number of establishments?
SELECT state, COUNT(*) FROM establishment GROUP BY state ORDER BY COUNT(*) DESC LIMIT 5;
Easy
[{'state': 'SP', 'COUNT(*)': 280}, {'state': 'MG', 'COUNT(*)': 112}, {'state': 'RJ', 'COUNT(*)': 81}, {'state': 'PR', 'COUNT(*)': 74}, {'state': 'RS', 'COUNT(*)': 67}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
46
How many establishments are located in each state?
SELECT state, COUNT(*) AS total_establishments FROM establishment GROUP BY state;
Easy
[{'state': 'AC', 'total_establishments': 3}, {'state': 'AL', 'total_establishments': 13}, {'state': 'AM', 'total_establishments': 10}, {'state': 'AP', 'total_establishments': 5}, {'state': 'BA', 'total_establishments': 53}, {'state': 'CE', 'total_establishments': 25}, {'state': 'DF', 'total_establishments': 16}, {'state': 'ES', 'total_establishments': 22}, {'state': 'EX', 'total_establishments': 3}, {'state': 'GO', 'total_establishments': 34}, {'state': 'MA', 'total_establishments': 22}, {'state': 'MG', 'total_establishments': 112}, {'state': 'MS', 'total_establishments': 10}, {'state': 'MT', 'total_establishments': 17}, {'state': 'PA', 'total_establishments': 24}, {'state': 'PB', 'total_establishments': 16}, {'state': 'PE', 'total_establishments': 23}, {'state': 'PI', 'total_establishments': 5}, {'state': 'PR', 'total_establishments': 74}, {'state': 'RJ', 'total_establishments': 81}, {'state': 'RN', 'total_establishments': 8}, {'state': 'RO', 'total_establishments': 9}, {'state': 'RR', 'total_establishments': 1}, {'state': 'RS', 'total_establishments': 67}, {'state': 'SC', 'total_establishments': 44}, {'state': 'SE', 'total_establishments': 16}, {'state': 'SP', 'total_establishments': 280}, {'state': 'TO', 'total_establishments': 7}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
47
What is the total capital for all companies whith size description 'MICRO EMPRESA'?
SELECT SUM(company.capital) FROM company JOIN company_size ON company.company_size_code = company_size.company_size_code WHERE company_size_description = 'MICRO EMPRESA';
Medium
[{'SUM(company.capital)': 10803639.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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
48
How many establishments have 'Serviços de engenharia' as primary economic activity?
SELECT COUNT(*) FROM establishment e JOIN economic_activity ea ON e.primary_economic_activity_code = ea.economic_activity_code WHERE ea.economic_activity_name = 'Serviços de engenharia';
Medium
[{'COUNT(*)': 6}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
49
What is the size descripition of the company with the highest capital?
SELECT company_size.company_size_description FROM company JOIN company_size ON company.company_size_code = company_size.company_size_code ORDER BY company.capital DESC LIMIT 1;
Medium
[{'company_size_description': 'DEMAIS'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE company_size ( company_size_code INTEGER PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS);
50
List all establishments basic cnpj and their corresponding registration status description
SELECT establishment.basic_cnpj, registration_status.registration_status_description FROM establishment JOIN registration_status ON establishment.registration_status_code = registration_status.registration_status_code
Medium
[{'basic_cnpj': '40515767', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '40010763', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '23205297', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '84307404', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22665599', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20215350', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28336615', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '21216767', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '41099960', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09518509', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11260448', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '04567405', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53385523', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13812166', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22086918', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '04518353', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05267871', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '51465376', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17884160', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43260925', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35593470', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38550234', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '53176155', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22246839', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33556005', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '52694863', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35567149', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '24856068', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '04810480', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24559262', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '48996777', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '50524943', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18825347', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '44418841', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31189050', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '68478221', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01702036', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27864052', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00913164', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '01259052', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '21582408', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44764682', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24603935', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17820968', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09499574', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '14554248', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16837972', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07612201', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17773795', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28960679', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '32947773', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '91579656', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41581162', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06322687', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51379472', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '25546100', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26604592', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '09896197', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38302805', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '15712615', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '39475648', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '32838407', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '41234968', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '44195679', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '54359161', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02318823', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '53540770', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14696942', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44936539', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18089480', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47508411', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08506044', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '09372554', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '94544202', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52535520', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27217046', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '82284357', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10612237', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33409906', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05979969', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '00580698', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41153194', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27607471', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43280210', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13668590', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07652540', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28236563', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '56645732', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41501133', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30445051', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23841169', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23522735', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03845536', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17637588', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44482398', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01632323', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '45697221', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '45766820', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11460908', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17876726', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11589117', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13811946', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02282241', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '46912791', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03559237', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14324141', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03396504', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21020262', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47962770', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '12568901', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38050993', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52362982', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02936590', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10234316', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '62557939', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21085810', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46095640', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12108925', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17841145', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34490297', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51815168', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33880625', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16137084', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25165034', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27817200', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20450277', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26639934', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16623900', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '47007682', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09094118', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51839452', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30768654', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '46629447', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08017268', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38431281', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07745748', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02495186', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08331015', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30524629', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '58425505', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32385794', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '31358743', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41931950', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38497603', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14538498', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '39275353', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14669881', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26611168', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01672396', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '51724090', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '10101938', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41648559', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30493917', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14133009', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20165027', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '32859505', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '44384585', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16117399', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38773848', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32931405', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08100606', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14799633', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22045362', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '52582693', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06827724', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '53802488', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '42324993', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01969851', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26949728', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42228898', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08814330', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42511649', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49289642', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29708403', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49359446', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53695306', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30022434', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23971113', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '14812276', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13709233', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '46255020', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23271730', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '76831718', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25972896', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42627722', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53694699', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23810520', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49658440', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21580645', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02021458', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42983130', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38138351', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20923412', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33112324', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53805295', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '56245707', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '45950498', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '77602118', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '33751771', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16106283', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35051578', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '25492565', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32259125', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32999742', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '56847189', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '75074443', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05388652', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04168811', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43550847', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52853980', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24730560', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27514501', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23938647', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '61088696', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19605271', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43785556', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '00934162', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37787172', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11316876', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05604119', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33305773', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35712628', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26072487', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '98659410', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '74628108', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '92387224', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52501255', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '34073684', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40216547', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37514851', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '19111190', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40025946', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21379179', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '09485894', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '61693222', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00600641', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34953507', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37172464', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28459059', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36509959', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38328460', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35005644', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06747550', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '15721041', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '45231282', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02805594', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37115074', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49599836', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08332183', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '32716862', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38962894', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '88308135', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37785090', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '80899925', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '78053493', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02132790', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46625885', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07237287', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16124569', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '73899213', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05623479', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '19310230', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08373266', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '10046503', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25394342', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49944840', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '60882644', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34058344', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '28457491', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '51864388', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14716612', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '79242939', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28740325', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27262472', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41629541', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28562950', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '24531860', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '51232938', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07340914', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08262077', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '19307633', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40045088', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05523861', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '27437496', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '39368584', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28313661', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37594389', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '00565081', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33143127', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '32827511', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26509429', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '03536793', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '27110791', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12244133', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01355170', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17133318', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37976482', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05702440', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16692178', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13951650', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '47561047', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23452001', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '50455063', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '48127887', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07573990', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20433981', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '53738407', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '48903160', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30385868', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '73303430', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49077433', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17758960', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '15637384', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '90322587', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23640991', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '51213102', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21522285', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08964772', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16290075', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '90027186', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37220855', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47310008', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '50797721', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02674567', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22425681', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17375696', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32047896', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18001098', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25913588', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46496203', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28200171', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '41537115', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01831508', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '10316183', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '18869042', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18586176', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '43193743', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16978694', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '62218045', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24924370', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '40180319', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37946476', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21928624', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '43519399', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '29172795', 'registration_status_description': 'SUSPENSA'}, {'basic_cnpj': '10772168', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38145407', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11102128', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '21002238', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '43180132', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49780044', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36702049', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06342353', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '24609227', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '41217005', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08371716', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51148709', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21123601', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20382784', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20134181', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '50968362', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28409305', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04165923', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '51039342', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14946110', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '81614885', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '76385558', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37330202', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '93725638', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16642957', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12570503', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18895793', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '41309349', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '46187531', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26552486', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '50547393', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '32593847', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09603526', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '42838773', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05071367', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36014751', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06310011', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28536255', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52031128', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26262196', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49069250', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36423900', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18573545', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '88727359', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23647289', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38998655', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10334944', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16181492', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '54006911', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '55574131', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10416016', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '15961999', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28335515', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42482332', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '44147705', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23698413', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13644540', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17824992', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '36381468', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14994985', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28139885', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51568824', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38529554', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02044692', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '47874482', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22566474', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37901052', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '45237888', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17019795', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06080588', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22518440', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17154274', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14180796', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '96343983', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19763380', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44134489', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22317056', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '31773378', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49792333', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16579188', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47575855', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '34635271', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23148556', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42675910', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05618905', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30571475', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00206963', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28717497', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36478413', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '01922038', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '77772309', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31458047', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02930609', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '51535352', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08104275', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35851453', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '78065083', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25339445', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '76041326', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01619349', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02223966', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08207371', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49735764', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35824842', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29524695', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '29292074', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51213509', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37383036', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08869526', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '12211229', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34639930', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26338635', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31160103', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '15084108', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '62266952', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18042184', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33998722', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42898128', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33014556', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03713105', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09132128', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '76260223', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26625886', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21562962', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09941941', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08415703', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '44672863', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03817469', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53631283', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27713044', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '50271118', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29760785', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35176198', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '31201267', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30269392', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08294193', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32819666', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '73007999', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23572161', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '47964174', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23125945', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '01656202', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20803498', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51677149', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '91202838', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21363782', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35593337', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33042559', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18284546', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47391473', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26764249', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30133972', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52739376', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16197968', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33532958', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01474362', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32113870', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '50397140', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '31588835', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34676420', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14154215', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19394605', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11042680', 'registration_status_description': 'NULA'}, {'basic_cnpj': '24838933', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42900898', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38718434', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04087496', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '07534704', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05562221', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22166680', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '88558820', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52916129', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23178535', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '09293438', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44929701', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11059925', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26000103', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '01908944', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '36106716', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '14308051', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03441158', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23649815', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '09387323', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38499223', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '08580148', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51828641', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08146886', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32431584', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '32892224', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28321819', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37609500', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30437412', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35701870', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06562416', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07745949', 'registration_status_description': 'SUSPENSA'}, {'basic_cnpj': '05756969', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40943541', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '15297353', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16778306', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23112568', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43678446', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17680071', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18060613', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21405064', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29185397', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38944397', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02259303', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17940898', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02928343', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '04306808', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28302051', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '12401721', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06426983', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11646973', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03075324', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40677418', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22175491', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '04964823', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '22119742', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '02000877', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '45477899', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13753355', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28763206', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26086759', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17807651', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19010999', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37178669', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '25419795', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34073394', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13702675', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22570520', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13211149', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37831275', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11275358', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17265560', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '05862915', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47977888', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '42570774', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '42666151', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30306676', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44598328', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27017271', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '68468867', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '84638113', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '62856109', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25476795', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05399584', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24404627', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22109168', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '04526907', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '16303604', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27427777', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '53258669', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33120280', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '49738788', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20934261', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '53364418', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '24191952', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '28253850', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08914763', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31215062', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11960941', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03981375', 'registration_status_description': 'SUSPENSA'}, {'basic_cnpj': '32447179', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '32283255', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30523948', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '44633138', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51719491', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00266170', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41808973', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '48213672', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42423575', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '15017485', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '52130567', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '45732824', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '45920113', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '71250740', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '43153173', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21966128', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '09081645', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25076109', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23444657', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12121926', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11398512', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '52078039', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '27735900', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09483107', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14518082', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26660809', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '56419088', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11208786', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '48772356', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01062023', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19411630', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37476156', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '39768818', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '45365378', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06170284', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02242402', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '39555097', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '24286799', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '25937052', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '64905847', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22444808', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '12816158', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14032004', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '12333328', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '10555270', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '25174813', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '10257063', 'registration_status_description': 'SUSPENSA'}, {'basic_cnpj': '64041130', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33367995', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03993092', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25919106', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01156678', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43044760', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33597156', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '39228924', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10847985', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33007127', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '11539465', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '31624525', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16372067', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '50286174', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49566762', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02288107', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38339939', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49431439', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '39189748', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10620018', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '02856269', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10762620', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30533170', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21017104', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22841885', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16306764', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34931069', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '81448813', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13937653', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '31011568', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '40041598', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '93861706', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '31817452', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24940541', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11471239', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28320760', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08015719', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '54046404', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18053970', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '46127669', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01886422', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10495148', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44913516', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21206329', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '09799337', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34626078', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27935007', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28999695', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '08526451', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '66624040', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '35573601', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06736176', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06995641', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13522903', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '29334568', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '18683724', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00623242', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '61412110', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28886569', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35710743', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '40161351', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '14447956', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27443953', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16617465', 'registration_status_description': 'NULA'}, {'basic_cnpj': '45004668', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23165971', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '55545263', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13687299', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34637534', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '06098895', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '39792994', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14660283', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03187056', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07058523', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01348063', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '52452234', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '54136569', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03889195', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34086576', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '01930690', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21693240', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14172506', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37288036', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '29193702', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '68309624', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13369921', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '75492231', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '15052905', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22822666', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18613843', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53486687', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24133510', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '36328440', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '51925469', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '62257415', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13306397', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12611606', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26776535', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '37672399', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10951892', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '19999483', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30772837', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16428318', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11089517', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '15376949', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00401416', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '60069051', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '48762944', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '39883093', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00904041', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '91879270', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13866326', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '15289511', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43123901', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '49645900', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02143863', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '54009881', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38821791', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46585768', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42084810', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28151852', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47644402', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46606639', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '40131313', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '37561728', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '71659783', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03693006', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '53116952', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21519294', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '80599624', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34765927', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '52497691', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35677361', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33758208', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47619943', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '00385760', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '71396766', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35173404', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05697657', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05639980', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '89198352', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '03961671', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '42271464', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '02362891', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '54833249', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05581441', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05275231', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47561876', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38530104', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27276319', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '43003561', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06215916', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '04689102', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '00937263', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17669526', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '97554506', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '19969089', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26945140', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28649897', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09806974', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '68180488', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '37961405', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20435509', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44357320', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '28142097', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40266603', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '11091457', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '28147611', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '07232039', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03556888', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '40384500', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43158922', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04759619', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '09356507', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40907713', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '18028744', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22437391', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '38130776', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35662537', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '03602260', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26532639', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11658933', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '02875828', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '26747359', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '32661785', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04336088', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '13125894', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21980833', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21554204', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '47612844', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '64891740', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '35758871', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13259263', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '48225856', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '38250109', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01894120', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00904883', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04800673', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '42830081', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41627830', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '19836211', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31505871', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '53866301', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '13725827', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06745142', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20632809', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '50407647', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '17366404', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '22008270', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '34274014', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05203908', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17103903', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '30633679', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '83878892', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08478023', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '24761544', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14896438', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '12348471', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '50038083', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08744270', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '49304874', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '72214091', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25816619', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22603666', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '51880158', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04801811', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '31851242', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23342547', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24712640', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '06292349', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14262523', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46175252', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20835838', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '05741641', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '04218300', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '23909324', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29018653', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '46498883', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07205267', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '14143064', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41930700', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '02298942', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40898578', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '24562031', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00347394', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '23076934', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33269204', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '15981095', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '50716598', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49016373', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '46841932', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '12461612', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38068060', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33169122', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '26500470', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27433105', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '27334340', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29665410', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '00976462', 'registration_status_description': 'SUSPENSA'}, {'basic_cnpj': '10089197', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47222612', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '93884039', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '38176545', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01825965', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03435877', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '92472604', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40677223', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '34544779', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08877710', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '23726971', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '09498803', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '05320871', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '69949071', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38172122', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '20072372', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47135217', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '56830102', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07168317', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '25333455', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '22512469', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '05501711', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '44739147', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '36638770', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '39954001', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '08854312', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '47204259', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '33730204', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '57583312', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '03629565', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '17428946', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '20653694', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49828821', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '48902871', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14549079', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '44663100', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '29927780', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '00135680', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '29423556', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '41180712', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '11926096', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30891336', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07776054', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '12570574', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '55674675', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47768424', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '30110637', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '10143966', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '42707032', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '43083438', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53190624', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '07209358', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '55403935', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '04613494', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '49997946', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '40009826', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '49899353', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '03324120', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '49291740', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16236131', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '01205288', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '41975432', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '16491791', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '47707952', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '44958351', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '38707673', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18780663', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '65848731', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '04466305', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '07927527', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '35205930', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '85306322', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '00830054', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '16750498', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21861583', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '11942930', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '38226259', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21063197', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '14991979', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '21427940', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '33201893', 'registration_status_description': 'INAPTA'}, {'basic_cnpj': '26967385', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '08519375', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '18547221', 'registration_status_description': 'BAIXADA'}, {'basic_cnpj': '21132658', 'registration_status_description': 'ATIVA'}, {'basic_cnpj': '53860100', 'registration_status_description': 'ATIVA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
51
Identify tha basic cnpj of companies with option for both simples and mei taxation
SELECT DISTINCT company.basic_cnpj FROM company JOIN taxation ON company.basic_cnpj = taxation.basic_cnpj WHERE taxation.option_for_simples_taxation = 'S' AND taxation.option_for_mei_taxation = 'S';
Medium
[{'Nenhum': 'Nenhum resultado encontrado'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
52
What are the unique names of the countries where the registered establishments are located?
SELECT DISTINCT c.country_name FROM establishment AS e JOIN country AS c ON e.country_code = c.country_code;
Medium
[{'country_name': 'BRASIL'}, {'country_name': 'REINO UNIDO'}, {'country_name': 'PORTUGAL'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
53
List the name of the most frequent primary economic activity?
SELECT a.economic_activity_name FROM establishment AS e JOIN economic_activity AS a ON e.primary_economic_activity_code = a.economic_activity_code GROUP BY a.economic_activity_name ORDER BY COUNT(*) DESC LIMIT 1;
Medium
[{'economic_activity_name': 'Atividade Econônica não informada'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400);
54
What is the name of the city that has more establishments?
SELECT c.city_name FROM establishment AS e JOIN city AS c ON e.city_code = c.city_code GROUP BY c.city_name ORDER BY COUNT(*) DESC LIMIT 1;
Medium
[{'city_name': 'BRASILIA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
55
What are the name of the top 5 cities by quantity of establishments?
SELECT c.city_name FROM establishment e JOIN city c ON e.city_code = c.city_code GROUP BY c.city_name ORDER BY COUNT(*) DESC LIMIT 5;
Medium
[{'city_name': 'BRASILIA'}, {'city_name': 'PORTO ALEGRE'}, {'city_name': 'JUIZ DE FORA'}, {'city_name': 'BELEM'}, {'city_name': 'VILA VELHA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241);
56
What are the names of the countries where the registered establishments are located, along with their respective quantity of establishments.
SELECT c.country_name, COUNT(*) FROM establishment AS e JOIN country AS c ON e.country_code = c.country_code GROUP BY c.country_code;
Medium
[{'country_name': 'BRASIL', 'COUNT(*)': 13}, {'country_name': 'PORTUGAL', 'COUNT(*)': 1}, {'country_name': 'REINO UNIDO', 'COUNT(*)': 2}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
57
What are the description of the types of partners with more than 10 partners?
SELECT pt.partner_type_description FROM partner AS p JOIN partner_type AS pt ON p.partner_type_code = pt.partner_type_code GROUP BY p.partner_type_code HAVING COUNT(*) > 10;
Medium
[{'partner_type_description': 'PESSOA JURÍDICA'}, {'partner_type_description': 'PESSOA FÍSICA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO);
58
What is the age range description and the number of partners for each age range?
SELECT ar.age_range_description, COUNT(p.partner_age_range_code) AS partner_count FROM partner AS p JOIN age_range AS ar ON p.partner_age_range_code = ar.age_range_code GROUP BY ar.age_range_description;
Medium
[{'age_range_description': '0 a 12 anos', 'partner_count': 1}, {'age_range_description': '13 a 20 anos', 'partner_count': 7}, {'age_range_description': '21 a 30 anos', 'partner_count': 72}, {'age_range_description': '31 a 40 anos', 'partner_count': 165}, {'age_range_description': '41 a 50 anos', 'partner_count': 259}, {'age_range_description': '51 a 60 anos', 'partner_count': 224}, {'age_range_description': '61 a 70 anos', 'partner_count': 123}, {'age_range_description': '71 a 80 anos', 'partner_count': 85}, {'age_range_description': 'Maiores de 80 anos', 'partner_count': 42}, {'age_range_description': 'Não se aplica', 'partner_count': 22}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos);
59
Show the name of the coutry with more establishments
SELECT p.country_name FROM establishment AS e JOIN country AS p ON e.country_code = p.country_code GROUP BY p.country_name ORDER BY COUNT(*) DESC LIMIT 1;
Medium
[{'country_name': 'BRASIL'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA);
60
What is the registration status description of the establishment with basic CNPJ equal to '33201893'?
SELECT rs.registration_status_description FROM establishment AS e JOIN registration_status AS rs ON e.registration_status_code = rs.registration_status_code WHERE e.basic_cnpj = '33201893';
Medium
[{'registration_status_description': 'INAPTA'}]
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 company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); 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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT, partner_type_code INTEGER, partner_age_range_code INTEGER ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, company_size_description TEXT ); INSERT INTO company_size (company_size_code, company_size_description) VALUES (0, NÃO INFORMADO), (1, MICRO EMPRESA), (3, EMPRESA DE PEQUENO PORTE), (5, DEMAIS); CREATE TABLE establishment ( basic_cnpj TEXT, order_cnpj TEXT PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, BA, 2, None, 3279, 2021-01-22, 4639701), (40010763, 0001, Main, None, None, GO, 4, None, 9373, 2020-12-03, 5612100); CREATE TABLE age_range ( age_range_code INTEGER PRIMARY KEY, age_range_description TEXT ); INSERT INTO age_range (age_range_code, age_range_description) VALUES (1, 0 a 12 anos), (2, 13 a 20 anos); CREATE TABLE city ( city_name TEXT, city_code INTEGER PRIMARY KEY ); INSERT INTO city VALUES (CAARAPO, 9055), (UMBUZEIRO, 2241); CREATE TABLE country ( country_code INTEGER PRIMARY KEY, country_name TEXT ); INSERT INTO country VALUES (548, NOVA ZELANDIA), (556, OMA); CREATE TABLE economic_activity ( economic_activity_name TEXT, economic_activity_code INTEGER PRIMARY KEY ); INSERT INTO economic_activity VALUES (Fabricação de fios cabos e condutores elétricos isolados, 2733300), (Fabricação de bijuterias e artefatos semelhantes, 3212400); CREATE TABLE registration_status ( registration_status_code INTEGER PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA); CREATE TABLE partner ( basic_cnpj TEXT PRIMARY KEY, partner_type_code INTEGER, partner_age_range_code INTEGER, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (partner_type_code) REFERENCES partner_type(partner_type_code), FOREIGN KEY (partner_age_range_code) REFERENCES age_range(age_range_code) ); INSERT INTO partner (basic_cnpj, partner_type_code, partner_age_range_code) VALUES (43400143, 2, 7), (22954290, 2, 4); CREATE TABLE partner_type ( partner_type_code INTEGER PRIMARY KEY, partner_type_description TEXT ); INSERT INTO partner_type VALUES (1, PESSOA JURÍDICA), (2, PESSOA FÍSICA), (3, ESTRANGEIRO); CREATE TABLE taxation ( basic_cnpj TEXT PRIMARY KEY, option_for_simples_taxation CHAR, simples_taxation_exclusion_date DATE, option_for_mei_taxation CHAR, mei_taxation_exclusion_date DATE, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj) ); INSERT INTO taxation VALUES (51578629, S, None, N, None), (53144319, S, None, S, None), (17373951, N, 2014-02-26, N, None)
CREATE TABLE company ( name TEXT, basic_cnpj TEXT, capital DOUBLE, company_size_code INTEGER ); INSERT INTO company VALUES (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 ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);
CREATE TABLE company ( name TEXT, basic_cnpj TEXT PRIMARY KEY, capital DOUBLE, company_size_code INTEGER, FOREIGN KEY (company_size_code) REFERENCES company_size(company_size_code) ); INSERT INTO company VALUES (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 PRIMARY KEY, 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, FOREIGN KEY (basic_cnpj) REFERENCES company(basic_cnpj), FOREIGN KEY (registration_status_code) REFERENCES registration_status(registration_status_code), FOREIGN KEY (city_code) REFERENCES city(city_code), FOREIGN KEY (country_code) REFERENCES country(country_code), FOREIGN KEY (primary_economic_activity_code) REFERENCES economic_activity(economic_activity_code) ); INSERT INTO establishment VALUES (40515767, 0001, Main, None, 462310646231084635403, 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 PRIMARY KEY, registration_status_description TEXT ); INSERT INTO registration_status VALUES (1, NULA), (2, ATIVA);