After sql creates a table, you can use the ALTER TABLE statement to input data. The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. If you need to add columns to the table, you can use the syntax "ALTER TABLE table_name ADD column_name...".
#The operating environment of this article: Windows 7 system, SQL Server 2016, Dell G3 computer.
After sql creates a table, you can use the ALTER TABLE statement to input data. The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.
If you need to add a column to the table, please use the following syntax:
ALTER TABLE table_name ADD column_name datatype
If you need to delete a column in the table, please use the following syntax (please note that some database systems do not allow This way of deleting a column in a database table):
ALTER TABLE table_name DROP COLUMN column_name
Example:
Add a column named "DateOfBirth" to the "Persons" table.
ALTER TABLE Persons ADD DateOfBirth date
Related recommendations: "SQL Tutorial"
The above is the detailed content of How to enter data after sql creates table. For more information, please follow other related articles on the PHP Chinese website!