The create database statement is:
CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type, .... )
but, I'm wondering how can I create a table in a specific database?
thanks, guys!
The create database statement is:
CREATE TABLE table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type, .... )
but, I'm wondering how can I create a table in a specific database?
thanks, guys!
Assuming that you have more than one database, in mysql, you can do SHOW DATABASES
to view them all and then USE
with your db name to make it the current one. Running CREATE TABLE
will then create the table in that database.
You can specify the DB Name in the same query:
CREATE TABLE database_name.table_name ( column_name1 data_type, column_name2 data_type, column_name3 data_type, .... )