Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 4.05 KB | None | 0 0
  1. CREATE TABLE Country (
  2.   countryName VARCHAR(50) PRIMARY KEY,
  3.   currency VARCHAR(25),
  4.   visa BOOLEAN
  5. ) ENGINE=INNODB;
  6. CREATE TABLE Cities (
  7.   cityName VARCHAR(50) PRIMARY KEY,
  8.   country VARCHAR(50),
  9.   FOREIGN KEY (country) REFERENCES Country(countryName)
  10. ) ENGINE=INNODB;
  11. CREATE TABLE Sites (
  12.   siteName VARCHAR(50) PRIMARY KEY,
  13.   city VARCHAR(50),
  14.   category VARCHAR(50),
  15.   FOREIGN KEY (city) REFERENCES Cities(cityName)
  16. ) ENGINE=INNODB;
  17. CREATE TABLE Users (
  18.   name VARCHAR(50) PRIMARY KEY,
  19.   email VARCHAR(50)
  20. ) ENGINE=INNODB;
  21. CREATE TABLE Visits (
  22.   user_name VARCHAR(50),
  23.   site VARCHAR(50),
  24.   rating INTEGER,
  25.   FOREIGN KEY (site) REFERENCES Sites(siteName),
  26.   FOREIGN KEY (user_name) REFERENCES Users(name)
  27. ) ENGINE=INNODB;
  28. INSERT INTO Country VALUES ("Scotland", "Pound (£)", FALSE);
  29. INSERT INTO Country VALUES ("Germany", "Euro (€)", FALSE);
  30. INSERT INTO Country VALUES ("Netherlands", "Euro (€)", FALSE);
  31. INSERT INTO Country VALUES ("Nebraska", "US Dollar ($)", TRUE);
  32. INSERT INTO Country VALUES ("Japan", "Japanese Yen (¥)", TRUE);
  33. INSERT INTO Cities VALUES ("Edinburgh", "Scotland");
  34. INSERT INTO Cities VALUES ("Motherwell", "Scotland");
  35. INSERT INTO Cities VALUES ("Berlin", "Germany");
  36. INSERT INTO Cities VALUES ("Hamburg", "Germany");
  37. INSERT INTO Cities VALUES ("Amsterdam", "Netherlands");
  38. INSERT INTO Cities VALUES ("Haarlem", "Netherlands");
  39. INSERT INTO Cities VALUES ("Lincoln", "Nebraska");
  40. INSERT INTO Cities VALUES ("Omaha", "Nebraska");
  41. INSERT INTO Cities VALUES ("Iga", "Japan");
  42. INSERT INTO Cities VALUES ("Hiroshima", "Japan");
  43. INSERT INTO Sites VALUES ("Edinburgh Science Museum", "Edinburgh", "Museum");
  44. INSERT INTO Sites VALUES ("M&Ds", "Motherwell", "Amusement Park");
  45. INSERT INTO Sites VALUES ("Brandenburg Gate", "Berlin", "Historical Site");
  46. INSERT INTO Sites VALUES ("Parlament Restaurant", "Hamburg", "Food & Drink");
  47. INSERT INTO Sites VALUES ("Anne Frank Museum", "Amsterdam", "Museum");
  48. INSERT INTO Sites VALUES ("Bloemendaal Aan Zee Beach", "Haarlem", "Beach");
  49.  
  50. INSERT INTO Sites VALUES ("Nebraska State Capitol", "Lincoln", "Political Building");
  51. INSERT INTO Sites VALUES ("Lauritzen Gardens/Kenefick Park", "Omaha", "Park");
  52. INSERT INTO Sites VALUES ("The Mysterious Sonic Statue", "Iga", "Religious Landmark");
  53. INSERT INTO Sites VALUES ("Hiroshima Peace Museum", "Hiroshima", "Museum");
  54. INSERT INTO Users VALUES("Liam Sneddon", "liamsneddon@hotmail.com");
  55. INSERT INTO Users VALUES("Alec Smith", "alecsmith@hotmail.com");
  56. INSERT INTO Users VALUES("Sonic Hedge", "sonic@fast.com");
  57. INSERT INTO Users VALUES("Absolute Legend", "69420@rocketmail.com");
  58. INSERT INTO Users VALUES("Yee Haw", "cowboy@saloon.com");
  59. INSERT INTO Visits VALUES("Liam Sneddon", "The Mysterious Sonic Statue", 5);
  60. INSERT INTO Visits VALUES("Liam Sneddon", "M&Ds", 5);
  61. INSERT INTO Visits VALUES("Liam Sneddon", "Brandenburg Gate", 3);
  62. INSERT INTO Visits VALUES("Liam Sneddon", "Parlament Restaurant", 4);
  63. INSERT INTO Visits VALUES("Alec Smith", "The Mysterious Sonic Statue", 5);
  64. INSERT INTO Visits VALUES("Alec Smith", "Nebraska State Capitol", 2);
  65. INSERT INTO Visits VALUES("Alec Smith", "Edinburgh Science Museum", 4);
  66. INSERT INTO Visits VALUES("Alec Smith", "Bloemendaal Aan Zee Beach", 5);
  67. INSERT INTO Visits VALUES("Sonic Hedge", "The Mysterious Sonic Statue", 5);
  68. INSERT INTO Visits VALUES("Sonic Hedge", "Lauritzen Gardens/Kenefick Park", 2);
  69. INSERT INTO Visits VALUES("Sonic Hedge", "M&Ds", 5);
  70. INSERT INTO Visits VALUES("Sonic Hedge", "Hiroshima Peace Museum", 3);
  71. INSERT INTO Visits VALUES("Absolute Legend", "The Mysterious Sonic Statue", 5);
  72. INSERT INTO Visits VALUES("Absolute Legend", "Brandenburg Gate", 4);
  73. INSERT INTO Visits VALUES("Absolute Legend", "Parlament Restaurant", 5);
  74. INSERT INTO Visits VALUES("Absolute Legend", "Bloemendaal Aan Zee Beach", 5);
  75. INSERT INTO Visits VALUES("Yee Haw", "The Mysterious Sonic Statue", 5);
  76. INSERT INTO Visits VALUES("Yee Haw", "Nebraska State Capitol", 5);
  77. INSERT INTO Visits VALUES("Yee Haw", "Lauritzen Gardens/Kenefick Park", 5);
  78. INSERT INTO Visits VALUES("Yee Haw", "Edinburgh Science Museum", 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement