表的设计思路和应用也是有一定的关系的,你的表如何设计,常常和最终系统设计出来的项目执行效率挂钩。
列车表
/****************************************************
********************这是列车表************************
******************************************************/
DROP TABLE train;
CREATE TABLE train(
id INT AUTO_INCREMENT PRIMARY KEY, -- 设置id为主键
traincode INT NOT NULL, -- 车次的连接码,用于连接各个表
trainID CHAR(8) NOT NULL, -- 车次, 车号eg:D3790
station CHAR(10),-- 来自哪里
intime CHAR(10), -- 出站时间
outime CHAR(10), -- 进站时间
milage INT -- 里程(与始发站之间的距离)
);
SELECT traincode, station FROM train WHERE trainID = 'k1205';
-- K1205/K1208火车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120501, 'K1205','深圳','0000','1434',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120502, 'K1205','广州','1621','1641',161);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120503, 'K1205','佛山','1705','1710',248);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120504, 'K1205','肇庆','1828','1834',510);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120505, 'K1205','茂名','2158','2222',515);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120506, 'K1205','玉林','2539','2554',600);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120507, 'K1205','南宁','2949','9999',759);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120807, 'K1208','南宁','0000','2012',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120806, 'K1208','玉林','2045','2053',121);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120805, 'K1208','茂名','2123','2132',156);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120804, 'K1208','肇庆','2158','2205',255);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120803, 'K1208','佛山','2318','2321',500);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120802, 'K1208','广州','2423','2432',750);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(120801, 'K1208','深圳','2512','9999',1000);
-- D3790/D3791火车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379001, 'D3790','广州','0000','1501',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379002, 'D3790','佛山','1520','1523',76);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379003, 'D3790','肇庆','1544','1546',138);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379004, 'D3790','云浮','1607','1616',176);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379005, 'D3790','南江口','1630','1632',246);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379006, 'D3790','梧州','1654','1657',330);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379007, 'D3790','平南','1723','1725',563);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379008, 'D3790','贵港','1754','1756',574);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379009, 'D3790','南宁','1839','9999',742);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379109, 'D3791','南宁','0000','1958',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379108, 'D3791','贵港','2039','2043',250);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379107, 'D3791','平南','2112','2119',260);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379106, 'D3791','梧州','2146','2150',300);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379105, 'D3791','南江口','2212','2218',600);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379104, 'D3791','云浮','2230','2239',700);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379103, 'D3791','肇庆','2259','2309',950);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379102, 'D3791','佛山','2336','2342',1200);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(379101, 'D3791','广州','2412','9999',1223);
-- G2918/G2919火车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291801, 'G2918','深圳','0000','1221',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291802, 'G2918','虎门','1239','1241',52);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291803, 'G2918','广州','1258','1302',102);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291804, 'G2918','佛山','1321','1323',135);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291805, 'G2918','梧州','1429','1432',348);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291806, 'G2918','贵港','1523','1525',525);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291807, 'G2918','南宁','1608','9999',665);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291901, 'G2919','南宁','0000','1745',0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291902, 'G2919','贵港','1823','1830',140);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291903, 'G2919','梧州','1930','1936',317);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291904, 'G2919','佛山','2040','2043',530);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291905, 'G2919','广州','2110','2115',563);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291906, 'G2919','虎门','2125','2129',613);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(291907, 'G2919','深圳','2210','9999',665);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7201, 'G72', '福田', '0000', '0702', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7202, 'G72', '广州', '0743', '0747', 111);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7203, 'G72', '韶关', '0838', '0840', 338);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7204, 'G72', '郴州', '0911', '0916', 488);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7205, 'G72', '衡阳', '0949', '0951', 641);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7206, 'G72', '长沙', '1031', '1034', 818);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7207, 'G72', '福田', '1107', '1118', 965);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(7208, 'G72', '武汉', '1211', '9999', 1180);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20201, 'Z202', '三亚', '0000', '1722', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20202, 'Z202', '东方', '1838', '1841', 157);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20203, 'Z202', '海口', '2015', '2045', 363);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20204, 'Z202', '湛江', '2541', '2547', 669);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20205, 'Z202', '茂名', '2635', '2643', 761);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20206, 'Z202', '肇庆', '2945', '2951', 1013);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '佛山', '3132', '3137', 1100);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '广州', '3232', '3240', 1122);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '韶关', '3455', '3459', 1343);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '郴州', '3638', '3642', 1496);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '长沙', '4014', '4022', 1829);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '武昌', '4351', '4400', 2191);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '郑州', '4841', '4847', 2727);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '石家庄', '5210', '5214', 3135);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(20207, 'Z202', '北京', '5446', '9999', 3416);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92801, 'D928', '深圳', '0000', '1955', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92802, 'D928', '广州', '2027', '2030', 102);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92803, 'D928', '长沙', '2317', '2323', 809);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92804, 'D928', '邯郸', '2859', '2901', 1944);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92805, 'D928', '石家庄','2945','2950', 2119);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92806, 'D928', '定州', '3014', '3016', 2199);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92807, 'D928', '北京', '3118', '9999', 2400);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90401, 'D904', '深圳', '0000', '1945', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90402, 'D904', '广州', '2017', '2020', 102);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90403, 'D904', '长沙', '2307', '2313', 809);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90404, 'D904', '石家庄','2930','2933', 2119);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90405, 'D904', '保定', '3113', '3115', 2261);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(90406, 'D904', '北京', '3201', '9999', 2400);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(8601, 'G86', '广州', '0000', '0800', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(8602, 'G86', '长沙', '1022', '1025', 707);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(8603, 'G86', '南昌', '1144', '1147', 1049);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(8604, 'G86', '杭州', '1400', '1402', 1631);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(8605, 'G86', '上海', '1448', '9999', 1790);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17001, 'T170', '广州', '0000', '1456', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17002, 'T170', '韶关', '1711', '1718', 221);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17003, 'T170', '南雄', '1829', '1850', 314);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17004, 'T170', '大余', '1921', '1924', 352);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17005, 'T170', '赣州', '2010', '2029', 425);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17006, 'T170', '金华', '2829', '2836', 1238);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17007, 'T170', '义乌', '2911', '2915', 1286);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17008, 'T170', '诸暨', '2939', '2943', 1338);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17009, 'T170', '杭州', '3019', '3029', 1410);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17010, 'T170', '海宁', '3115', '3121', 1490);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17011, 'T170', '嘉善', '3150', '3154', 1536);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(17012, 'T170', '上海', '3247', '9999', 1598);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10001, 'G100', '广州', '0000', '1205', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10002, 'G100', '韶关', '1256', '1258', 227);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10003, 'G100', '长沙', '1434', '1440', 707);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10004, 'G100', '南昌', '1558', '1604', 1049);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10005, 'G100', '上饶', '1700', '1702', 1290);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10006, 'G100', '金华', '1747', '1749', 1470);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10007, 'G100', '杭州', '1836', '1839', 1631);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(10008, 'G100', '上海', '1927', '9999', 1790);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81801, 'G818', '深圳', '0000', '0930', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81802, 'G818', '虎门', '0947', '0949', 52);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81803, 'G818', '广州', '1006', '1015', 102);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81804, 'G818', '韶关', '1106', '1109', 329);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81805, 'G818', '郴州', '1140', '1142', 479);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81806, 'G818', '长沙', '1252', '1257', 809);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81807, 'G818', '咸宁', '1355', '1402', 1086);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81808, 'G818', '武汉', '1427', '1435', 1171);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81809, 'G818', '信阳', '1518', '1520', 1370);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81810, 'G818', '许昌', '1609', '1624', 1616);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81811, 'G818', '郑州', '1655', '1700', 1716);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81812, 'G818', '洛阳', '1739', '1741', 1841);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81813, 'G818', '灵宝', '1822', '1824', 2012);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81814, 'G818', '华山', '1841', '1843', 2100);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(81815, 'G818', '西安', '1911', '9999', 2221);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23001, 'Z230', '深圳', '0000', '0918', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23002, 'Z230', '广州', '1052', '1106', 147);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23003, 'Z230', '韶关', '1321', '1328', 368);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23004, 'Z230', '郴州', '1507', '1511', 521);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23005, 'Z230', '衡阳', '1650', '1654', 668);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23006, 'Z230', '长沙', '1850', '1858', 854);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23007, 'Z230', '岳阳', '2016', '2022', 1001);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23008, 'Z230', '武昌', '2232', '2254', 1216);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23009, 'Z230', '襄阳', '2531', '2550', 1538);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23010, 'Z230', '南阳', '2734', '2801', 1667);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23011, 'Z230', '渭南', '3215', '3217', 2068);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23012, 'Z230', '西安', '3304', '3312', 2119);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23013, 'Z230', '宝鸡', '3445', '3510', 2292);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23014, 'Z230', '天水', '3642', '3648', 2447);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23015, 'Z230', '兰州', '4029', '4044', 2795);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23016, 'Z230', '武威', '4343', '4350', 3098);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23017, 'Z230', '金昌', '4423', '4428', 3172);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23018, 'Z230', '张掖', '4606', '4412', 3342);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23019, 'Z230', '嘉峪关', '4809', '4817', 3565);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23020, 'Z230', '柳园', '5101', '5103', 3862);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23021, 'Z230', '哈密', '5346', '5456', 4183);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23022, 'Z230', '吐鲁番', '5629', '5631', 4555);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(23023, 'Z230', '乌鲁木齐', '5802', '9999', 4722);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11201, 'Z112', '海口', '0000', '1746', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11202, 'Z112', '徐闻', '2113', '2124', 193);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11203, 'Z112', '雷州', '2217', '2228', 262);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11204, 'Z112', '湛江', '2309', '2315', 306);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11205, 'Z112', '茂名', '2403', '2408', 398);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11206, 'Z112', '肇庆', '2811', '2816', 650);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11207, 'Z112', '佛山', '2952', '3000', 737);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11208, 'Z112', '广州', '3111', '3136', 759);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11209, 'Z112', '韶关', '3351', '3357', 980);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11210, 'Z112', '赣州', '3539', '3602', 1184);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11211, 'Z112', '吉安', '3748', '3752', 1370);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11212, 'Z112', '南昌', '4052', '4105', 1596);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11213, 'Z112', '九江', '4211', '4215', 1738);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11214, 'Z112', '菏泽', '4853', '4856', 2470);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11215, 'Z112', '天津', '5357', '5406', 3047);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11216, 'Z112', '唐山', '5518', '5520', 3170);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11217, 'Z112', '山海关', '5706', '5713', 3348);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11218, 'Z112', '锦州', '5911', '5915', 3532);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11219, 'Z112', '沈阳', '6134', '6138', 3765);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(11220, 'Z112', '长春', '6405', '9999', 4065);
#广州到长春的列车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38601, 'Z386', '三亚', '0000', '0802', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38602, 'Z386', '东方', '0918', '0924', 157);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38603, 'Z386', '海口', '1100', '1150', 363);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38604, 'Z386', '湛江', '1640', '1646', 669);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38605, 'Z386', '茂名', '1734', '1740', 761);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38606, 'Z386', '肇庆', '2043', '2046', 1013);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38607, 'Z386', '佛山', '2152', '2155', 1100);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38608, 'Z386', '广州', '2222', '2242', 1122);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38609, 'Z386', '韶关', '2409', '2503', 1343);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38610, 'Z386', '衡阳', '2822', '2842', 1643);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38611, 'Z386', '井冈山', '3122', '3126', 1953);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38612, 'Z386', '吉安', '3229', '3233', 2179);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38613, 'Z386', '南昌', '3441', '3456', 2314);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38614, 'Z386', '九江', '3619', '3623', 2773);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38615, 'Z386', '亳州', '4152', '4155', 2877);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38616, 'Z386', '商丘', '4232', '3236', 2941);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38617, 'Z386', '菏泽', '4329', '4331', 3046);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38618, 'Z386', '聊城', '4428', '4430', 3202);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38619, 'Z386', '衡水', '4621', '4628', 3354);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38620, 'Z386', '任丘', '4701', '4706', 3481);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38621, 'Z386', '天津', '4945', '5000', 3623);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38622, 'Z386', '唐山', '5146', '5157', 3746);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38623, 'Z386', '秦皇岛', '5323', '5331', 3908);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38624, 'Z386', '山海关', '5345', '5349', 3924);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38625, 'Z386', '锦州', '5508', '5514', 4089);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38626, 'Z386', '沈阳', '5705', '5713', 4312);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38627, 'Z386', '四平', '5845', '5847', 4497);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(38628, 'Z386', '长春', '5945', '9999', 4612);
#广州到拉萨的车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26401, 'Z264', '广州', '0000', '1140', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26402, 'Z264', '郴州', '1531', '1534', 347);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26403, 'Z264', '长沙', '1904', '1912', 707);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26404, 'Z264', '武昌', '2239', '2300', 1069);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26405, 'Z264', '郑州', '2740', '2746', 1605);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26406, 'Z264', '西安', '3346', '3350', 2116);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26407, 'Z264', '兰州', '4045', '4100', 2792);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26408, 'Z264', '西宁', '4323', '4348', 3008);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26409, 'Z264', '德令哈', '4751', '4753', 3525);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26410, 'Z264', '格尔木', '5020', '5045', 3837);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26411, 'Z264', '安多', '5854', '5858', 4531);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26412, 'Z264', '那曲', '6017', '6024', 4657);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(26413, 'Z264', '拉萨', '6445', '9999', 4979);
#广州到成都的列车
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451201, 'G4512', '福田', '0000', '1020', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451202, 'G4512', '深圳', '1028', '1032', 9);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451203, 'G4512', '虎口', '1049', '1051', 61);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451204, 'G4512', '广州', '1108', '1112', 111);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451205, 'G4512', '肇庆', '1147', '1149', 187);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451206, 'G4512', '桂林', '1334', '1338', 555);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451207, 'G4512', '贵阳', '1537', '1541', 968);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451208, 'G4512', '宜宾', '1723', '1727', 1340);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451209, 'G4512', '乐山', '1808', '1810', 1487);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(451210, 'G4512', '成都', '1856', '9999', 1616);
#广州到重庆
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77601, 'K776', '东莞', '0000', '0926', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77602, 'K776', '广州', '1052', '1056', 94);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77603, 'K776', '源潭', '1155', '1158', 162);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77604, 'K776', '韶关', '1337', '1342', 315);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77605, 'K776', '坪石', '1442', '1448', 402);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77606, 'K776', '郴州', '1540', '1542', 468);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77608, 'K776', '衡阳', '1728', '1731', 615);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77609, 'K776', '湘潭', '1947', '1951', 775);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77610, 'K776', '娄底', '2059', '2103', 874);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77611, 'K776', '新化', '2141', '2149', 916);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77612, 'K776', '怀化', '2223', '2236', 1189);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77613, 'K776', '铜仁', '2536', '2542', 1282);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77614, 'K776', '秀山', '2704', '2712', 1385);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77615, 'K776', '武隆', '2902', '2909', 1624);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77616, 'K776', '涪陵', '3147', '3152', 1691);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77617, 'K776', '重庆', '3249', '3253', 1791);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77618, 'K776', '南充', '3443', '3452', 1956);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77619, 'K776', '广元', '3903', '3911', 2144);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77620, 'K776', '陇南', '4055', '4059', 2283);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(77621, 'K776', '兰州', '4547', '9999', 2663);
#广州到六盘水
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295601, 'G2956', '广州', '0000', '1507', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295602, 'G2956', '韶关', '1558', '1604', 227);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295603, 'G2956', '郴州', '1635', '1637', 377);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295604, 'G2956', '衡阳', '1710', '1714', 530);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295605, 'G2956', '邵阳', '1819', '1822', 680);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295606, 'G2956', '隆回', '1842', '1844', 725);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295607, 'G2956', '洞口', '1902', '1904', 768);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295608, 'G2956', '安江', '1925', '1927', 821);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295609, 'G2956', '怀化', '1948', '1954', 863);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295610, 'G2956', '芷江', '2000', '2022', 883);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295611, 'G2956', '铜仁', '2023', '2025', 956);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295612, 'G2956', '凯里', '2100', '2102', 1096);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295613, 'G2956', '贵阳', '2140', '2144', 1324);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295614, 'G2956', '安顺', '2214', '2216', 1374);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(295615, 'G2956', '六盘水', '2308', '9999', 1449);
#长春到吉林(因为龙嘉不是城市,所以除去了)
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(122901, 'C1229', '长春', '0000', '1816', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(122902, 'C1229', '吉林', '1901', '9999', 111);
#长春到佳木斯
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92901, 'k929', '大连', '0000', '1639', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92902, 'k929', '金州', '1704', '1707', 33);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92903, 'k929', '盖州', '1740', '1748', 210);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92904, 'k929', '沈阳', '1803', '1809', 397);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92905, 'k929', '铁岭', '2252', '2254', 468);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92906, 'k929', '四平', '2412', '2415', 585);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92907, 'k929', '长春', '2534', '2548', 700);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92908, 'k929', '哈尔滨', '2838', '2903', 955);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92910, 'k929', '绥化', '3042', '3047', 1083);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(92911, 'k929', '佳木斯', '3641', '9999', 1465);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(9001, 'k90', '呼和浩特', '0000', '2142', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(9002, 'k90', '集宁', '2154', '2156', 139);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(9003, 'k90', '大同', '2325', '2331', 266);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(9004, 'k90', '张家口', '2800', '2809', 444);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(9005, 'k90', '北京', '3130', '9999', 634);
#广州到福州
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160701, 'G1607', '广州', '0000', '1454', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160702, 'G1607', '虎门', '1511', '1522', 50);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160703, 'G1607', '深圳', '1540', '1547', 102);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160704, 'G1607', '潮汕', '1734', '1736', 407);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160705, 'G1607', '厦门', '1921', '1926', 616);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160706, 'G1607', '泉州', '1954', '1956', 687);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160707, 'G1607', '莆田', '2020', '2022', 756);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(160708, 'G1607', '福州', '2106', '9999', 861);
#广州到南京
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112801, 'G1128', '广州', '0000', '1513', 0);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112802, 'G1128', '郴州', '1630', '1635', 377);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112803, 'G1128', '长沙', '1759', '1802', 707);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112804, 'G1128', '岳阳', '1843', '1851', 854);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112805, 'G1128', '赤壁', '1907', '1912', 941);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112806, 'G1128', '武汉', '1943', '1948', 1069);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112807, 'G1128', '合肥', '2140', '2145', 1424);
INSERT INTO train (traincode, trainID, station, intime, outime, milage) VALUES(112808, 'G1128', '南京', '2234', '9999', 1581);
# 【查询0】总的列车表
SELECT t1.trainID 车次, t1.station 出发车站, t2.station 到达车站, t1.outime 出发时间, t2.intime 到站时间, (t2.milage-t1.milage) 里程
FROM train t1, train t2
WHERE t1.trainid = t2.trainid AND t1.outime < t2.intime AND (t2.milage-t1.milage) > 0;
#【查询1】查询一共通过多少城市
SELECT station FROM train GROUP BY station;
#【查询1】查询一共多少列车
SELECT trainid ,COUNT(trainid) FROM train GROUP BY trainid;
#【查询1】哪些列车经过长春站
SELECT trainid FROM train WHERE station = '广州';
#【查询2】A -- B的列车
SELECT t1.trainID 车次, t1.station 出发车站, t2.station 到达车站, t1.outime 出发时间, t2.intime 到站时间, (t2.milage - t1.milage) 里程 FROM
(SELECT * FROM train WHERE station = '广州') t1,-- 起始站
(SELECT * FROM train WHERE station = '南宁') t2 -- 到达站
WHERE t1.trainID = t2.trainID AND t2.intime > t1.outime;
#【查询3】A——B——C查询中转车怎么走
#广州——南宁
SELECT * FROM train WHERE station = '广州' ;
售票信息表
/****************************************************
********************【售票信息表】**********************
******************************************************/
CREATE TABLE ticket (
id INT AUTO_INCREMENT PRIMARY KEY,
trainid CHAR(5), -- 车次
tdate CHAR(8), -- 出发日期
sp CHAR(20), -- 出发站
ep CHAR(20), -- 终到站
kind CHAR(1), -- 票种
seatype CHAR(2), -- 坐席等级
tnum CHAR(2), -- 列车号
snum CHAR(3), -- 座位号
price DECIMAL(5,1) -- 价格
);
座位表
/****************************************************
********************这是列车的座位表********************
******************************************************/
DROP TABLE train_md;
SELECT * FROM train_md;
#列车详细信息表:
CREATE TABLE train_md(
id INT AUTO_INCREMENT PRIMARY KEY,
trainid CHAR(5),
sw CHAR(1), swnum CHAR(10), swg CHAR(30), -- 商务车 一节商务车能坐多少人
yd CHAR(1), ydnum CHAR(10), ydg CHAR(30), -- 一等座
ed CHAR(1), ednum CHAR(10), edg CHAR(30), -- 二等座
rw CHAR(1), rwnum CHAR(10), rwg CHAR(30), -- 软卧
yw CHAR(1), ywnum CHAR(10), ywg CHAR(30), -- 硬卧
yz CHAR(1), yznum CHAR(10), yzg CHAR(30) -- 硬座
);
#车上已有的座位
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('k1205', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('k1208', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('z386', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('Z264', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('Z230', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('Z202', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('Z112', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('T170', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('k929', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('k90', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('k776', 0, 3, '', 0, 8, '', 0, 6, '', 3, 3, '1-2-3', 4, 6, '4-5-6-7', 3, 5, '8-9-10');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G86', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G818', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G72', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G4512', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G2956', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G2919', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G2918', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('G100', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('D100', 5, 10, '1-2-3-4-5', 2, 8, '6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('D928', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('D904', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('D3791', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('D3790', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');
INSERT INTO train_md (trainid,sw,swnum,swg,yd,ydnum,ydg,ed,ednum,edg,rw,rwnum,rwg,yw,ywnum,ywg,yz,yznum,yzg) VALUES
('C1229', 3, 10, '1-2-3', 4, 8, '4-5-6-7', 5, 6, '8-9-10-11-12', 0, 0, '', 0, 0, '', 0, 0, '');