SHARE
TWEET

Untitled

a guest Jun 20th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. CREATE TABLE [dbo].[Studenci](
  4.     [nr] [int] IDENTITY(1,1) NOT NULL,
  5.     [firstName] [varchar](25) NOT NULL,
  6.     [lastName] [varchar](25) NOT NULL,
  7.     [nr_indeksu] [int] NOT NULL,
  8.     [id] [varchar](50) NOT NULL,
  9. PRIMARY KEY (nr))
  10.  
  11. CREATE TABLE [dbo].[Przedmioty](
  12.     [classID] [int] IDENTITY(1,1) NOT NULL,
  13.     [className] [varchar](25) NOT NULL
  14. PRIMARY KEY (classID))
  15.  
  16. CREATE TABLE [dbo].[Obecnosci](
  17.     [nr] [int] IDENTITY(1,1) NOT NULL,
  18.     [data] [varchar](25) NOT NULL,
  19.     [classID] [int] NOT NULL,
  20.     [group] [int] NOT NULL,
  21.     [classStartDate] [varchar](5) NOT NULL,
  22.     [classEndDate] [varchar](5) NOT NULL,
  23.     [isPresent] [bit] NOT NULL,
  24.     [id] [varchar](50) NOT NULL
  25. PRIMARY KEY (nr)
  26. FOREIGN KEY (classID) REFERENCES Przedmioty(classID))
  27.  
  28. INSERT INTO Przedmioty(className)
  29. VALUES('PT-1')
  30.  
  31. INSERT INTO Przedmioty(className)
  32. VALUES('PT-2')
  33.  
  34. INSERT INTO Przedmioty(className)
  35. VALUES('TSM-1')
  36.  
  37. INSERT INTO Przedmioty(className)
  38. VALUES('TSM-2')
  39.  
  40. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  41. VALUES('Michal','Andrzejewski',131131,'013697D7')
  42.  
  43. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  44. VALUES('Przemyslaw','Barlog',131123,'0136C21C')
  45.  
  46. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  47. VALUES('Dominik','Blaszczyk',131733,'013697G8')
  48.  
  49. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  50. VALUES('Robert','Blaszynski',131734,'0136C2T4')
  51.  
  52. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  53. VALUES('Jan','Kowalski',131231,'01369891')
  54.  
  55. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  56. VALUES('Piotr','Nowak',131198,'0136AB87')
  57.  
  58. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  59. VALUES('Adam','Malysz',131112,'013697U2')
  60.  
  61. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  62. VALUES('Mariusz','Pudzianowski',131199,'0136CZ73')
  63.  
  64. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  65. VALUES('Robert','Kubica',131190,'013697F1')
  66.  
  67. INSERT INTO Studenci(firstName,lastName,nr_indeksu,id)
  68. VALUES('Robert','Lewandowski',131195,'0136CZ75')
  69.  
  70. INSERT INTO Obecnosci([data],classID,[group],classStartDate, classEndDate, isPresent,id)
  71. values('2019-06-05',1,'TI-1', '15:10','16:40',0,'013697D7')
  72.  
  73. INSERT INTO Obecnosci([data],ID,[group],classStartDate, classEndDate, isPresent,id)
  74. values('2019-06-05',1,'TI-1', '15:10','16:40',1,'0136C21C')
  75.  
  76. INSERT INTO Obecnosci([data],classID,[group],classStartDate, classEndDate, isPresent,id)
  77. values('2019-06-08',2,'TI-2', '08:00','09:30',1,'013697G8')
  78.  
  79. INSERT INTO Obecnosci([data],ID,[group],classStartDate, classEndDate, isPresent,id)
  80. values('2019-06-08',2,'TI-2', '08:00','09:30',1,'0136C2T4')
  81.  
  82. INSERT INTO Obecnosci([data],classID,[group],classStartDate, classEndDate, isPresent,id)
  83. values('2019-06-10',3,'TI-3', '09:45','11:15',0,'01369891')
  84.  
  85. INSERT INTO Obecnosci([data],ID,[group],classStartDate, classEndDate, isPresent,id)
  86. values('2019-06-10',3,'TI-3', '09:45','11:15',1,'0136AB87')
  87.  
  88. INSERT INTO Obecnosci([data],classID,[group],classStartDate, classEndDate, isPresent,id)
  89. values('2019-06-11',4,'TI-4', '15:10','16:40',1,'013697U2')
  90.  
  91. INSERT INTO Obecnosci([data],ID,[group],classStartDate, classEndDate, isPresent,id)
  92. values('2019-06-05',4,'TI-4', '15:10','16:40',0,'0136CZ73')
  93.  
  94. INSERT INTO Obecnosci([data],classID,[group],classStartDate, classEndDate, isPresent,id)
  95. values('2019-06-12',1,'TI-1', '15:10','16:40',0,'013697F1')
  96.  
  97. INSERT INTO Obecnosci([data],ID,[group],classStartDate, classEndDate, isPresent,id)
  98. values('2019-06-12',2,'TI-1', '15:10','16:40',1,'0136CZ75')
  99.  
  100. SELECT * FROM Obecnosci
  101.  
  102. SELECT * FROM Studenci
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