SQL structure and Calendar? <p>I'm having trouble unpacking a calendar structure from sql into golang structs, here is what I have. </p> <pre><code>type year struct { year int months []month } type month struct { month int days []day } type day struct { day int hours map[int]bool } </code></pre> <p>I'm planning an appointment calendar, each day may have 10:00, 11:00, 12:00, 13:00 etc. and I will read out a maximum of 3 months at a time. I cannot figure out how to unpack the following schema:</p> <pre><code>CREATE TABLE appointments ( id INT, year INT, month INT, day INT, hour INT, teacher INT, (id of teacher) student INT, (id of student) amount DECIMAL, (amount charged for the appointment) booked BOOL, (records availability) ) </code></pre> <p>The query:</p> <p><code>SELECT year, month, day, hour, booked FROM appointments a WHERE a.teacher = ? ORDERY BY day, month, year;</code></p>