1.删除表

drop  table +表名

2.修改表

alter  table+表名+ add(添加)+列名+ int(类型)

alter  table+表名+ drop(删除)+column(列)+列名

3.删除数据库

Drop  datebase +库名

 

CRUD操作

C代表create 添加数据

R代表 read  读取数据

U代表update 修改数据

D代表delete 删除数据

1.添加数据

Insert(插入/添加) into+ 表名+ values(添加的值) ,‘  ’转换字符串

Insert  into 表名 values(‘列名’,‘列名’)

Insert  into 表名 values(‘n003’,‘’)

多列添加:Insert  into  表名(列名,列名) values(‘n003’,‘维吾尔族’)

Insert  into friends values(‘p003’,‘p007’)

2.删除数据

delete  from 表名 删除所有

delete  from 表名 where ids=5

3.修改数据

update  表名 set  fcode=‘’p016’ 修改所有

update  表名 set  fcode=‘p006’  mcode=‘p002’where ids=4 修改ids=3的fcode的数据

update  表名 set  fcode=‘p016’ , mcode='p002' where ids=6

 

SQL中,布尔型的数据也需要加单引号

相关文章:

  • 2022-12-23
  • 2021-06-25
  • 2022-01-05
  • 2021-06-12
  • 2021-06-05
  • 2022-01-02
  • 2021-06-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
相关资源
相似解决方案