1
INSERT INTO goods VALUES(4,'ipad', 3000, 10);
2
DELETE FROM `user`
WHERE user_id = 3;
3
UPDATE `user`
SET address = '四川合江荔城大道500号'
WHERE user_id = 1;
4
SELECT username, address, CASE sex WHEN 1 THEN '男' ELSE '女' END as 性别
FROM user;
5
6
SELECT *
FROM user
WHERE phone LIKE '%8%8%';
7
8
SELECT *
FROM goods
ORDER BY stock ASC, price ASC
9
SELECT sex, COUNT(*)
FROM user
GROUP BY sex;
5.SELECT user.username, goods.goods_name, orders.num,SUM(price*num)
FROM `user` JOIN orders ON `user` .user_id=orders.user_id
JOIN goods ON goods.goods_id=orders.goods_id
WHERE STATUS=3;
7.SELECT *
FROM user ,goods
WHERE user_id =goods_id && username = '伍容华';