Hi, Simon,

On Thu, Jul 4, 2013 at 6:50 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 5 Jul 2013, at 2:10am, Igor Korot <ikoro...@gmail.com> wrote:
>
> > CREATE TABLE players(playerid integer primary key, name char(50), age
> > integer, value integer, currvalue double...);
> > CREATE TABLE playersinleague(id integer, playerid integer, value integer,
> > currvalue double, draft boolean, isnew char(1),...);
> > CREATE TABLE playerpositioninleague(id integer, playerid integer,
> > positionid integer);
> >
> > The problem comes when I try to add a player to a league and later on
> > delete the new players in the league.
> > I also need to keep leagues independent, meaning that new players in one
> > league will not appear on the new league.
>
> You don’t need three tables for this, just one.  Have just the player
> table, but add two fields to it: league and positioninleague.
>

Good suggestion, but...
When the user removes new players, it actually means: "bring the league to
the original state".
Which means all values for this particular league should be reset to the
original.

This is why I wanted to keep 2 tables: to simplify the processing  of reset
algorithm.

Thank you.


> I don’t understand the other fields in your playersinleague table, but I’m
> guessing they can be added to the player table too.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to