mysql初始化表資料及插入多條資料學習筆記

心盲1029發表於2018-07-25

-- 初始化表的操作
DROP TABLE IF EXISTS register;
CREATE TABLE register (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR (10) DEFAULT NULL UNIQUE KEY,
        age tinyint UNSIGNED DEFAULT 18,
    regisTime TIMESTAMP DEFAULT CURRENT_TIMESTAMP (),
    fund DOUBLE (9, 2) DEFAULT 1000000.00,
    tel CHAR(11) NOT NULL
);



-- 插入多條資料
INSERT register(name,fund,tel) values
('berry1',10000,18900000001),
('berry2',20000,18900000002),
('berry3',30000,18900000003),
('berry4',40000,18900000004),
('berry5',50000,18900000005),
('berry6',60000,18900000006),
('berry7',70000,18900000007),
('berry8',80000,18900000008),
('berry9',90000,18900000009),
('berry10',100000,18900000010),
('berry11',110000,18900000011),
('berry12',120000,18900000012),
('berry13',130000,18900000013),
('berry14',140000,18900000014),
('berry15',150000,18900000015);


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31546585/viewspace-2158471/,如需轉載,請註明出處,否則將追究法律責任。

相關文章