Question:
SQL: How to modify table design using SQL query?
Oden91
2009-01-23 23:35:02 UTC
If there is away to do this and I think there is. it will help a lot.

I need to know how to add, delete modified columns in table design.
changing the Data Type, Length, Allow Nulls, Default Value.
Five answers:
2009-01-23 23:54:01 UTC
Change data type

ALTER TABLE table_name

ALTER COLUMN column_name datatype





Add columns



ALTER TABLE table_name

ADD column_name datatype



Delete

ALTER TABLE table_name

DROP COLUMN column_name
debora
2016-05-24 13:25:11 UTC
You have 4 different things you want to store in your database: Main Category Sub Category Minute Sub Category Category So you need 4 columns. One for each. Don't try to get clever and encode the first 3 columns in a single integer field. You will go nuts trying to break the single number into the 3 components. Start with 4 columns.
Salman A
2009-01-24 03:53:41 UTC
Google for "alter table syntax".



ALTER TABLE statements are an integral part of SQL standard, just like the SELECT FROM statements.
2009-01-23 23:39:35 UTC
That would be the MODIFY TABLE command.



I linked you in the source.
2014-12-11 00:16:30 UTC
complex step. try searching over google. this will help!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...