MySQL Forums
Forum List  »  PHP

Re: cross join check syntax please
Posted by: Peter Brawley
Date: April 30, 2022 10:11AM

Assuming you have ...

subscribe2( custid int unsigned primary key auto_increment, ... ),

... I think you want ...

create table mygallery2(
  gallerid int unsigned primary key auto_increment,  -- PK
  custid int unsigned not null,                      -- FK
  refnbr int not null,
  pseudo varchar(?) not null,                        -- NEED LENGTH
  musician varchar(?) not null,                      -- NOTE 1
  nickname varchar not null,                         -- ditto
  group1 varchar not null,                           -- NEEDS LENGTH, NOTE 2
  description varchar not null,                      -- NEEDS LENGTH
  status varchar not null,                           -- NEEDS LENGTH OR SHOULD BE INT?
  date date not null,                                == NOT varchar!!!
  price decimal(10,2) not null,                      -- ditto
  picture varchar not null,                          -- SHOULD NE BLOB OR NAME OF FILE ON DISK
  email varchar not null,                            -- needs length
  foreign key(custid) references subscribe2(custid)
);

note 1: Musicians to reps & works is 1:many, so this should probably be an int unsigned foreign key to a musicians lookup table.

note 2: Musicians to groups likewise, so this should probably be a int unsigned foreign key to a groups lookup table.

Options: ReplyQuote


Subject
Written By
Posted
Re: cross join check syntax please
April 30, 2022 10:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.