#20200615. 데이터 삽입 (2)
한 일주일 시험 기간동안 갔다 와서 이제 등급 테이블을 관리해줍니다.
전에 만들었던 GitHub의 solved_ac_calculator Repository에서 정보를 빼오겠습니다.
AppliedAlpha/solved_ac_calculator
Tier Calculator For 'solved.ac' (EXE Edition). Contribute to AppliedAlpha/solved_ac_calculator development by creating an account on GitHub.
github.com
이 부분들입니다.
미리 써놓은 것들이라 데이터를 저장하는 데에 아주 효과적으로 역할을 해주었습니다.
다음은 Tier Table의 Insertion 코드문입니다.
INSERT INTO exp_table VALUES (0, 256, 'Unrated'), (1, 480, 'Bronze V'), (2, 672, 'Bronze IV'), (3, 954, 'Bronze III'), (4, 1374, 'Bronze II'), (5, 1992, 'Bronze I'), (6, 2909, 'Silver V'), (7, 4276, 'Silver IV'), (8, 6329, 'Silver III'), (9, 9430, 'Silver II'), (10, 14145, 'Silver I'), (11, 21288, 'Gold V'), (12, 32145, 'Gold IV'), (13, 48699, 'Gold III'), (14, 74023, 'Gold II'), (15, 112885, 'Gold I'), (16, 172714, 'Platinum V'), (17, 265117, 'Platinum IV'), (18, 408280, 'Platinum III'), (19, 630792, 'Platinum II'), (20, 977727, 'Platinum I'), (21, 1520366, 'Diamond V'), (22, 2371771, 'Diamond IV'), (23, 3711822, 'Diamond III'), (24, 5827560, 'Diamond II'), (25, 9178407, 'Diamond I'), (26, 14501883, 'Ruby V'), (27, 22985485, 'Ruby IV'), (28, 36546921, 'Ruby III'), (29, 58292339, 'Ruby II'), (30, 93267742, 'Ruby I');
SELECT * FROM exp_table; INSERT INTO tier_table (tier_name, min_exp, max_exp, tier) VALUES ('Bronze V', 0, 9590, 1), ('Bronze IV', 9590, 23030, 2), ('Bronze III', 23030, 42110, 3), ('Bronze II', 42110, 69590, 4), ('Bronze I', 69590, 109430, 5), ('Silver V', 109430, 182155, 6), ('Silver IV', 182155, 289055, 7), ('Silver III', 289055, 447280, 8), ('Silver II', 447280, 683030, 9), ('Silver I', 683030, 1036655, 10), ('Gold V', 1036655, 1675295, 11), ('Gold IV', 1675295, 2639645, 12), ('Gold III', 2639645, 4100615, 13), ('Gold II', 4100615, 6321305, 14), ('Gold I', 6321305, 10836705, 15), ('Platinum V', 10836705, 16018125, 16), ('Platinum IV', 16018125, 23971635, 17), ('Platinum III', 23971635, 36220035, 18), ('Platinum II', 36220035, 55143795, 19), ('Platinum I', 55143795, 84475605, 20), ('Diamond V', 84475605, 130086585, 21), ('Diamond IV', 130086585, 201244515, 22), ('Diamond III', 201244515, 312599175, 23), ('Diamond II', 312599175, 487425975, 24), ('Diamond I', 487425975, 854562255, 25), ('Ruby V', 854562255, 1434637575, 26), ('Ruby IV', 1434637575, 2354056975, 27), ('Ruby III', 2354056975, 3815933815, 28), ('Ruby II', 3815933815, 6147627375, 29), ('Ruby I', 6147627375, 999999999999, 30); SELECT * FROM tier_table; |
참 쉽죠?