By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,273 Members | 1,786 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,273 IT Pros & Developers. It's quick & easy.

Missing inner JOIN statement. For a school project i made a database. My teacher told

P: 1
Hello everyone,

For a school project i made a database. My teacher told me that i am missing a JOIN statement in the third query. can anyone help out?

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE DiscountCard ( 
  2.     cardnumber integer Primary key, 
  3.     name varchar(255), 
  4.     address varchar(255), 
  5.     city varchar(255) 
  6. );
  7. CREATE TABLE Transaction (
  8.     TransactionNumber Integer PRIMARY KEY,
  9.     date date NOT NULL,
  10.     time time NOT NULL,
  11.     cardnumber integer REFERENCES Discountcard(cardnumber),
  12.     Storenumber integer REFERENCES Store(Storenumber)
  13.  
  14. );
  15. CREATE TABLE Store(
  16.     Storenumber integer PRIMARY KEY,
  17.     Area varchar(255) NOT NULL,
  18.     address varchar(255) NOT NULL
  19. );
  20. CREATE TABLE Product (
  21.     Productnumber integer PRIMARY KEY,
  22.     Productname varchar(255) NOT NULL,
  23.     Price Decimal(5,2) NOT NULL
  24. );
  25. CREATE TABLE Purchase (
  26.     transactionnumber integer,
  27.     product integer, 
  28.     amount integer NOT NULL,
  29.     PRIMARY KEY(transactionnumber, product),
  30.     FOREIGN KEY(transactionnumber) REFERENCES Transaction(transactionnumber),
  31.     FOREIGN KEY(product) REFERENCES Product(Productnumber
Jan 20 '20 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.