{"id":15971689,"url":"https://github.com/douglasrizzo/enem2012-mariadb","last_synced_at":"2026-01-18T08:33:37.876Z","repository":{"id":152474363,"uuid":"39308143","full_name":"douglasrizzo/enem2012-mariadb","owner":"douglasrizzo","description":"Scripts that import the \"Exame Nacional do ","archived":false,"fork":false,"pushed_at":"2019-12-09T19:00:38.000Z","size":52,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T15:52:55.791Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/douglasrizzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-18T18:20:29.000Z","updated_at":"2019-12-09T19:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"24d6c5e8-9671-4774-98e4-9110eb6c2f48","html_url":"https://github.com/douglasrizzo/enem2012-mariadb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/douglasrizzo/enem2012-mariadb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasrizzo%2Fenem2012-mariadb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasrizzo%2Fenem2012-mariadb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasrizzo%2Fenem2012-mariadb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasrizzo%2Fenem2012-mariadb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/douglasrizzo","download_url":"https://codeload.github.com/douglasrizzo/enem2012-mariadb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/douglasrizzo%2Fenem2012-mariadb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T20:40:20.608Z","updated_at":"2026-01-18T08:33:37.833Z","avatar_url":"https://github.com/douglasrizzo.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL scripts to import Enem 2012 microdata into a MariaDB/MySQL database\n\nEnem 2012 microdata consists of 3 huge CSV files, whose structure was optimized so that the files can be imported into a software called IBM SPSS. I don't have this program, so I created a bunch of scripts to normalize and import the data into a MariaDB/MySQL database, as well as generate dichotomous responses for all 4 tests.\n\nOf particular importance is the fact that, although there are 4 tests (natural sciences, humanities sciences, literature, mathematics) the students take in the span of 2 days, there are actually 25 different test kits. The differences between each kit is only in the order of itens. I have manually tracked down where each item appears in each of the test kits and reordered the students' answers accordingly, so that all answers to a specific item are contained in the same column.\n\n## The scripts\n\n- `import.sql`: imports the data into a relational database, allowing for better data querying, and normalizes the data in multiple tables, avoiding redundancy;\n- `binary_responses.sql`: reads the tables created by `import.sql` and dichotomizes item responses, creating one CSV file for each of the 4 tests that were applied in Enem 2012. The files are generated from a random sample of 50000 students. The samples for each of the 4 tests is different.\n- `import_treated.sql`: in case the tables created by `import.sql` are ever exported to CSV files, this script imports them into a new database, taking considerably less time.\n\n## Instructions\n\n1. download the 2012 Enem data, available [here](http://portal.inep.gov.br/microdados) and unzip it. If the link is broken, I suggest you google it, as its location has changed quite a few times along the years.\n2. In a MariaDB or MySQL database (untested) run the `import.sql` script.\n3. _(Optional)_ execute `binary_responses.sql` to generate the CSV files with dichotomous responses.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasrizzo%2Fenem2012-mariadb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdouglasrizzo%2Fenem2012-mariadb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdouglasrizzo%2Fenem2012-mariadb/lists"}