Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Database Systems - CREATE TABLE Statement - Creating Tables in SQL
Play lesson

Database Systems with SQL - Full Course - Database Systems - CREATE TABLE Statement - Creating Tables in SQL

5.0 (0)
6 learners

What you'll learn

This course includes

  • 4.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

The CREATE TABLE statement creates a new database table. Within this statement, you will specify the name of the table, and the data type and name of each column CREATE TABLE Movie ( ID SMALLINT UNSIGNED, Title VARCHAR(100), Rating VARCHAR(9), ReleaseDate DATE, Budget DECIMAL(10,2) ); If you need to add, modify, or delete any column in an existing database table, use the ALTER TABLE statement. To add a column: ALTER TABLE TableName ADD ColumnName DataType; To change or modify a column: ALTER TABLE TableName CHANGE CurrentColumnName NewColumnName NewDataType; To drop or delete a column: ALTER TABLE TableName DROP ColumnName; Note that if the table has a foreign key constraint that references a table's primary key, the table with primary key cannot be deleted with a DROP TABLE statement unless the table with the foreign key constraint is deleted first. Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere