After going thru some tutorials on SQL Server 2008’s new feature “SPARSE COLUMN”, I have found that it doesn’t take any space if the column value is 0 or NULL but when there is a value, it takes 4 …
Tag: database-design
Best table design for application configuration or application option settings?
I need to store a series of configuration values in a database. A couple ways I thought of to store them are: a table with 2 colums(name,value) and a row for each pair, or a table with a column for each config parameter and 1 row? With the first I only need to add another row to add a config
What should I consider when selecting a data type for my primary key?
When I am creating a new database table, what factors should I take into account for selecting the primary key’s data type?
Database design for database-agnostic applications
What do I have to consider in database design for a new application which should be able to support the most common relational database systems (SQL Server, MySQL, Oracle, PostgreSQL …)? Is it even worth the effort? What are the pitfalls? Answer The short answer is to stick to features that are standardly, or close to standardly implemented. What this
How do I enforce data integrity rules in my database?
I’m designing this collection of classes and abstract (MustInherit) classes… This is the database table where I’m going to store all this… As far as the Microsoft SQL Server database knows, those are all nullable (“Allow Nulls”) columns. But really, that depends on the class stored there: LinkNode, HtmlPageNode, or CodePageNode. Rules might look like this… How do I enforce
Database Design for Revisions?
We have a requirement in project to store all the revisions(Change History) for the entities in the database. Currently we have 2 designed proposals for this: e.g. for “Employee” Entity Design 1: –…
Query a union table with fields as columns
I’m not quite sure if this is possible, or falls into the category of pivot tables, but I figured I’d go to the pros to see. I have three basic tables: Card, Property, and CardProperty. Since cards do not have the same properties, and often multiple values for the same property, I decided to use the union table approach to