From the course: MySQL Essential Training

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

The CREATE TABLE statement

The CREATE TABLE statement - MySQL Tutorial

From the course: MySQL Essential Training

The CREATE TABLE statement

- [Instructor] Hi, I am Bill Wyman. Just as a database contains tables, a table contains the rows and columns for a given set of data. The table definition contains the details of a data set. Because of this, the create table statement has a few more options than the create database statement. For this lesson, we'll use the scratch database. I'll go ahead and execute this use scratch statement. I've copied this create table statement from the chapter two exercise files. We'll get into the column types a bit later in this course but briefly, this is how this works. A relational database table has a set of columns with particular characteristics. The definition of those columns is within the parentheses of the create table statement. The ID column here is an integer. The name, address, and city columns are variable character strings, which are called varchar in my MySQL. And these are set with a 255 character maximum size. And the state and zip columns are fixed size character strings…

Contents