Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1876

Normalization is the process of organizing columns into tables within a relational database in such a way as to minimize redundancy and avoid insertion, update and deletion anomalies.

-1 votes

What normalization rules flattening one-to-many violate?

I care more about the performance than about NFness. Having a column for each option becomes unwieldy unless such additions are very rare. There is a third option -- the SET datatype allows up to 64 t …
Rick James's user avatar
  • 79.4k
0 votes

3NF normalized table design

Get rid of user_addresses; instead, have an address_type (varchar) in the addresses table. That also gets rid of the over-normalized "address_types" table. Address_types might be "billing", "mail", " …
Rick James's user avatar
  • 79.4k
1 vote

One to many relationship for constant data

In the table Chapter you should have a column book_id. That is the standard way to implement many:1. There no need for an extra table; that is only for many:many.
Rick James's user avatar
  • 79.4k
1 vote

How to normalize a lookup table containing NULL? - or should I bother?

Perhaps a better policy: When registering a user, store the fee charged into the user's history. Derive the fee from some business logic that may or may not be stored in a database table. Note how …
Rick James's user avatar
  • 79.4k
1 vote

Help with tables normalization for delivery system

Turn things around. Table addresses needs a delivery_id. Ditto for the table storage. If you want to avoid having multiple rows for addresses or storages, then have two "many-to-many" tables to map b …
Rick James's user avatar
  • 79.4k
1 vote

Is this the proper way to integrate normalization?

Normalization decreases the hassles; you decide where the cutoff is -- among speed/space/hassle/etc. …
Rick James's user avatar
  • 79.4k
0 votes

Database Design for Cars

Q1: "correct" in what sense - according to theory or practice or performance? Q2: JOINs are not that deadly. Q3: We need to see the SELECTs that you will use before we can judge your Schema. Q4: …
Rick James's user avatar
  • 79.4k
2 votes
Accepted

How can I improve this table, and subsequently the performance of the queries I execute on it?

InnoDB tables really need an explicit PRIMARY KEY. If you don't have a 'natural' key, add an AUTO_INCREMENT. INT(3) and INT(99) mean the same thing -- a 4-byte binary number. Consider changing to T …
Rick James's user avatar
  • 79.4k
2 votes
Accepted

Normalize repeated indefinite ongoing dates for an event

To focus on ongoing and future dates... A table with suitable columns for simple cases of repeated actions. One row per repeating event. No specific dates except start and end. A table for excepti …
Rick James's user avatar
  • 79.4k
0 votes

Now to normalize table when position in group uniquely identifies entity

Which happens more often? Renaming/reordering versus fetching? If you are fetching most of the time, then make that more efficient (PK order), while letting the other be more costly. If you are ren …
Rick James's user avatar
  • 79.4k
1 vote

Store row count or use query to calculate on Primary Key

Redundant information in a database is a no-no. If you have an index (such as the PRIMARY KEY) on user_id and if there is not thousands of rows for a user, the computing it on the fly is the way to g …
Rick James's user avatar
  • 79.4k
0 votes

Creating optimized table without duplicates in MySQL

If you are asking about preventing duplicate rows, 'constraining' (user, date) to be "unique" (via UNIQUE KEY or PRIMARY KEY) is sufficient. (See two other answers.) If, on the other hand, you need …
Rick James's user avatar
  • 79.4k
-1 votes

can two tables have same primary key and at the same time this primary key is a foreign key ...

Yes, but at most one can be AUTO_INCREMENT, else they would be fighting over how to number them. No, in the sense that is rarely wise to have two tables instead of one. There are exceptions; what is …
Rick James's user avatar
  • 79.4k
2 votes

Most efficient table structure for multi-tenant database

A typical implementation of "multi-tenant" is to have a database for each client. Each database has the same few dozen tables. Security (if you care) is somewhat available at the database level. If y …
Rick James's user avatar
  • 79.4k
2 votes

More tables or More records performance wise

Both of these schema anti-patterns have been repeatedly refuted: Do not have multiple 'identical' tables. Do not spread an array across columns. So have one table with lots of rows: sites …
Rick James's user avatar
  • 79.4k

15 30 50 per page