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

2d
comment Does schema normalization enhances query efficiency
@FokwaBest - There is no one factor that has 100% influence over query efficiency. If your schema doesn't permit an efficient query because it is badly structured, then you obviously won't have one. Lack of normalization is not the only (or necessarily the most important) way in which your schema could inhibit query efficiency. Inappropriate indexing is more important, for example. If your schema isn't an obstacle but you write your query in an inefficient way then of course your query will be inefficient. What you have, how you structure it and how you access it all come into play.
May
23
answered Does schema normalization enhances query efficiency
May
19
comment How should I model an “either/or” relationship?
@DanielSerodio - I used Visio with smart shapes I built myself based on the James Martin ERD notation. The shapes use a custom line texture to give them an informal appearance, which I find helpful in reminding people when a diagram is a "sketch" or draft design.
May
9
answered How to enforce that one row in a parent table MUST be associated with at least a row in a child table
May
5
comment T-SQL insert value based on identity column
@Jyrkka - I mean a situation in which a relation is not in second normal form. In your case specifically, a customer is uniquely identified by the meaningless sequence number. This number is a candidate key. Adding a customer type prefix to this number does not make it more unique.
May
1
comment T-SQL insert value based on identity column
@Jyrkka - I'm not offended, so don't worry on that account. My point is that using an identifier prefix to encode something that is an independent fact about the entity is considered bad design as it violates the spirit of database normalization rules insofar as it creates a situation in which non-key attributes are not dependent on the whole key. Perhaps pseudo-random is a less apt term than meaningless. An IDENTITY value (or Sequence value) is not related semantically to other (non-key) attributes of the entity. In that sense it may as well be a random number, rather than sequential.
Apr
28
comment T-SQL insert value based on identity column
It doesn't make much sense to me to embed a customer type code in a pseudo-randomly generated customer identifier. The conventional wisdom is not to build meaning into identifiers. As rules of thumb go that is a good one in my experience. However, your mileage may vary.
Apr
27
revised T-SQL insert value based on identity column
Add constraints for clarity
Apr
27
comment T-SQL insert value based on identity column
@PaulWhite - obviously, but if the IDENTITY is being used in a PK, one would assume that such a precaution will be taken. The OP's question didn't include DDL, so one is left to presume.
Apr
27
answered T-SQL insert value based on identity column
Apr
9
comment DISTINCT Role in SELECT
I'm guessing that you have 3,074 agents and they each match your various criteria at least once.
Mar
30
comment How to insert values in junction table for many to many relationships?
@siddhesh - @@IDENTITY is SQL Server. I have corrected this answer to reflect MySQL, which is one of the OP's tags. The MySQL equivalent of @@IDENTITY is LAST_INSERT_ID().
Mar
30
revised How to insert values in junction table for many to many relationships?
Corrected answer for MySQL syntax (vs. SQL Server)
Mar
23
answered db schema for a object with multiple foreign key tables
Mar
19
revised Database design - Projects with multiple Clients but only specific client contacts
Added an illustration for clarity
Mar
18
answered Best away to keep monthly records of loans
Mar
18
answered Should I have a parent table with only one field?
Mar
18
answered Database design - Projects with multiple Clients but only specific client contacts
Mar
18
comment database design question - How to make the table 3NF and have no orphans
+1 for mapping close to reality.
Mar
15
revised Which databases can meet these replication requirements?
Modified tags to get the right eyes on this question