Nulty wrote: » Is that any better?
Nulty wrote: » Users and profiles are interchangeable I guess. User is the person controlling the profile and profile is the data associated with the user, a representation of the users attributes.
Nulty wrote: » User/profile is an email, student number, password, location, arrive time for each day of the week(Mon - Fri), Administrator flag etc.
Nulty wrote: » Locations are handled with a set list of Dublin post codes 1 through 24.
Nulty wrote: » Again, the times are handled with a list starting with "none" for no arrive time indicating that the user will not go to college that day. It is an item (default) on the list.
Nulty wrote: » The arrivetimes has id,mon,tue,wed,thu,fri,user_id as field names. Each record belongs to 1 user only
Nulty wrote: » Oh, I've settled on user as the name. I forgot to mention I'm recording the persons first and last name for user seems more suitable.
Nulty wrote: » The way I see it is that location is a type of data and arrive times are another type of data.
Nulty wrote: » I suppose there is no need to record the absence of data. I could leave that as null.
Nulty wrote: » When the users search the application for people the information they receive is a full set of arrive times for the query.
Nulty wrote: » Something has to be displayed under the heading of Monday even if that person doesn't go to college on Monday. But does that need to be in explicitly recorded? I don't know.
Tom Dunne wrote: » That's fine so. Remember that for later.
Tom Dunne wrote: » Right, so at this stage are they types of data or are they entities?
Tom Dunne wrote: » Leave it as null, or simply not record it?
Tom Dunne wrote: » I am not following you on this one.
Tom Dunne wrote: » Jumping ahead a bit, if the SQL query returns noting for a day, at what layer are you going to handle what is displayed? As in, do you store "no college this day" in the database, or do you let the calling code determine "IF SQLQUERY IS NULL THEN DISPLAY TEXT= 'don't go to college this day' " or something along those lines.
DublinWriter wrote: » Probably easier/smarter just to have four fields here: 1. id 2. dow (Day of week) 3. arrivetime 4. user_id That should make your searching queries a little neater as you won't have to hard-code in days of the week into your queries to match people with the same specific daily start times. But what about flexi-time workers that can clock-in within a two-hour window?!?!? (sorry, too much coffee).
DublinWriter wrote: » Let's hope there will never be two John Smiths working there!
id day arriv ----------------- 1 Mon 09:00 2 Tue 11:00 3 Thur 13:00 4 Wed 10:00
Nulty wrote: » So, can anyone help me with my problem? Should the arrive times be in a separate table or in the user table. My gut feeling is that they should be in the user table.
DublinWriter wrote: » I would think arrival times should be in the main times table for the purpose of your exercise.
DublinWriter wrote: » For extra brownie points you might want to have two arrival time fields - timemin and timemax as quite a few people work flexi-time these days - eg. John Smith might get in between 8am and 10am, but Paul Brown needs to get in by 9am, so John could theoretically share with Paul.
DublinWriter wrote: » The username should be unique, but it also shouldn't be your primary key in this table if you follow my table design as I'm suggesting not to hard code in the days. Your PK in the table should be an auto-incrementing numeric.
DublinWriter wrote: » To backtrack, you'll have the following tables: TBL_USERS (pk is the student_id) TBL_ARRIVAL_TIMES (pk is auto incrementing numeric, FK is student_id)
DublinWriter wrote: » Clear enough?
DublinWriter wrote: » Just out of curiosity, does your course cover Third Normal Form database design?
Nulty wrote: » Yes, they do that in the Introduction to Databases and Information Systems Module. It starts next week. Thanks for taking the time DW.
DublinWriter wrote: » No problem. Personally, I'd be wondering why they gave you an exercise like this before covering Database design and 3NF?
Nulty wrote: » TBH, I think I'm paying too much attention to the database design for this project. Its a web technologies module and I should be focussing more on accessibility, usability and other such interesting topics. My database is just bugging me and I want to find the best way to do it.