程序交互过程
数据库表中的行称为记录,表中的列称为这些记录的字段
步骤
1.创建数据库
2.新建查询
3.创建表SQL
4.查看表中数据SQL
-- 创建表,书籍表
create table t_book(
id int,
name varchar(30),
author varchar(10),
price double
)
-- 查询数据
select * from t_book;
-- 增加
insert into t_book(id,name,author,price) values (1,'红烧肉','王一',100);
insert into t_book(id,name,author,price) values (2,'叫花鸡','王二',150);
-- 删除
delete from t_book where id = 2;
-- 修改
update t_book set price=50 where id=1;
-- 查看
select * from t_book;
select name,author from t_book;
select * from t_book where price>40;