node init -y
npm install nodemon -D
use myblog;
show tables;
insert into blogs (title, content, author, createdAt) values ('标题1', '内容1', '张三', 1234567890123);
select * from blogs; // 查询整张数据表 select id,author from blogs; select * from blogs where title='标题1' and author='张三'; select * from blogs where title='标题1' or author='张三'; select * from blogs where title like '%1%'; select * from blogs where author like '%张%' order by id desc;
update blogs set title='标题3' where content='内容1';
delete from blogs where title='标题2'
update blogs set state='0' where id='3'; // 删除id=3的记录 select * from blogs where state<>0; // 查询有效数据 <>表示不等于