Re: storing start/end times
Posted by: Peter Brawley
Date: April 01, 2015 01:26PM

Doesn't look like a problem, eg given ...

stores( sid int unsigned primary key auto_increment, ... )
calendar( d date ); /* one row per day */

create table storesopen(    -- one row per store per open period
  id int unsigned primary key auto_increment, 
  sid int unsigned,         -- store id
  d date,                   -- date
  open time, 
  close time,
  foreign key(d) references calendar(d) on update cascade on delete cascade,
  foreign key(sid) references stores(sid) on update cascade on delete cascade
);

Options: ReplyQuote


Subject
Written By
Posted
Re: storing start/end times
April 01, 2015 01:26PM


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.