How to design a product table for many kinds of product where each product has many parameters

You have at least these five options for modeling the type hierarchy you describe: Single Table Inheritance: one table for all Product types, with enough columns to store all attributes of all types. This means a lot of columns, most of which are NULL on any given row. Class Table Inheritance: one table for Products, … Read more

How can you represent inheritance in a database?

@Bill Karwin describes three inheritance models in his SQL Antipatterns book, when proposing solutions to the SQL Entity-Attribute-Value antipattern. This is a brief overview: Single Table Inheritance (aka Table Per Hierarchy Inheritance): Using a single table as in your first option is probably the simplest design. As you mentioned, many attributes that are subtype-specific will … Read more

Is storing a delimited list in a database column really that bad?

In addition to violating First Normal Form because of the repeating group of values stored in a single column, comma-separated lists have a lot of other more practical problems: Can’t ensure that each value is the right data type: no way to prevent 1,2,3,banana,5 Can’t use foreign key constraints to link values to a lookup … Read more

how to create this table in sql server?

may be this will help you: CREATE TABLE COUNTRY( country VARCHAR(255) PRIMARY KEY, language VARCHAR(255), timezone TIMESTAMP, currency FLOAT ) CREATE TABLE REGION( region VARCHAR(255) PRIMARY KEY, landtype VARCHAR(255), country VARCHAR(255) FOREIGN KEY REFERENCES COUNTRY(country), scenery VARCHAR(255), page INTEGER UNIQUE, ) CREATE TABLE RESORT( resort VARCHAR(255) PRIMARY KEY, region VARCHAR(255) FOREIGN KEY REFERENCES REGION(region), transfertime … Read more