Skip to main content

All Questions

422 votes
10 answers
104k views

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

Imagine a web form with a set of check boxes (any or all of them can be selected). I chose to save them in a comma separated list of values stored in one column of the database table. Now, I know ...
Mad Scientist's user avatar
163 votes
1 answer
165k views

How to implement a many-to-many relationship in PostgreSQL?

I believe the title is self-explanatory. How do you create the table structure in PostgreSQL to make a many-to-many relationship. My example: Product(name, price); Bill(name, date, Products);
Radu Gheorghiu's user avatar
116 votes
6 answers
72k views

What is database normalisation/normalization? [closed]

What is database normalization and how does it help? Does it apply to anything outside of databases?
AJ.'s user avatar
  • 13.6k
195 votes
19 answers
90k views

Surrogate vs. natural/business keys [closed]

Here we go again, the old argument still arises... Would we better have a business key as a primary key, or would we rather have a surrogate id (i.e. an SQL Server identity) with a unique constraint ...
Manrico Corazzi's user avatar
413 votes
17 answers
342k views

Should each and every table have a primary key?

I'm creating a database table and I don't have a logical primary key assigned to it. Should each and every table have a primary key?
Daniel Silveira's user avatar
885 votes
15 answers
522k views

What's the difference between identifying and non-identifying relationships?

I haven't been able to fully grasp the differences. Can you describe both concepts and use real world examples?
Loc Nguyen's user avatar
  • 9,532
566 votes
40 answers
129k views

Database development mistakes made by application developers [closed]

What are common database development mistakes made by application developers?
341 votes
4 answers
133k views

What does character set and collation mean exactly?

I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect? I'm asking for an explanation of the two and ...
Sander Versluys's user avatar
479 votes
12 answers
1.1m views

Can I have multiple primary keys in a single table?

Can I have multiple primary keys in a single table?
user avatar
924 votes
23 answers
733k views

Database, Table and Column Naming Conventions? [closed]

Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: Should table names be plural? Should column ...
GateKiller's user avatar
  • 75.3k
19 votes
4 answers
26k views

How are super- and subtype relationships in ER diagrams represented as tables?

I am learning how to interpret Entity Relationship Diagrams into SQL DDL statements and I am confused by differences in notation. Consider a disjoint relationship as in the following diagram: Would ...
xingyu's user avatar
  • 322
297 votes
4 answers
252k views

What are database normal forms and can you give examples? [closed]

In relational database design, there is a concept of database normalization or simply normalization, which is a process of organizing columns (attributes) and tables (relations) to reduce data ...
barfoon's user avatar
  • 28k
280 votes
38 answers
131k views

What's wrong with foreign keys?

I remember hearing Joel Spolsky mention in podcast 014 that he'd barely ever used a foreign key (if I remember correctly). However, to me they seem pretty vital to avoid duplication and subsequent ...
12 votes
3 answers
8k views

How to create multiple one to one's

I have a database set up with many tables and it all looks good apart from one bit... Inventory Table <*-----1> Storage Table <1-----1> Van Table ^ ...
Luckyl337's user avatar
  • 315
222 votes
15 answers
185k views

Strings as Primary Keys in MYSQL Database [closed]

I am not very familiar with databases and the theories behind how they work. Is it any slower from a performance standpoint (inserting/updating/querying) to use Strings for Primary Keys than integers?...
mainstringargs's user avatar

15 30 50 per page
1
2 3 4 5
65