{"id":23629665,"url":"https://github.com/qsmith-interos/interview-db-sqlite","last_synced_at":"2025-11-08T03:30:29.471Z","repository":{"id":268408315,"uuid":"904258991","full_name":"qsmith-interos/interview-db-sqlite","owner":"qsmith-interos","description":"Starter template for Database interviews","archived":false,"fork":false,"pushed_at":"2024-12-16T14:48:30.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T01:16:29.892Z","etag":null,"topics":["sql","sqlite"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qsmith-interos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-12-16T14:47:05.000Z","updated_at":"2024-12-16T14:56:03.000Z","dependencies_parsed_at":"2024-12-16T15:48:27.742Z","dependency_job_id":"d145934e-8ed5-4c9e-b327-43ea34a66724","html_url":"https://github.com/qsmith-interos/interview-db-sqlite","commit_stats":null,"previous_names":["qsmith-interos/interview-db-sqlite"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qsmith-interos%2Finterview-db-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qsmith-interos%2Finterview-db-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qsmith-interos%2Finterview-db-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qsmith-interos%2Finterview-db-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qsmith-interos","download_url":"https://codeload.github.com/qsmith-interos/interview-db-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239546892,"owners_count":19657045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["sql","sqlite"],"created_at":"2024-12-28T01:16:35.962Z","updated_at":"2025-11-08T03:30:29.438Z","avatar_url":"https://github.com/qsmith-interos.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlite-template\n\n## Installing sqlite\nDevelopers should have sqlite installed in their local machine.\n\n* For Mac users, you can install sqlite via homebrew:\n\n```bash\nbrew install sqlite3\n```\n\n* For Linux users:\n\n```bash\nsudo apt update\nsudo apt install sqlite3\n```\n\n## Usage\nThis template repository consists one file:\n\n1. `init.sql`:  contains sql statements for create database objects (tables and indexes) and seeding the database objects with sample rows.\n\nPlease follow the below instructions to initialize a database.\n\nRun the following command to initialize a sqlite database from the initialization script:\n\n```bash\nsqlite3 {your_db_name}.db \u003c init.sql\n```\n\nTo use the database run the following to enter into the sqlite console:\n\n```bash\nsqlite3 {your_db_name}.db\n```\n\nOur initialized tables contain foreign keys, and foreign key constraints are disabled in sqlite by default. To enable them, run the following:\n```\n\u003e PRAGMA FOREIGN_KEYS = ON;\n```\n\nConfirm the change by ensuring the output to the below command is `1`:\n```\n\u003e PRAGMA FOREIGN_KEYS;\n```\n\nWithin the console you can also run the following and confirm the tables from the initialization script were created:\n\n```\n\u003e .tables\n```\n\n## Schemas\n\nBelow are the schemas for the tables used in this exercise\n\n### Organizations Table\n\n| name | datatype | nullable | indexed |\n| ----- | ----- | ----- | ----- |\n| organization_id (PK) | integer | N | Y |\n| name (unique constraint) | varchar(100) | N | Y |\n| url | varchar(50) | Y | N |\n| email | varchar(50) | Y | N |\n\n\n### Locations Table\n| name | datatype | nullable | indexed |\n| ----- | ----- | ----- | ----- |\n| location_id (PK) | integer | N | Y |\n| organization_id (FK) | integer | N | Y |\n| street_address | varchar(100) | N | N |\n| street_address_2 | varchar(100) | Y | N |\n| city | varchar(100) | N | N |\n| province | varchar(100) | N | N |\n| country | varchar(50) | N | Y |\n| country_code | varchar(3) | N | Y |\n| postal_code | varchar(20) | N | N |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqsmith-interos%2Finterview-db-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqsmith-interos%2Finterview-db-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqsmith-interos%2Finterview-db-sqlite/lists"}