{"id":18538563,"url":"https://github.com/shaikahmadnawaz/mysql","last_synced_at":"2025-06-17T01:34:30.091Z","repository":{"id":113666457,"uuid":"588526283","full_name":"shaikahmadnawaz/mysql","owner":"shaikahmadnawaz","description":"MySQL is an open-source relational database management system 🗃️","archived":false,"fork":false,"pushed_at":"2023-01-13T11:50:47.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T07:45:32.052Z","etag":null,"topics":["mysql","mysql-database","rdbms","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/shaikahmadnawaz.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":"2023-01-13T10:35:33.000Z","updated_at":"2023-03-07T03:37:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"150e0c0a-1e2f-4e11-91e7-5fe068926392","html_url":"https://github.com/shaikahmadnawaz/mysql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikahmadnawaz%2Fmysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikahmadnawaz%2Fmysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikahmadnawaz%2Fmysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaikahmadnawaz%2Fmysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaikahmadnawaz","download_url":"https://codeload.github.com/shaikahmadnawaz/mysql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259439,"owners_count":22040821,"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":["mysql","mysql-database","rdbms","sql"],"created_at":"2024-11-06T19:44:26.395Z","updated_at":"2025-05-15T02:12:35.598Z","avatar_url":"https://github.com/shaikahmadnawaz.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MySQL\n\n## Databases\n\nA database is a structured collection of data\n\n**To create a database:**\n\n```\nCREATE DATABASE myDB;\n```\n\nThere is no case sensitivity in mysql\n\n**To use a database:**\n\n```\nUSE myDB;\n```\n\n**To drop a database:**\n\n```\nDROP DATABASE myDB;\n```\n\n**Setting a database to read only:**\n\n```\nALTER DATABASE myDB READ ONLY = 1;\n```\n\nThis statement will make the database read only, if the database is read only mode we cannot make any modifications to the database but we can access the data within.\n\n```\nALTER DATABASE myDB READ ONLY = 0;\n```\n\nNow we can do modifications to the database.\n\n## Tables\n\nA table in RDBMS consists of rows and columns.\n\n**We can create a table like this:**\n\n```\nCREATE TABLE employees (\n    employee_id INT,\n    first_name VARCHAR(50),\n    last_name VARCHAR(50),\n    hourly_pay DECIMAL(5, 2),\n    hire_date DATE\n);\n```\n\n**we select a table like this:**\n\n```\nSELECT * FROM employees;\n```\n\n**We can also rename the table:**\n\n```\nRENAME TABLE employees TO people;\n```\n\n**To drop a table:**\n\n```\nDROP TABLE employees;\n```\n\n**To alter the table:**\n\n```\nALTER TABLE employees\nADD phone_number VARCHAR(15);\n```\n\n**To alter the column name:**\n\n```\nALTER TABLE employees\nRENAME COLUMN phone_number TO email;\n```\n\n**To change the type of the column:**\n\n```\nALTER TABLE employees\nMODIFY COLUMN employee_id VARCHAR(5);\n```\n\n**We can also change size of the column:**\n\n```\nALTER TABLE employees\nMODIFY COLUMN employee_id VARCHAR(10);\n```\n\n**We can also change the position of the columns:**\n\n```\nALTER TABLE employees\nMODIFY email VARCHAR(15)\nAFTER last_name;\n```\n\n**To drop a column:**\n\n```\nALTER TABLE employees\nDROP COLUMN hire_date;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaikahmadnawaz%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaikahmadnawaz%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaikahmadnawaz%2Fmysql/lists"}