Advertisement
Stan0033

sql attempt problem 13 Movies

May 21st, 2022
935
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE DATABASE [Movies]
  2.  
  3.  
  4.     CREATE TABLE [Directors](
  5.     [Id] INT(MAX) PRIMARY KEY NOT NULL ,
  6.     [DirectorName] VARCHAR(50),
  7.     [Notes]  VARCHAR(MAX)
  8.     )
  9.      CREATE TABLE [Genres](
  10.     [Id] INT(MAX) PRIMARY KEY  NOT NULL   ,
  11.     [GenreName] VARCHAR(50),
  12.     [Notes]  VARCHAR(MAX)
  13.     )
  14.      CREATE TABLE [Categories](
  15.     [Id] INT(MAX) PRIMARY KEY   NOT NULL ,
  16.     [CategoryName] VARCHAR(50),
  17.     [Notes]  VARCHAR(MAX)
  18.     )
  19.      CREATE TABLE [Movies](
  20.     [Id] INT(MAX) PRIMARY KEY    NOT NULL,
  21.     [Title] VARCHAR(50),
  22.     [DirectorId]  VARCHAR(MAX),
  23.     [CopyrightYear]  YEAR,
  24.     [Length] FLOAT(2,2),
  25.     [GenreId] INT(MAX),
  26.     [CategoryId] INT(MAX),
  27.     [Rating] INT(10),
  28.     [Notes] VARCHAR(MAX),
  29.  
  30.     )
  31.     INSERT INTO [Directors]([Id],[DirectorName],[Notes])(
  32.          
  33.         (1,'John',NULL),
  34.         (2,'Stan',NULL),
  35.         (3,'George',NULL),
  36.         (4,'Luke',NULL),
  37.         (5,'Peter',NULL),
  38.     )
  39.      INSERT INTO [Genres]([Id],[GenreName],[Notes])(
  40.          
  41.         (1,'Action',NULL),
  42.         (2,'Thriller',NULL),
  43.         (3,'Fanatasy',NULL),
  44.         (4,'Sci-Fi',NULL),
  45.         (5,'Comedy',NULL)
  46.     )
  47.      INSERT INTO [Categories]([Id],[CategoryName],[Notes])(
  48.            
  49.         (1,'Film',NULL),
  50.         (2,'TV Series',NULL),
  51.         (3,'Documentary',NULL),
  52.         (4,'Limited TV Series',NULL),
  53.         (5,'TV Show',NULL)
  54.     )
  55.     INSERT INTO [Movies]([Id],[Title],[DirectorId],[CopyrightYear], [Rating], [Notes])(
  56.        
  57.         (1,'Superhero Adventure', 1, 2022, 6, NULL),
  58.         (2,'Fighting Justice', 2, 2022, 7, NULL),
  59.         (3,'Strange New Planets', 3, 2022, 8, NULL),
  60.         (4,'The Flying Steel Donkey', 4, 2022, 8, NULL),
  61.         (5,'Mr. Smith and his Umbrella', 5, 2022, 8, NULL)
  62.          
  63.     )
  64.  
Advertisement
RAW Paste Data Copied
Advertisement