怎么解决[SQL]drop table if exists ta_brand; 受影响的行: 0 时间: 0.004s [SQL] create table tb_brand ( id int primaty key auto_increment, brand_name varchar(20), company_name varchar(20), ordered int, description varchar(100), status int ); [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primaty key auto_increment, brand_name varchar(20), company_name varchar(2' at line 3
时间: 2024-01-28 18:02:51 浏览: 164
在你的 SQL 语句中,"primaty" 应该是 "primary",将其拼写更正即可。正确的 create table 语句如下:
```
create table tb_brand (
id int primary key auto_increment,
brand_name varchar(20),
company_name varchar(20),
ordered int,
description varchar(100),
status int
);
```
此外,如果你的 drop table if exists 语句受影响的行为 0,可能是因为该表不存在。你可以通过 show tables 命令来查看当前数据库中存在哪些表。如果表不存在,那么执行 drop table 语句也会受到影响行数为 0 的提示。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![sql](https://img-home.csdnimg.cn/images/20250102104920.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![pptx](https://img-home.csdnimg.cn/images/20241231044947.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)