SHARE
TWEET

FILLING

a guest Mar 19th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set DATEFORMAT dmy
  2.  
  3. IF OBJECT_ID('Airline', 'U') IS NOT NULL
  4. DELETE FROM Airline;
  5. DBCC CHECKIDENT ('Airline', RESEED, 1);
  6. IF OBJECT_ID('Airport', 'U') IS NOT NULL
  7. DELETE FROM Airport;
  8. DBCC CHECKIDENT ('Airport', RESEED, 1);
  9. IF OBJECT_ID('City', 'U') IS NOT NULL
  10. DELETE FROM City;
  11. DBCC CHECKIDENT ('City', RESEED, 1);
  12. IF OBJECT_ID('Country', 'U') IS NOT NULL
  13. DELETE FROM Country;
  14. DBCC CHECKIDENT ('Country', RESEED, 1);
  15.  
  16. INSERT INTO Country (name) VALUES ('Russia');
  17. INSERT INTO Country (name) VALUES ('USA');
  18. INSERT INTO Country (name) VALUES ('Ukraine');
  19. INSERT INTO Country (name) VALUES ('China');
  20. INSERT INTO Country (name) VALUES ('Australia');
  21. INSERT INTO Country (name) VALUES ('Germany');
  22. INSERT INTO Country (name) VALUES ('France');
  23. INSERT INTO Country (name) VALUES ('United Kingdom');
  24. INSERT INTO Country (name) VALUES ('Greece');
  25. INSERT INTO Country (name) VALUES ('Italy');
  26. INSERT INTO Country (name) VALUES ('Canada');
  27.  
  28. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Moscow', 3, dbo.id_of_country('Russia'));
  29. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Omsk', 6, dbo.id_of_country('Russia'));
  30. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Novosibirsk', 6, dbo.id_of_country('Russia'));
  31. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Tyumen', 5, dbo.id_of_country('Russia'));
  32. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Yekaterinburg', 5, dbo.id_of_country('Russia'));
  33. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Krasnoyarsk', 7, dbo.id_of_country('Russia'));
  34. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Vladivostok', 10, dbo.id_of_country('Russia'));
  35. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Vancouver', -8, dbo.id_of_country('Canada'));
  36. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Chicago', -6, dbo.id_of_country('USA'));
  37. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Los Angeles', -8, dbo.id_of_country('USA'));
  38. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('New York', -5, dbo.id_of_country('USA'));
  39. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Kiev', 2, dbo.id_of_country('Ukraine'));
  40. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Beijing', 8, dbo.id_of_country('China'));
  41. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Sydney', 10, dbo.id_of_country('Australia'));
  42. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Berlin', 1, dbo.id_of_country('Germany'));
  43. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Munich', 1, dbo.id_of_country('Germany'));
  44. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Paris', 1, dbo.id_of_country('France'));
  45. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('London', 0, dbo.id_of_country('United Kingdom'));
  46. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Athens', 2, dbo.id_of_country('Greece'));
  47. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Rome', 1, dbo.id_of_country('Italy'));
  48. INSERT INTO City (name, difference_with_the_UTC, country_id) VALUES ('Sochi', 3, dbo.id_of_country('Russia'));
  49.  
  50. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Domodedovo', 'UUDD', dbo.id_of_city('Moscow'));
  51. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Sheremetyevo', 'UUEE', dbo.id_of_city('Moscow'));
  52. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Vnukovo', 'UUWW', dbo.id_of_city('Moscow'));
  53. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Tsentralnyy', 'UNOO', dbo.id_of_city('Omsk'));
  54. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Tolmachevo', 'UNNT', dbo.id_of_city('Novosibirsk'));
  55. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Roschino', 'USTR', dbo.id_of_city('Tyumen'));
  56. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Koltsovo', 'UNKE', dbo.id_of_city('Yekaterinburg'));
  57. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Emelyanovo', 'UNKL', dbo.id_of_city('Krasnoyarsk'));
  58. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Knevichi', 'UHWW', dbo.id_of_city('Vladivostok'));
  59. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Sochi', 'URSS', dbo.id_of_city('Sochi'));
  60. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Boundary Bay', 'CZBB', dbo.id_of_city('Vancouver'));
  61. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Chicago FSS', 'KCHI', dbo.id_of_city('Chicago'));
  62. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Los Angeles International', 'KLAX', dbo.id_of_city('Los Angeles'));
  63. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('New York John F. Kennedy International Airport', 'KJFK', dbo.id_of_city('New York'));
  64. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Zhulhany', 'UKKK', dbo.id_of_city('Kiev'));
  65. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Beijing Capital Int.', 'ZBAA', dbo.id_of_city('Beijing'));
  66. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Kingsford Smith Airport', 'YSSY', dbo.id_of_city('Sydney'));
  67. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Schoenefeld', 'EDDB', dbo.id_of_city('Berlin'));
  68. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Le Bourget', 'LFPB', dbo.id_of_city('Paris'));
  69. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Paris Orly Airport', 'LFPO', dbo.id_of_city('Paris'));
  70. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('London Heathrow', 'EGLL', dbo.id_of_city('London'));
  71. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('London Luton Airport', 'EGGW', dbo.id_of_city('London'));
  72. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Athens', 'KAHN', dbo.id_of_city('Athens'));
  73. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Leonardo da Vinci International', 'LIRF', dbo.id_of_city('Rome'));
  74. INSERT INTO Airport (name, ICAO_code, city_id) VALUES ('Munich Airport', 'EDDM', dbo.id_of_city('Munich'));
  75.  
  76. INSERT INTO Airline (name, base_airport_id) VALUES ('S7 Airlines', dbo.id_of_airport('Tolmachevo'));
  77. INSERT INTO Airline (name, base_airport_id) VALUES ('Aeroflot - Russian Airlines', dbo.id_of_airport('Sheremetyevo'));
  78. INSERT INTO Airline (name, base_airport_id) VALUES ('Transaero', dbo.id_of_airport('Domodedovo'));
  79. INSERT INTO Airline (name, base_airport_id) VALUES ('Red Wings', dbo.id_of_airport('Domodedovo'));
  80. INSERT INTO Airline (name, base_airport_id) VALUES ('UTair', dbo.id_of_airport('Roschino'));
  81. INSERT INTO Airline (name, base_airport_id) VALUES ('Pobeda', dbo.id_of_airport('Vnukovo'));
  82. INSERT INTO Airline (name, base_airport_id) VALUES ('Lufthansa', dbo.id_of_airport('Munich Airport'));
  83. INSERT INTO Airline (name, base_airport_id) VALUES ('Air France', dbo.id_of_airport('Paris Orly Airport'));
  84. INSERT INTO Airline (name, base_airport_id) VALUES ('EasyJet', dbo.id_of_airport('London Luton Airport'));
  85. INSERT INTO Airline (name, base_airport_id) VALUES ('Delta Air Lines', dbo.id_of_airport('New York John F. Kennedy International Airport'));
  86. INSERT INTO Airline (name, base_airport_id) VALUES ('American Airlines', dbo.id_of_airport('New York John F. Kennedy International Airport'));
  87. INSERT INTO Airline (name, base_airport_id) VALUES ('Qantas', dbo.id_of_airport('Kingsford Smith Airport'));
RAW Paste Data
Top