Python基础——mysql数据库、SQLAlchemy
一、MySQL常用操作 1、创建库 create database test; 2、创建表 create table student(id int not null); 3、授权一个用户 grant all privileges on *.* to 'username'@'%' identified by 'passwd'; 其中%通配所有地址 4、查询 select * from tabel_name where 条件1 and 条件2; 5、增加数据 insert into table_name (id, name, age, sex, grander) values (1, 'jsh', 25, 'M', 99), (2, 'Tom', 45, 'F', 88); 6、删除数据 delete from table_name where 条件判断; drop table table_name; 删除表 7、改数据(更新数据) update table_name set id=10 where 条件判断; 8、联合查询 select a.id, b.name from A a joi...





