You won't learn anything by getting your code crafted by AI. Write it yourself from scratch (like the rest of us have been doing for 50 years and more).
DON'T use SELECT * in any SQL statement select just the columns you're interested in. That is less likely to error in future. SELECT * is an incredibly lazy way to code SQL.
How does your program create a schedule for any pill? That bit of code appears to be completely missing. I'd code seven * number of sessions per day binary columns. So you'd have, for example, four columns on a Monday; monday_morning, monday_lunchtime, monday_teatime, monday_night (repeated for each of the seven days). With a binary 0 or 1 value in each for whether a pill is needed. That may seem complicated right now but it should work with a row with 28 extra columns won't hurt the database.
Statistics: Posted by DougieLawson — Sat Mar 23, 2024 11:38 am