Facebook
From Small Mockingjay, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 46
  1. CREATE TABLE Pasmo(
  2. nazwa NVARCHAR2 (5) NOT NULL,
  3. id_pasmo NUMBER (5) CONSTRAINT pk_pasmo PRIMARY KEY
  4. );
  5.  
  6. CREATE TABLE Gory(
  7. id_gory NUMBER (2) CONSTRAINT pk_id_gory PRIMARY KEY,
  8. nazwA NVARCHAR2 (25) NOT NULL,
  9. id_pasmo NUMBER (2) CONSTRAINT fk_pasmo REFERENCES Pasmo(id_pasmo),
  10. wysokosc INT
  11. )
  12.  
  13. CREATE TABLE Szlaki_Gorskie(
  14. id_szlaku NUMBER (2) CONSTRAINT pk_id_szlaku PRIMARY KEY,
  15. przebieg_szlaku NVARCHAR2 (40) NOT NULL,
  16. ktora_gora NUMBER (2) CONSTRAINT fk_id_pasma REFERENCES Gory(id_gory)
  17. );
  18.  
  19. CREATE TABLE Panstwa(
  20. id_panstwa NUMBER (2),
  21. nazwapanstwa NVARCHAR2 (25) NOT NULL,
  22. zawiera_gora NUMBER (2) CONSTRAINT fk_id_gora REFERENCES Gory(id_gora)
  23. );
  24.  
  25. CREATE TABLE Schronisko(
  26. id_schroniska NUMBER (2),
  27. nazwa NVARCHAR2 (100) NOT NULL,
  28. wysokosc INT,
  29. schronisko_gory NUMBER (2) CONSTRAINT fk_id_gora REFERENCES Gory(id_gora)
  30. );
  31.  
  32. INSERT INTO Gory VALUES (1, 'Mount Everest', 1, '8848');
  33. INSERT INTO Gory VALUES (2, 'Mont Blanc', 2, '4810');
  34. INSERT INTO Gory VALUES (3, 'Gerlach', 3, '2655');
  35. INSERT INTO Gory VALUES (4, 'Eiger', 4, '3970');
  36. INSERT INTO Gory VALUES (5, 'Annapurna', 5, '8091');
  37. SELECT * FROM dual;
  38.  
  39. INSERT INTO Panstwa VALUES (1, 'Nepal');
  40. INSERT INTO Panstwa VALUES (2, 'Chiny');
  41. INSERT INTO Panstwa Values (3, 'Wlochy');
  42. INSERT INTO Panstwa Values (4, 'Polska');
  43. INSERT INTO Panstwa VALUES (5, 'Slowacja');
  44. INSERT INTO Panstwa VALUES (6, 'Francja');
  45. INSERT INTO Panstwa VALUES (7, 'Szwajcaria');
  46. SELECT * FROM dual;
  47.  
  48. INSERT INTO Pasmo VALUES ('Himalaje', 1);
  49. insert INTO Pasmo VALUES ('Masyw Mont Blanc', 2);
  50. INSERT INTO Pasmo VALUES ('Tatry', 3);
  51. INSERT INTO Pasmo VALUES ('Karpaty', 4);
  52. INSERT INTO Pasmo VALUES ('Alpy Bernenskie', 5);
  53. SELECT * FROM dual;
  54.  
  55. INSERT INTO Schronisko VALUES (1, 'Base Camp Polnoc', '5150');
  56. INSERT INTO Schronisko VALUES (2, 'Base Camp Poludnie', '5364');
  57. INSERT INTO Schronisko VALUES (3, 'Kengo Kuma Associates', '2500');
  58. INSERT INTO Schronisko VALUES (4, 'Slaski Dom', '1670');
  59. INSERT INTO Schronisko VALUES (5, 'Wengernalp', '1874');
  60. INSERT INTO Schronisko VALUES (6, 'Annapurna base camp', '4130');
  61. SELECT * FROM dual;
  62.  
  63. DROP TABLE Schroniska CASCADE CONSTRAINTS;
  64. DROP TABLE Powierzchnia_Panstwa CASCADE CONSTRAINTS;
  65.