diff --git a/src/data/roadmaps/sql/content/102-ddl/101-alter-table.md b/src/data/roadmaps/sql/content/102-ddl/101-alter-table.md index 066d2cdf2..6d8dd0b95 100644 --- a/src/data/roadmaps/sql/content/102-ddl/101-alter-table.md +++ b/src/data/roadmaps/sql/content/102-ddl/101-alter-table.md @@ -46,7 +46,7 @@ To modify the datatype of a column: ```sql ALTER TABLE tableName -ALTER COLUMN columnName TYPE newDataType; +MODIFY COLUMN columnName newDataType; ``` ## Add/Drop Constraints @@ -66,4 +66,10 @@ ALTER TABLE tableName DROP CONSTRAINT constraintName; ``` -In conclusion, `ALTER TABLE` in SQL lets you alter the structure of an existing table. This is a powerful command that lets you dynamically add, modify, and delete columns as well as the constraints placed on them. It ensures you are more flexible in dealing with changing data storage requirements. \ No newline at end of file +To drop PRIMARY KEY: + +```sql +ALTER TABLE table_name +DROP PRIMARY KEY; + +In conclusion, `ALTER TABLE` in SQL lets you alter the structure of an existing table. This is a powerful command that lets you dynamically add, modify, and delete columns as well as the constraints placed on them. It ensures you are more flexible in dealing with changing data storage requirements.