课程: PHP with MySQL Essential Training: 1 The Basics

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Create a database table

Create a database table

- [Instructor] In the last movie, we created a database that we could use. And now we're ready to add our first table to that database. The way that you create a table in MySQL is using this syntax: CREATE TABLE, and then the table name you want to create; and then inside parentheses, you're going to provide a set of definitions for what the columns in that table are going to look like. So you have column_name1 and then its definition, a comma, and then column_name2 and its definition, and so on. And at the end, there's the opportunity to provide a few extra options for how you're going to create that table. We'll look at this in more detail. Once you've created the table, then you can show the tables, just like we showed databases. We can call SHOW TABLES to know what the tables are. We can show the columns that are from that table to see what its structure looks like. And we can drop the table; just like we dropped the database, you can drop a whole table, which of course erases all…

内容