Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.46 KB | None | 0 0
  1. CREATE TABLE Directors
  2. (
  3.     Id INT NOT NULL PRIMARY KEY,
  4.     DirectorName VARCHAR(50) NOT NULL,
  5.     Notes VARCHAR(MAX)
  6. )
  7.  
  8. CREATE TABLE Genres
  9. (
  10.     Id INT NOT NULL PRIMARY KEY,
  11.     GenreName VARCHAR(50) NOT NULL,
  12.     Notes VARCHAR(MAX)
  13. )
  14.  
  15. CREATE TABLE Categories
  16. (
  17.     Id INT NOT NULL PRIMARY KEY,
  18.     CategoryName VARCHAR(50) NOT NULL,
  19.     Notes VARCHAR(MAX)
  20. )
  21.  
  22. CREATE TABLE Movies
  23. (
  24.     Id INT NOT NULL PRIMARY KEY,
  25.     Title VARCHAR(50) NOT NULL,
  26.     DirectorId INT NOT NULL,
  27.     CopyrightYear DATE,
  28.     Lenght INT NOT NULL,
  29.     GenreId INT NOT NULL,
  30.     CategoryId INT NOT NULL,
  31.     Rating FLOAT,
  32.     Notes VARCHAR(MAX)
  33. )
  34.  
  35. INSERT INTO Directors(Id, DirectorName)
  36. VALUES (1, 'Steven Spielberg'),
  37. (2, 'Martin Scorsese'),
  38. (3, 'Alfred Hitchcock'),
  39. (4, 'Stanley Kubrick'),
  40. (5, 'Quentin Tarantino')
  41.  
  42. INSERT INTO Genres(Id, GenreName, Notes)
  43. VALUES (1, 'Action', 'Something'),
  44. (2, 'Fantasy', 'Something else'),
  45. (3, 'Sci-Fi', 'Primerno'),
  46. (4, 'Western', 'Ne go znam'),
  47. (5, 'Romance', 'Velikolepnata sedmorka')
  48.  
  49. INSERT INTO Categories(Id, CategoryName, Notes)
  50. VALUES (1, 'A', 'Something'),
  51. (2, 'S', 'Something else'),
  52. (3, 'G', 'Primerno'),
  53. (4, 'T', 'Ne go znam'),
  54. (5, 'F', 'Velikolepnata sedmorka')
  55.  
  56. INSERT INTO Movies(Id, Title, DirectorId, Lenght, GenreId, CategoryId)
  57. VALUES (1, 'Star Wars', 1, 120, 3, 2),
  58. (2, 'Velikolepnata Sedmorka', 5, 120, 4, 4),
  59. (3, 'Fifty Shades Of Gray', 3, 90, 5, 5),
  60. (4, 'The wolf of wall street', 2, 90, 5, 4),
  61. (5, 'The Guardians Of The Galaxy', 4, 130, 3, 3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement