{"id":24021151,"url":"https://github.com/zipcodecore/sql.buildanddestroy","last_synced_at":"2025-02-25T23:46:51.865Z","repository":{"id":36341680,"uuid":"222381381","full_name":"ZipCodeCore/SQL.BuildAndDestroy","owner":"ZipCodeCore","description":null,"archived":false,"fork":false,"pushed_at":"2021-12-04T06:15:58.000Z","size":5,"stargazers_count":0,"open_issues_count":31,"forks_count":55,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-08T12:41:26.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ZipCodeCore.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}},"created_at":"2019-11-18T06:47:12.000Z","updated_at":"2022-02-03T19:00:29.000Z","dependencies_parsed_at":"2022-09-06T00:40:47.554Z","dependency_job_id":null,"html_url":"https://github.com/ZipCodeCore/SQL.BuildAndDestroy","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FSQL.BuildAndDestroy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FSQL.BuildAndDestroy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FSQL.BuildAndDestroy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FSQL.BuildAndDestroy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/SQL.BuildAndDestroy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766672,"owners_count":19854114,"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":[],"created_at":"2025-01-08T12:39:28.491Z","updated_at":"2025-02-25T23:46:51.710Z","avatar_url":"https://github.com/ZipCodeCore.png","language":null,"readme":"# Build and Destroy: Introductory SQL Queries\n\nGiven the scenarios, add the the directed queries to the \"answers\" directory's files.\n\n## Creating databases\n\nWrite the correct SQL statement to create a new database called **myNewDB**.\n\n*(Add your query to the file exercise1.sql)*\n\n## Deleting databases\n\nWrite the correct SQL statement to delete a database named **myNewDB**.\n\n*(Add your query to the file exercise2.sql)*\n\n## Creating tables\n\nWrite the correct SQL statement to create a new table called **Users**, with an int field called **UserID**, and the following varchar fields of size 255: **LastName, FirstName, Address, City**\n\n*(Add your query to the file exercise3.sql)*\n\n## Deleting tables\n\nWrite the correct SQL statement to delete a table called **Users**.\n\n*(Add your query to the file exercise4.sql)*\n\n\nUse the **TRUNCATE** statement to delete all data inside the **Users** table.\n\n*(Add your query to the file exercise5.sql)*\n\n## Altering tables\n\nAdd a column of type **DATE** called **Birthday** to the **Users** table.\n\n*(Add your query to the file exercise6.sql)*\n\nDelete the column **Birthday** from the **Users** table.\n\n*(Add your query to the file exercise7.sql)*\n  \n\n## Inserting records\n\nInsert a new record in the **Students** table.\n\n**Schema:**\n \n```\nStudentName,\nAddress, \nCity, \nPostalCode,\nCountry\n```\n\n**Record's info to enter:**\n\n```\nJane Doe\n57 Union St\nGlasgow, Scotland\nG13RB\n```\n\n*(Add your query to the file exercise8.sql)*\n\n## Selecting Records\n\n### Where\n\nUse the **NOT** keyword to select all records in the **Students** table where **City** is NOT \"Philadelphia\".\n\n*(Add your query to the file exercise9.sql)*\n\nSelect all records in the **Students** table where the **City** column has the value 'Philadelphia' or 'Trenton'.\n\n*(Add your query to the file exercise10.sql)*\n\n### Order By\nSelect all records from the **Students** table, sort the result alphabetically by the column **City**.\n\n*(Add your query to the file exercise11.sql)*\n\nSelect all records from the **Students** table, sort the result reversed alphabetically by the column **City**.\n\n*(Add your query to the file exercise12.sql)*\n\nSelect all records from the **Students** table, sort the result alphabetically, first by the column **Country**, then by the column **City**.\n\n*(Add your query to the file exercise13.sql)*\n\n### Null values\nSelect all records from the **Students** where the **PostalCode** column is empty.\n\n*(Add your query to the file exercise14.sql)*\n\nSelect all records from the **Students** where the **PostalCode** column is **NOT** empty.\n\n*(Add your query to the file exercise15.sql)*\n\n\n## Updating records\nUpdate the **City** column of all records in the **Students** table and set it to \"Edinburgh\".\n\n*(Add your query to the file exercise16.sql)*\n \n Set the value of the **City** columns to \"Edinburgh\", but only the ones where the **Country** column has the value \"Scotland\".\n\n*(Add your query to the file exercise17.sql)*\n \nUpdate the **City** value and the **Country** value to \"Edinburgh\", \"Scotland\" in the **Students** table, for the Student whose ID is 35.\n\n*(Add your query to the file exercise18.sql)*\n\n## Deleting Records\nDelete all the records from the **Students** table where the **Country** value is \"Scotland\".\n\n*(Add your query to the file exercise19.sql)*\n \nDelete all the records from the **Students** table.\n\n*(Add your query to the file exercise20.sql)*\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fsql.buildanddestroy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fsql.buildanddestroy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fsql.buildanddestroy/lists"}