create
INSERT INTO tablename (name,age) VALUES ('hh','12')
update
UPDATE tablename SET name=18 WHERE id=0
read
select * from tablename where name=18
delete
DELETE FROM tablename WHERE id=1
RAND() ROUND() CEIL() FLOOR()
RAND() | 生成[0,1)的随机数 | rand() --> 属于[0,1), rand() * 6 --> 属于[0,6) ,达不到6,可以达到5 rand() * 6 + 5 --> 属于[5,11) ,达不到11,可以达到10 floor(rand() * 6 + 5) --> 属于[5,10] |
ROUND() | round(s,n):对s四舍五入保留n位小数,n取值可为正、负、零;如四舍五入到整数位,则n取零. | |
CEIL() | 向上取整 ceil(s):返回比s大的最小整数 | |
FLOOR() | 向下取整 floor(s):返回比s小的最大整数 |