mysql> create table tb01; ERROR 1146 (42S02): Table 'da01.tb01' doesn't exist
时间: 2024-03-19 21:14:54 浏览: 103
This error occurs because you are trying to create a table without specifying the columns in it. To create a table, you need to specify the table name and the columns with their data types.
Here's an example of how to create a table named tb01 with two columns, id (integer) and name (varchar):
```
mysql> CREATE TABLE tb01 (
-> id INT,
-> name VARCHAR(50)
-> );
```
Once you've created the table, you can start adding data to it using the INSERT INTO statement.
相关问题
mysql> create table tb01 (id int,name varchar(10)); ERROR 1146 (42S02): Table 'da01.tb01' doesn't exist
This error occurs when you try to create a table named tb01 in a database named da01, but the database does not exist. You need to create the database first before creating the table.
To create a database, use the following command:
```
CREATE DATABASE da01;
```
Then, you can create the table using the following command:
```
CREATE TABLE tb01 (id INT, name VARCHAR(10));
```
This will create a table named tb01 with two columns, id and name.
阅读全文