首页 > 代码库 > 左连接环境
左连接环境
mysql> CREATE TABLE customers -> ( -> c_id int NOT NULL AUTO_INCREMENT, -> c_name char(50) NOT NULL, -> c_address char(50) NULL, -> c_city char(50) NULL, -> c_zip char(10) NULL, -> c_contact char(50) NULL, -> c_email char(255) NULL, -> PRIMARY KEY(c_id) -> );mysql> INSERT INTO customers(c_id, c_name, c_address, c_city, c_zip, c_contact, c_email) VALUES -> (10001, ‘RedHook‘, ‘200 Street‘, ‘Tianjin‘, ‘300000‘, ‘LiMing‘, ‘LMing@163.com‘), -> (10002, ‘Stars‘, ‘333 Fromage Lane‘, ‘Dalian‘, ‘116000‘, ‘Zhangbo‘, ‘Jerry@hotmail.com‘), -> (10003, ‘Netbhood‘, ‘1 Sunny Place‘, ‘Qingdao‘, ‘266000‘, ‘LuoCong‘, NULL), -> (10004, ‘JOTO‘, ‘829 Riverside Drive‘, ‘Haikou‘, ‘570000‘, ‘YangShan‘, ‘sam@hotmail.com‘);
mysql> CREATE TABLE orders -> ( -> o_num int NOT NULL AUTO_INCREMENT, -> O_date datetime NOT NULL, -> c_id int NOT NULL, -> PRIMARY KEY(o_num) -> );mysql> INSERT INTO orders(o_num, o_date, c_id) VALUES -> (30001, ‘2008-09-01‘, 10001), -> (30002, ‘2008-09-12‘, 10003), -> (30003, ‘2008-09-30‘, 10004), -> (30004, ‘2008-10-03‘, 10005), -> (30005, ‘2008-10-08‘, 10001);
左连接环境
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。