SHARE
TWEET

Untitled

a guest Apr 22nd, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table test
  2. (id_lskill int identity not null,
  3. lskillName varchar(100),
  4. constraint PK_id_lskill PRIMARY KEY(id_lskill))
  5.  
  6. create table level_1
  7. (id_level1 int identity not null,
  8. level1Name varchar(100),
  9. lskillN int,
  10. constraint PK_id_level1 PRIMARY KEY(id_level1),
  11. constraint FK_lskillN FOREIGN KEY(lskillN) REFERENCES test(id_lskill))
  12.  
  13. create table level_2
  14. (id_level2 int identity not null,
  15. level2Name varchar(100),
  16. lvl1 int,
  17. constraint PK_id_level2 PRIMARY KEY(id_level2),
  18. constraint FK_lvl1 FOREIGN KEY(lvl1) REFERENCES level_1(id_level1))
  19.  
  20. create table level_3
  21. (id_level3 int identity not null,
  22. level3Name varchar(100),
  23. lvl2 int,
  24. constraint PK_id_level3 PRIMARY KEY(id_level3),
  25. constraint FK_lvl2 FOREIGN KEY(lvl2) REFERENCES level_2(id_level2))
  26.  
  27. insert into test
  28. (lskillName)
  29. values('Russian'),('English'),('Deutsch');
  30.  
  31. insert into level_1
  32. (level1Name, lskillN)
  33. values('Level_1-Russian_1', 1),
  34. ('Level_1-Russian_2', 1),
  35. ('Level_1-English_1', 2),('Level_1-English_2', 2),('Level_1-Deutsch_1', 3),('Level_1-Deutsch_2', 3);
  36.  
  37. insert into level_2
  38. (level2Name,lvl1)
  39. values('Level_2-Russian_1', 1),
  40. ('Level_2-Russian_2', 2),
  41. ('Level_2-English_1', 3),('Level_2-English_2', 4),('Level_2-Deutsch_1', 5),('Level_2-Deutsch_2', 6);
  42.  
  43. insert into level_3
  44. (level3Name,lvl2)
  45. values('Level_3-Russian_1', 1),
  46. ('Level_3-Russian_2', 2),
  47. ('Level_3-English_1', 3),('Level_3-English_2', 4),('Level_3-Deutsch_1', 5),('Level_3-Deutsch_2', 6);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top