Tag Info

New answers tagged

0

I'm assuming this is K-6 not college. Otherwise the "one class per student" rule doesn't make sense. A Class entity has no attributes? Like Grade( K-6), Teacher, Level (regular, learning disabled), room number, etc. I think what you are really after is an intersection between Class and Students. A class is made up of many students. A student is registered ...


0

PRIMARY KEY (`STUDENT_ID`, `ANNUAL_FEES_ANNUAL_FEE_ID`, `PARENTS_PARENTS_ID`, `PARENTS_ACCOUNTS_ACCOUNT_ID`), It seems like Students would have student_id as its PRIMARY KEY. DECIMAL(4,2) -- do you want to limit things to $99.99? This is what I mean about many-to-many relation table: CREATE TABLE XtoY ( # No surrogate id for this table x_id ...


1

Assuming your surrogate keys are auto-incrementing integers marked as primary keys they will be the "rowid" for that table so you can read the last value added for a single insert using SELECT last_insert_rowid(). This operates like scope_identity in other databases. You would need to read each one after each row insert as each will replace record of the ...


2

This is fine as long as all you need is an index for the class, though it may be very difficult to troubleshoot exactly what is meant by a particular record in either future develompent or by a user for any reason at all. If you want to be able to define anything about the class, say a name or other defining attribute, you'd just want to add this to the ...


1

For 1:n relationships no intermediate table is neccessary. You can simply model that with 2 tables, one for the 1 cardinality and the other for the n cardinality. The outcome is that one record in the referenced table can be referenced by many records in the referencing table. You need an intermediate table for n:m relationships only, because you cannot ...



Top 50 recent answers are included