Reputation
7,195
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 9 23
Newest
 Explainer
Impact
~161k people reached

Mar
15
answered How can I compare the schema of two databases?
Mar
15
answered Warehouse Database Design Question
Mar
14
revised How to insert values in junction table for many to many relationships?
Fixed typo
Feb
17
comment School fees database design
All financial databases should begin with a double-entry accounting design. Students are customers and will have accounts. Fees are like products that students buy. Find a good reference design for accounting and product sales and apply it to your system.
Feb
1
revised Getting sum result for last year divided quarterly
Corrected spelling, grammar and punctuation to make the question easier to understand.
Jan
31
comment Product Attribute System While Avoiding EAV
I've discussed using EAV for product catalogs on Stack Overflow here: stackoverflow.com/questions/11779252/… - EAV is evil, except when it is actually the best approach. Attributes of products in a catalog is one where EAV is often the most efficient and suitable design.
Jan
27
comment Multiple user roles with different attributes
Your sections are connected, but your diagramming tool doesn't see it because you didn't define the referential integrity in your DDL (or your modeling tool) properly. Note that every specialty role has a key of user_id. This should be FK to Users.id. In other words, Users is a super-type and admins, employees, customers, etc. are all subtypes related 1:0,1 to the super-type.
Jan
27
comment linking a single table (comment) to multiple tables (article,link,attachment)?
This question was essentially asked yesterday, see: dba.stackexchange.com/questions/90137/… The linked question is about sharing addresses, but the same discussion applies to sharing comments, links, etc. etc.
Jan
26
answered Normalising shared entities and applying constraints
Jan
19
comment Design: how to store lots of booleans?
@AleksandrMakov - A "pure intersection" is a table containing only foreign keys that together make a composite primary key for the table. OBJECT_HAS_THING would be a pure intersection if the only columns in that table are my_object_id and ownable_thing_id and if both of these columns together are the primary key of the table. If you added a third column to this table, say has_one (bit) then it would no longer be a pure intersection.
Jan
19
comment Design: how to store lots of booleans?
@AleksandrMakov - If one of your major use cases is searching by a list of particular types of things that your object has, then using 300 bit columns will inevitably result in table scans, so your query performance will has tortoise as it were. Depending on how many of your ownable things a typical object has (i.e. if the average number is much less than 300) then you are probably better off using the pure intersection rather than a fully populated intersection with a bit flag. Treat the absence of a link record as "not owned". This will be at least as performant as 300 bit flags.
Jan
19
answered Design: how to store lots of booleans?
Jan
19
comment what is better, multiple column or multiple rows while schema design
Third normal form is your friend. You should read up about the normal forms and design your transactional tables around 3NF (or higher, if applicable). Denormalize along the lines of your first table design for reporting purposes, if necessary for performance reasons or for purposes of having a stable snapshot.
Jan
18
answered Designing a High Score/Leaderboard table
Jan
5
comment what is a good use case for splitting user table by role
@user20358 Yes, a view won't save anything in terms of read performance, unless you materialize the view. However, the cost of reading through the view is very likely to be negligible. The greater issue is more likely to be maintainability of your code.
Jan
4
answered what is a good use case for splitting user table by role
Dec
17
answered database design for storing individual users' items
Dec
6
answered Suitable way to record users requests for usage invoicing/billing in database?
Nov
16
comment Advice on table structure change
Since your scores are all mandatory, there probably isn't a resource-usage argument to be made for splitting them out. You could make a future-proofing argument for splitting scores/comments into an intersection table between BOXSUPERVISION and SCORE_TYPE or the like.
Nov
16
revised Advice on table structure change
Reformatted markdown and text to be more readable.