populate_tables.sql 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. -- Trucks
  2. INSERT INTO truck(tru_id, tru_available)
  3. VALUES
  4. ('AC-543-AG', true),
  5. ('AD-671-TR', true),
  6. ('AH-126-GG', true),
  7. ('AM-654-TU', true),
  8. ('BA-865-PF', true),
  9. ('BA-921-AA', false);
  10. -- Drivers
  11. INSERT INTO driver(dri_firstname, dri_lastname, dri_available, tru_id)
  12. VALUES
  13. ('Arthur', 'DENT', true, 'AC-543-AG'),
  14. ('Henry', 'LE ROC’H', true, 'BA-865-PF'),
  15. ('Hervé', 'DUPUIS', true, 'AH-126-GG'),
  16. ('Jacques', 'WEBER', true, 'BA-921-AA');
  17. -- Loadings docks
  18. INSERT INTO postaladdress(
  19. add_number, add_name, add_city)
  20. VALUES
  21. (5, 'allée Beltégueuse', 'Soumoulou'),
  22. (15, 'rue des Rochers', 'Metz'),
  23. (10, 'boulevard des marins', 'Nice');
  24. INSERT INTO loadingpoint(add_id)
  25. VALUES (1), (2), (3);
  26. -- Companies
  27. INSERT INTO postaladdress(add_id, add_number, add_name, add_city)
  28. VALUES
  29. (4, 12, 'boulevard Wezemir', 'Paris'),
  30. (5, 1, 'cours Saint Pierre', 'Bordeaux'),
  31. (6, 24, 'rue du pont', 'Angers');
  32. INSERT INTO company(com_id, com_name, add_id)
  33. VALUES
  34. (1, 'Vegans Ltd', 4),
  35. (2, 'Wizima', 5),
  36. (3, 'SunnyCorp', 6);
  37. -- Warehouses
  38. INSERT INTO postaladdress(add_id, add_number, add_name, add_city)
  39. VALUES
  40. (7, 5, 'allée des rémouleurs', 'Pau'),
  41. (8, 25, 'impasse des tulipes', 'Bayonne'),
  42. (9, 2, 'rue des plantes', 'Marseille'),
  43. (10, 67, 'rue des 5 portes', 'Brest'),
  44. (11, 8, 'rue des marchands', 'Tarbes'),
  45. (12, 1, 'rue de la braderie', 'Lille'),
  46. (13, 32, 'impasse des lumières', 'Lyon'),
  47. (14, 14, 'rue de la tour', 'Narbonne'),
  48. (15, 7, 'impasse des 3 saules', 'Strasbourg');
  49. INSERT INTO warehouse(com_id, add_id)
  50. VALUES
  51. (1, 7),
  52. (1, 8),
  53. (1, 9),
  54. (1, 10),
  55. (2, 11),
  56. (2, 12),
  57. (2, 13),
  58. (3, 14),
  59. (3, 15);
  60. -- Orders
  61. INSERT INTO product(pro_name)
  62. VALUES
  63. ('Watermelon'),
  64. ('Potatoes'),
  65. ('Strawberries'),
  66. ('Peaches'),
  67. ('Kiwis'),
  68. ('Potatotes'),
  69. ('Oranges'),
  70. ('Leek');
  71. INSERT INTO bookorder(ord_date, com_id)
  72. VALUES
  73. ('2019-03-13 14:00:00', 1),
  74. ('2019-03-14 15:35:00', 2),
  75. ('2019-03-15 9:31:00', 3);
  76. INSERT INTO ordereditem(ori_quantity, ori_deliveryduedate, pro_id, ord_id,
  77. war_id)
  78. VALUES
  79. (300, '2019-11-15 14:00:00', 1, 1, 1),
  80. (1000, '2019-11-15 14:00:00', 2, 1, 1),
  81. (100, '2019-11-15 16:30:00', 3, 1, 2),
  82. (1000, '2019-11-16 8:00:00', 4, 3, 8),
  83. (100, '2019-11-16 8:00:00', 5, 3, 8),
  84. (1000, '2019-11-16 8:00:00', 6, 3, 8),
  85. (100, '2019-11-22 15:00:00', 7, 2, 7),
  86. (200, '2019-11-22 15:00:00', 8, 2, 7);
  87. -- Missions
  88. INSERT INTO mission(lpt_id, tru_id, mis_loadingdate, dri_id)
  89. VALUES
  90. (1, 'AC-543-AG', '2019-11-14 18:00:00', 1),
  91. (2, 'BA-865-PF', '2019-11-15 16:00:00', 2);
  92. INSERT INTO ordereditemmission(ori_id, mis_id)
  93. VALUES (1, 1), (2, 1), (4, 1), (5, 2);