1. 程式人生 > >內連接環境

內連接環境

_id call its xxx bsp cme ngs shang mon

mysql> CREATE TABLE fruits
    -> (
    -> f_id    char(10)  NOT NULL,
    -> s_id    int       NOT NULL,
    -> f_name  char(255) NOT NULL,
    -> f_price decimal(8,2)  NOT NULL,
    -> PRIMARY KEY(f_id)
    -> );
 
mysql> INSERT INTO fruits(f_id, s_id, f_name, f_price) VALUES
    -> (‘a1‘, 101, ‘apple‘, 5.2),
    -> (‘b1‘, 101, ‘blackberry‘, 10.2),
    -> (‘bs1‘, 102, ‘orange‘, 11.2),
    -> (‘bs2‘, 105, ‘melon‘, 8.2),
    -> (‘t1‘, 102, ‘banana‘, 10.3),
    -> (‘t2‘, 102, ‘grape‘, 5.3),
    -> (‘o2‘, 103, ‘coconut‘, 9.2),
    -> (‘c0‘, 101, ‘cherry‘, 3.2),
    -> (‘a2‘, 103, ‘apricot‘, 2.2),
    -> (‘l2‘, 104, ‘lemon‘, 6.4),
    -> (‘b2‘, 104, ‘berry‘, 7.6),
    -> (‘m1‘, 106, ‘mango‘, 15.7),
    -> (‘m2‘, 105, ‘xbabay‘, 2.6),
    -> (‘t4‘, 107, ‘xbababa‘, 3.6),
    -> (‘m3‘, 105, ‘xxtt‘, 11.6),
    -> (‘b5‘, 107, ‘xxxx‘, 3.6);
mysql> CREATE TABLE suppliers
    -> (
    -> s_id    int       NOT NULL AUTO_INCREMENT,
    -> s_name  char(50)  NOT NULL,
    -> s_city  char(50)  NULL,
    -> s_zip   char(10)  NULL,
    -> s_call  char(50)  NOT NULL,
    -> PRIMARY KEY (s_id)
    -> );

mysql> INSERT INTO suppliers(s_id, s_name, s_city, s_zip, s_call) VALUES
    -> (101, ‘FastFruit Inc.‘, ‘Tianjin‘, ‘300000‘, ‘48075‘),
    -> (102, ‘LT Supplies‘, ‘Chongqing‘, ‘400000‘, ‘44333‘),
    -> (103, ‘ACME‘, ‘Shanghai‘, ‘200000‘, ‘90046‘),
    -> (104, ‘FNK Inc.‘, ‘Zhongshan‘, ‘528437‘, ‘11111‘),
    -> (105, ‘Good Set‘, ‘Taiyuang‘, ‘030000‘, ‘22222‘),
    -> (106, ‘Just Eat Ours‘, ‘Beijing‘, ‘010‘, ‘45678‘),
    -> (107, ‘DK Inc.‘, ‘Zhengzhou‘, ‘450000‘, ‘33332‘);

內連接環境