Advertisement
Stan0033

fixed for for problem 13 movie dtabase

May 21st, 2022
1,072
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 PRIMARY KEY  IDENTITY(1,1),
  6.     [DirectorName] VARCHAR(50),
  7.     [Notes]  VARCHAR
  8.     )
  9.      CREATE TABLE [Genres](
  10.     [Id] INT PRIMARY KEY IDENTITY(1,1)   ,
  11.     [GenreName] VARCHAR(50),
  12.     [Notes]  VARCHAR
  13.     )
  14.      CREATE TABLE [Categories](
  15.     [Id] INT PRIMARY KEY IDENTITY(1,1)  ,
  16.     [CategoryName] VARCHAR(50),
  17.     [Notes]  VARCHAR
  18.     )
  19.      CREATE TABLE [Movies](
  20.     [Id] INT PRIMARY KEY    IDENTITY(1,1),
  21.     [Title] VARCHAR(50),
  22.     [DirectorId]  VARCHAR,
  23.     [CopyrightCHAR(4)]  CHAR(4),
  24.     [Length] DECIMAL(2,2),
  25.     [GenreId] INT,
  26.     [CategoryId] INT,
  27.     [Rating] INT(10),
  28.     [Notes] VARCHAR,
  29.  
  30.     )
  31.     INSERT INTO [Directors]([Id],[DirectorName],[Notes])
  32.           VALUES
  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.            VALUES
  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.            VALUES
  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],[CopyrightCHAR(4)], [Rating], [Notes])
  56.           VALUES
  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.  
Advertisement
RAW Paste Data Copied
Advertisement