SQL Server 表中记录更新操作
一、 实验目的
USE eshop INSERT INTO members VALUES('jinjin','津津有味','女','1982-04-14','北京市',8200.0, 'jinjin') INSERT INTO members VALUES('liuzc518','刘志成','男','1972-05-18','湖南株洲',3500.0,'liuzc518')
USE eshop UPDATE members SET m_name='刘津' WHERE m_name='津津有味'
USE eshop UPDATE members SET m_salary=m_salary*(1+0.20) WHERE m_sex='男' AND m_address='湖南株洲'
USE eshop DELETE FROM members WHERE m_address='北京市'
USE eshop DELETE FROM members
USE eshop INSERT INTO members VALUES('Jinjin', '津津有味', '女', '1982-04-14', '北京市', 8200.0, 'jinjin') INSERT INTO members VALUES('Lfz', '刘法治', '男', '1976-08-26', '天津市', 4500.0, 'lfz0826') INSERT INTO members VALUES('liuzc518', '刘志成', '男', '1972-05-18', '湖南株洲', 3500.0, 'liuzc518') INSERT INTO members VALUES('Wangym', '王咏梅', '女', '1974-08-06', '湖南长沙', 4000.0, 'wangym0806') INSERT INTO members VALUES('Zhangzl', '张自梁', '男', '1975-04-20', '湖南株洲', 4300.0, 'zhangzl') INSERT INTO members VALUES('zhao888', '赵爱云', '男', '1972-02-12', '湖南株洲', 5500.0, 'zhao888')
USE eshop INSERT INTO products VALUES('0130810324', '清华同方电脑', '2005-12-11', 7, 8000.0, '优惠多多') INSERT INTO products VALUES('0140810330', '洗衣粉', '2005-05-31', 1000, 8.6, '特价销售') INSERT INTO products VALUES('0140810332', '红彤彤腊肉', '2005-05-20', 43, 15.0, '是一种卫生食品') INSERT INTO products VALUES('0140810333', '力士牌香皂', '2005-05-06', 22, 6.0, '是一种清洁用品') INSERT INTO products VALUES('0240810330', '电动自行车', '2005-05-31', 10, 1586.0, '价廉物美') INSERT INTO products VALUES('0240810333', '自行车', '2005-05-31', 10, 586.0, '价廉物美') INSERT INTO products VALUES('0910810001', '爱国者MP3', '2005-05-31', 100, 450.0, '价廉物美') INSERT INTO products VALUES('0910810002', '商务通', '2005-05-20', 10, 850.0, '价廉物美') INSERT INTO products VALUES('0910810003', '名人好记星', '2005-05-31', 100, 550.0, '价廉物美') INSERT INTO products VALUES('0910810004', '奥美嘉 U盘', '2005-05-31', 100, 350.0, '价廉物美')
USE eshop INSERT INTO orders VALUES('0000000001','jinjin', '0910810004', 2, '2005-06-06', '1', '0', '0') INSERT INTO orders VALUES('0000000003','jinjin', '0910810004', 1, '2005-08-09', '1', '1', '1') INSERT INTO orders VALUES('0000000002','lfz', '0910810001', 1, '2005-08-09', '0', '0', '0') INSERT INTO orders VALUES('0000000004','lfz', '0910810004', 2, '2005-06-06', '1', '1', '1') INSERT INTO orders VALUES('0000000005','lfz', '0910810004', 2, '2005-08-09', '1', '1', '1') INSERT INTO orders VALUES('0000000006','liuzc518', '0140810324', 1, '2005-10-09', '0', '0', '0') INSERT INTO orders VALUES('0000000010','liuzc518', '0910810001', 1, '2005-10-09', '1', '1', '0') INSERT INTO orders VALUES('0000000007',’liuzc518', '0910810004', 2, '2005-10-09', '1', '1', '0') INSERT INTO orders VALUES('0000000008','wangym', '0910810001', 1, '2005-08-09', '1', '0', '0') INSERT INTO orders VALUES('0000000009','zhao888', '0240810333', 2, '2005-06-06', '1', '1', '0')后续
如果想了解更多物联网、智能家居项目知识,可以关注我的项目实战专栏。
或者关注公众号。
编写不易,感谢支持。