Advertisement
Guest User

kk

a guest
Jun 17th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.99 KB | None | 0 0
  1. CREATE TABLE users (id int not null AUTO_INCREMENT, username VARCHAR(100), date_of_birth DATE,  PRIMARY KEY (id));
  2.  
  3. insert into users (username,date_of_birth) values ("Jack", "1991-3-24"); -- 1
  4. insert into users (username,date_of_birth) values ("Jon Val", "95-3-4"); -- 2
  5. insert into users (username,date_of_birth) values ("Loko56", "87-11-14"); -- 3
  6. insert into users (username,date_of_birth) values ("James Smith the 18th", "87-8-14"); -- 4
  7.  
  8.  
  9. CREATE TABLE movies (movie_id int not null AUTO_INCREMENT, movname VARCHAR(150), genre VARCHAR(50), rel_date DATE, PRIMARY KEY (movie_id));
  10.  
  11. insert into movies (movname, genre, rel_date) values ("A Name", "mystery", "45-6-12"); -- 1
  12. insert into movies (movname, genre, rel_date) values ("Did you know?", "mystery", "45-6-12"); -- 2
  13. insert into movies (movname, genre, rel_date) values ("It", "action", "45-6-12"); -- 3
  14. insert into movies (movname, genre, rel_date) values ("Wreck", "Comedy", "14-6-12"); -- 4
  15. insert into movies (movname, genre, rel_date) values ("A life on the line", "action", "14-6-12"); -- 5
  16. insert into movies (movname, genre, rel_date) values ("Walk", "action", "1914-6-12"); -- 6
  17. insert into movies (movname, genre, rel_date) values ("Die Trying", "Comedy", "14-6-12"); -- 7
  18. insert into movies (movname, genre, rel_date) values ("Top of the Morning", "action", "1936-7-21"); -- 8
  19. insert into movies (movname, genre, rel_date) values ("Clown Down Under", "action", "36-7-21"); -- 9
  20. insert into movies (movname, genre, rel_date) values ("The Essence of Maggie", "action", "1936-7-21"); -- 10
  21. insert into movies (movname, genre, rel_date) values ("Annabell ", "Horror", "36-7-21"); -- 11
  22. insert into movies (movname, genre, rel_date) values ("Sharknado", "Indie", "87-2-1"); -- 12
  23. insert into movies (movname, genre, rel_date) values ("Sharknado the 6th: a masterpiece", "action", "87-2-1"); -- 13
  24.  
  25.  
  26.  
  27. CREATE TABLE reviews (user_id int not null , movie_id int not null, rating int not null, comment VARCHAR(5000), PRIMARY KEY (user_id, movie_id));
  28.  
  29. insert into reviews (user_id, movie_id, rating, comment) values (2, 10, 1, "st-paced, natural dialogue and the actors commanding comedic performance make the movie an indie mumblecore gem.");
  30. insert into reviews (user_id, movie_id, rating, comment) values (1, 10, 10, "Such a wack movie");
  31. insert into reviews (user_id, movie_id, rating, comment) values (1, 8, 9, "Such a wack movie");
  32. insert into reviews (user_id, movie_id, rating, comment) values (1, 7, 8, "Such a wack movie");
  33. insert into reviews (user_id, movie_id, rating, comment) values (1, 12, 2, "Such a wack movie");
  34. insert into reviews (user_id, movie_id, rating, comment) values (1, 13, 2, "Such a wack movie");
  35. insert into reviews (user_id, movie_id, rating, comment) values (2, 11, 2, "Such a wack movie");
  36. insert into reviews (user_id, movie_id, rating, comment) values (3, 6, 9, "Such a wack movie");
  37. insert into reviews (user_id, movie_id, rating, comment) values (1, 6, 2, "Such a wack movie");
  38. insert into reviews (user_id, movie_id, rating, comment) values (4, 9, 4, "Such a wack movie");
  39. insert into reviews (user_id, movie_id, rating, comment) values (4, 10, 2, "Such a wack movie");
  40.  
  41.  
  42.  
  43. CREATE TABLE actors (act_id int not null AUTO_INCREMENT, actorname VARCHAR(255),  gender ENUM('M','F'), date_of_birth DATE, PRIMARY KEY (act_id));
  44.  
  45. insert into actors (actorname, gender, date_of_birth) values ("James McMahon", "M", "1965-6-12"); -- 1
  46. insert into actors (actorname, gender, date_of_birth) values ("John Main", "M", "1968-4-1"); -- 2
  47. insert into actors (actorname, gender, date_of_birth) values ("Sara Lancester", "F", "1985-8-2"); -- 3
  48. insert into actors (actorname, gender, date_of_birth) values ("India Joyner", "F", "1995-4-24"); -- 4
  49. insert into actors (actorname, gender, date_of_birth) values ("Bruce Miner", "M", "1941-9-13"); -- 5
  50. insert into actors (actorname, gender, date_of_birth) values ("Lester Brunshire ", "M", "1925-3-16"); -- 6
  51. insert into actors (actorname, gender, date_of_birth) values ("Zack Knight the 3rd", "M", "2014-6-12"); -- 7
  52. insert into actors (actorname, gender, date_of_birth) values ("Wynn", "F", "1987-8-22"); -- 8
  53. insert into actors (actorname, gender, date_of_birth) values ("Leah James", "F", "2000-8-28"); -- 9
  54. insert into actors (actorname, gender, date_of_birth) values ("Erin Mays", "F", "1975-4-13"); -- 10
  55.  
  56. CREATE TABLE lead (act_id int not null, movie_id int not null, PRIMARY KEY (act_id, movie_id));
  57.  
  58. insert into lead (act_id, movie_id) values (6,1);
  59. insert into lead (act_id, movie_id) values (8,1);
  60. insert into lead (act_id, movie_id) values (10,2);
  61. insert into lead (act_id, movie_id) values (9,2);
  62. insert into lead (act_id, movie_id) values (4,2);
  63. insert into lead (act_id, movie_id) values (8,2);
  64. insert into lead (act_id, movie_id) values (2,2);
  65. insert into lead (act_id, movie_id) values (6,3);
  66. insert into lead (act_id, movie_id) values (8,3);
  67. insert into lead (act_id, movie_id) values (10,4);
  68. insert into lead (act_id, movie_id) values (1,4);
  69. insert into lead (act_id, movie_id) values (5,4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement