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); |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 34