mysql> create table tb01 (id int,name varchar(10)); ERROR 1146 (42S02): Table 'da01.tb01' doesn't exist
时间: 2024-05-14 10:15:15 浏览: 95
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.
相关问题
mysql> create table tb01; ERROR 1146 (42S02): Table 'da01.tb01' doesn't exist
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.
爬取东方财富数据中的经济数据
以下是爬取东方财富网站经济数据的示例代码:
```python
import requests
from bs4 import BeautifulSoup
url = 'http://data.eastmoney.com/cjsj/gdp.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
table = soup.find('table', {'class': 'tb01'})
rows = table.find_all('tr')
for row in rows:
cols = row.find_all('td')
cols = [col.text.strip() for col in cols]
print(cols)
```
这段代码将爬取东方财富网站上的GDP数据,并将其打印出来。你可以根据需要修改代码以爬取其他经济数据。
阅读全文