From the course: MySQL Database Administration
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Creating a table using SQL code - MySQL Tutorial
From the course: MySQL Database Administration
Creating a table using SQL code
- [Presenter] Alright, next, we're going to talk about how to create a data table using SQL code. So after the schema is created, just like with the UI, we're now able to populate our schema with tables and we can do that with SQL code here. When we create a new table with code that typically involves selecting the schema, we'll execute a used statement or we can also select it from the schemas tab. Then we'll give the new table a name. We'll specify which columns we want to include and which data formats and types there'll be. And we can also put on different constraints and different properties on the table. We can name a primary key, we can make some of the columns non-null. We can make some of the columns unique so we can put on various constraints, we can put on foreign keys. And again, we'll talk about all that stuff in more depth later. Just trying to give you an overview right now. So let's jump into workbench and I'll walk you through writing the SQL code to create a new…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Creating a schema using the MySQL Workbench UI2m 54s
-
(Locked)
Creating a schema using SQL code4m 27s
-
(Locked)
Creating a table using the MySQL Workbench UI6m 52s
-
(Locked)
Creating a table using SQL code6m 3s
-
(Locked)
MySQL data types5m 40s
-
(Locked)
Challenge: Creating your own schema and tables2m 28s
-
(Locked)
Solution: Creating your own schema and tables12m 1s
-
(Locked)
Adding and removing columns using the MySQL Workbench UI13m 39s
-
(Locked)
Adding and removing columns with SQL code5m 4s
-
(Locked)
Challenge: Adding and removing columns1m 25s
-
(Locked)
Solution: Adding and removing columns6m 59s
-
(Locked)
Dropping schemas and tables6m 45s
-
(Locked)
Challenge: Dropping schemas and tables1m 46s
-
(Locked)
Solution: Dropping schemas and tables2m 22s
-
(Locked)
-
-
-
-
-
-