5 ms·
20 Database Design Best Practices
- viggity 15y agoI know this is a religious debate but this one bugs the hell out of me: Use singular for table names (i.e. use StudentCourse instead of StudentCourses). Table represents a collection of entities, there is no need for plural names. NOOOOOO!!!!!! The table stores MULTIPLE things, ergo, the table name should be pluralized. SQL makes more sense to read aloud this way. I mean, does anyone name their (code's) collections as singular?
- molecule 15y agoconcur. plural of name represents the table name / collection. singular of name represents an instance of collection / row of table. e.g. the students table represents a collection of student rows.
- pbreit 15y agoYeah, the jury seems to still be out on this one. If you are using SQL then plural sounds better. But if you are using some sort of ORM or data access layer, singular frequently works better (ie "rows = db(db.item.id>0).select()"). #10 also seems to be routinely violated, again, especially when ORM is used.
- noblethrasher 15y agoThree hours and no one has jumped on this one? Keep passwords as encrypted for security. Decrypt them in application when required DON'T encrypt passwords, use a good one-way hash. Actually, just use [s|b]crypt.