{"id":15111521,"url":"https://github.com/amadr-95/sql-essentials","last_synced_at":"2026-02-20T23:40:10.119Z","repository":{"id":234441452,"uuid":"788901990","full_name":"amadr-95/sql-essentials","owner":"amadr-95","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-25T16:21:26.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T01:24:11.012Z","etag":null,"topics":["databases","postgresql","sql"],"latest_commit_sha":null,"homepage":"","language":null,"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/amadr-95.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":"2024-04-19T10:05:40.000Z","updated_at":"2024-04-25T16:21:29.000Z","dependencies_parsed_at":"2024-04-25T17:35:22.370Z","dependency_job_id":null,"html_url":"https://github.com/amadr-95/sql-essentials","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"fd6b023cfde070c0b74d593dfcf7c4d066429e3a"},"previous_names":["amadr-95/sql-essentials"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amadr-95/sql-essentials","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadr-95%2Fsql-essentials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadr-95%2Fsql-essentials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadr-95%2Fsql-essentials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadr-95%2Fsql-essentials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amadr-95","download_url":"https://codeload.github.com/amadr-95/sql-essentials/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadr-95%2Fsql-essentials/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T23:24:07.480Z","status":"ssl_error","status_checked_at":"2026-02-20T23:24:06.202Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["databases","postgresql","sql"],"created_at":"2024-09-26T00:20:42.396Z","updated_at":"2026-02-20T23:40:10.092Z","avatar_url":"https://github.com/amadr-95.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# [SQL ESSENTIALS](https://www.amigoscode.com/courses/sql)\n\n\n## Connect to PostgreSQL server on Windows\n```bash\npsql -U user_name\n```\n\n## Connect to a database through the terminal\n```bash\npsql -U user_name -d db_name \n```\n\n## List databases\n```bash\n\\l  \n```\n\n## Connect to a database\n```bash\n\\c db_name \n```\n\n## Describe tables\n```bash\n\\d (show all tables)\n\\d db_name (describe the specified table) \n```\n\n## Import .sql script\n```bash\n\\i script/path/.sql \n```\n\n## List of functions\n```bash\n\\df\n```\n\n## Export query to CSV file\n```bash\n\\copy (query) TO 'path/file_name.csv' DELIMITER ',' CSV HEADER; \n```\n\n## PostgreSQL extensions\n```sql\nSELECT * FROM pg_available_extensions;\n```\n### Install extension\n```sql\nCREATE EXTENSION IF NOT EXISTS \"extension_name\";\n```\n\n##  CREATE TABLE\n```sql\nCREATE TABLE table_name (\n    column name + data type + constraints if any\n);\n```\n## DROP TABLE\n```sql\nDROP TABLE table_name;\n```\n## ADDING AND DROPPING CONSTRAINTS\n### PRIMARY KEY\n```sql\nALTER TABLE table_name ADD PRIMARY KEY (table_column);\n```\n\n### UNIQUE\n```sql\nALTER TABLE table_name ADD CONSTRAINT constraint_name UNIQUE(table_column);\n--OR\nALTER TABLE table_name UNIQUE(table_column);\n```\n\n### CHECKS\n```sql\nALTER TABLE table_name ADD CONSTRAINT constraint_name CHECK(column_condition/s);\n```\n\n### DROP CONSTRAINTS\n```sql\nALTER TABLE table_name DROP CONSTRAINT constraint_name; \n```\n## MODIFYING DATA\n### INSERTING RECORDS\n```sql\nINSERT INTO table_name(colum1, column2, ...)\nVALUES (value1, value2, ...);\n```\n\n### DELETING RECORDS\n```sql\nDELETE FROM table_name WHERE conditions;\n```\n\n### UPDATING RECORDS\n```sql\nUPDATE table_name SET column = new_data WHERE conditions;\n```\n\n## SQL COMMANDS ORDER\n```sql\nSELECT \nFROM\nWHERE\nGROUP BY\nHAVING\nORDER BY\nFETCH/LIMIT\nOFFSET\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadr-95%2Fsql-essentials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famadr-95%2Fsql-essentials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadr-95%2Fsql-essentials/lists"}