CREATE DATABASE account_receivable;
use account_receivable;
create table accounts_info(
uuid varchar(32) primary key,
pname varchar (32),
income float,
cost float,
sale_date date,
sale_num float,
sale_price float,
cost_price float);
insert into accounts_info(
uuid,pname,income,cost,sale_date,sale_num,sale_price,cost_price)
values('00002','产品B',1239.87,
208.24,20201020,80.67,19.3,2.71);
select*from accounts_info;
insert into accounts_info()
values ('00001','产品A',1240.87,209.24,20201021,82.67,19.3,2.71);
select*from accounts_info;Insert into accounts_info
values('00003','产品C',8893.27,7653.59,20201019,89.96,89.97,85.17),
('00004','产品D',1171.03,686.7,28201011,71.33,16.42,0),
('00005','产品E',1428.47,6324.22,20201025,55.85,25.58,113.24),
('00006','产品E',9519.28,2345.25,20201029,45.61,208.72,51.42),
('00007','产品G',2288.56,2679.57,20201021,12.97,176.44,206.59),
('00008','产品H',8177.03,3062.68,20201023,68.82,118.82,44.5),
('00009','产品I',7920.36,3803.42,20201026,14.29,554.27,266.17),
('00010','产品J',6185.89,1040.76,20201001,41.86,144.32,24.28),
('00011','产品A',1630,281,20201027,100,16.3,2.81);
select*from accounts_info;
select*from accounts_info where income>1240;
select pname,sale_num,sale_price,sale_date from accounts_info where sale_date between'20201021'and'2021026';
select*from accounts_info where sale_date>'2020-10-27';
select pname,sale_date,sale_price from accounts_info where sale_price>2;
select*from accounts_info where sale_date='2020-10-21';