SHARE
TWEET

Untitled

a guest Nov 14th, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table Movie(ID char(20), Title varchar(256), RelDate DateTime, Genre varchar(32), Quantity int(4),
  2.                    Primary Key(ID));
  3.  
  4. create table Actor(Name varchar (30), Address varchar (256),
  5.                    Primary Key(Name));
  6.                    
  7. create table StarsIn(Actor varchar (30), Movie char(20),
  8.                      Foreign Key(Movie) references Movie(ID),
  9.                      Foreign Key(Actor) references Actor(Name));
  10.                      
  11. create table Customer(Name varchar(50) not null, Address varchar(256) not null, ID char(12), BirthDate DateTime,
  12.                       Primary Key(ID));
  13.                      
  14. create table Loan(CustomerID varchar(12), Date DateTime, Movie char(20), ReturnDate DateTime,
  15.                   Foreign Key(CustomerID) references Customer(ID),
  16.                   Foreign Key(Movie) references Movie(ID));
  17.                  
  18. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000000", "Harry Potter 1", "20001201", "Fantasy", "12");
  19.  
  20. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000001", "Harry Potter 2", "20021201", "Fantasy", "15");
  21.  
  22. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000002", "Harry Potter 3", "20041201", "Fantasy", "8");
  23.  
  24. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000003", "Harry Potter 4", "20061201", "Fantasy", "17");
  25.  
  26. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000015", "Harry Potter 5", "20081201", "Fantasy", "17");
  27.  
  28. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000004", "Harry Potter 6", "20121201", "Fantasy", "17");
  29.  
  30. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000005", "Harry Potter 7 Part 1", "20161201", "Fantasy", "1");
  31.  
  32. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000006", "Harry Potter 7 Part 2", "20161229", "Fantasy", "174");
  33.  
  34. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000007", "Disturbed Children and their Mum's", "20061201", "Comedy", "11");
  35.  
  36. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000008", "Willy bum bum", "20140806", "Erotic", "0");
  37.  
  38. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000009", "Anchorman", "20161201", "Comedy", "1237");
  39.  
  40. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000010", "Bob the Builder", "20161201", "Cartoon", "17");
  41.  
  42. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000011", "Home and Away", "20161201", "Drama", "2");
  43.  
  44. insert into movie(ID, Title, RelDate, Genre, Quantity) values ("000000000012", "Speedy Sloth's - the Sloth's that don't slow down (Part 2)", "20161201", "Documentry", "2");
  45.  
  46. insert into Customer(Name, Address, ID, BirthDate) values ("Hayden", "Unit 49 / 2 Brighton Road, Rivervale, 6103", "000000000001", "19930110");
  47.  
  48. insert into Customer(Name, Address, ID, BirthDate) values ("Rhys", "13 Sutton Way, Busselton, 6103", "000000000002", "19950514");
  49.  
  50. insert into Loan(CustomerID, Date, Movie) values ("000000000001", "20160110", "000000000007");
  51.  
  52. insert into Loan(CustomerID, Date, Movie) values ("000000000002", "20160110", "000000000007");
  53.  
  54. insert into Loan(CustomerID, Date, Movie) values ("000000000001", "20160110", "000000000012");
  55.  
  56. insert into Loan(CustomerID, Date, Movie) values ("000000000002", "20160110", "000000000012");
  57.  
  58. insert into Loan(CustomerID, Date, Movie) values ("000000000002", "20160110", "000000000012");
  59.  
  60. insert into Actor(Name, Address) values ("Rhys", "420 Hell yes close");
  61.  
  62. insert into Actor(Name, Address) values ("Zeg", "Big wet fart lane, methane box, unit 69");
  63.  
  64. insert into StarsIn(Actor, Movie) values ("Zeg", "000000000012");
  65.  
  66. insert into StarsIn(Actor, Movie) values ("Zeg", "000000000002");
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
 
Top