logo       

Re: Fun with SQL: msg#00069

programming.language-of-the-year

Subject: Re: Fun with SQL

Benjamin Walling wrote:

>It's interesting that you assumed the simplest database design for the
>problem. I assumed something more complex, given that he struggled to
>create the query.
>
>
Don't assume my struggles came from a complex problem ... ;-) but
thanks for the generosity.

>The query gets much more difficult when the Students table does not keep
>summary data about tardies.
>
Actually, just requiring the tardy dates in the select statement would
suffice to make it a bit more complex, though your point is valid, many
wouldn't store the calculated summary data in the db (unless for
performance reasons, AFAIK).

>What we don't know is whether his database
>is keeping a record of days that were attended or days that were tardy.
>A record of days that were attended makes the query much more fun -
>finding the holes among known school days instead of having a list of
>them.
>
True enough. For this example, we can keep it to a child table from
STUDENTS that list only tardy dates.

> Also adding to the difficulty (although not much) is whether you
>have a field on the Students table that identifies the date of the last
>tardy message, or whether you have a table that keeps track of the tardy
>messages and have to check it for the last date sent per student.
>
>
Right again -- we can keep the notifications in a field in the STUDENTS
table.

--
Chris
http://clabs.org/blogki



------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~->


Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/pragprog/

<*> To unsubscribe from this group, send an email to:
pragprog-unsubscribe-hHKSG33TihhbjbujkaE4pw@xxxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise