Advertisement
Benkex

unisystem1

Jan 19th, 2022
1,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. create table institutions (
  3.     id int,
  4.     original_name text,
  5.     english_name text
  6. );
  7.    
  8. create table country (
  9.     id int,
  10.     country_name text
  11. );
  12.  
  13. create table county (
  14.     id int,
  15.     county_name text
  16. );
  17.  
  18. create table city (
  19.     id int,
  20.     city_name text
  21. );
  22.  
  23. create table quarter (
  24.     id int,
  25.     quarter text
  26. );
  27.  
  28. insert into institutions (id, original_name, english_name) values
  29.     (1, 'Albert-Ludwigs-Universität Freiburg', 'University of Freiburg'),
  30.     (2, 'Eötvös Loránd Tudományegyetem', 'Eötvös Loránd University'),
  31.     (3, 'Budapesti Műszaki és Gazdaságtudományi Egyetem', 'Budapest University of Technology and Economics')
  32.     ;
  33.  
  34. insert into country (id, country_name) values
  35.     (1, 'Hungary'),
  36.     (2, 'Germany'),
  37.     (3, 'Finnland'),
  38.     (4, 'England'),
  39.     (5, 'USA')
  40.     ;
  41.  
  42. insert into county (id, county_name) values
  43.     (1, 'Pest'),
  44.     (2, 'Baden-Württemberg')
  45.     ;
  46.  
  47. insert into city (id, city_name) values
  48.     (1, 'Budapest'),
  49.     (2, 'Freiburg')
  50.     ;
  51.  
  52. insert into quarter (id, quarter) values
  53.     (1, '-')
  54.     ;
  55.  
  56. create table inst_country (
  57.     id int,
  58.     inst_id int,
  59.     country_id int
  60. );
  61.  
  62. create table inst_county (
  63.     id int,
  64.     inst_id int,
  65.     county_id int
  66. );
  67.  
  68. create table inst_city (
  69.     id int,
  70.     inst_id int,
  71.     city_id int
  72. );
  73.  
  74. create table inst_quarter (
  75.     id int,
  76.     inst_id int,
  77.     quarter_id int
  78. );
  79.  
  80. insert into inst_country (id, inst_id, country_id) values
  81.     (1, 1, 2),
  82.     (2, 2, 1),
  83.     (3, 3, 1)
  84.     ;
  85.  
  86. insert into inst_county (id, inst_id, county_id) values
  87.     (1, 1, 2),
  88.     (2, 2, 1),
  89.     (3, 3, 1)
  90.     ;
  91.  
  92. insert into inst_city (id, inst_id, city_id) values
  93.     (1, 1, 2),
  94.     (2, 2, 1),
  95.     (3, 3, 1)
  96.     ;
  97.  
  98. insert into inst_quarter (id, inst_id, quarter_id) values
  99.     (1, 1, 1),
  100.     (2, 2, 1),
  101.     (3, 3, 1)
  102.     ;
  103.  
  104.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement