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.

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
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
2 votes
Accepted

Store timeseries data in normal SQL database

Do NOT normalize any "continuous" or "numeric" values, such as a timestamp. First of all, TIMESTAMP and DATETIME each take 5 bytes. INT takes 4 bytes. So, that's not much savings. A 3-byte MEDIUMI …
Rick James's user avatar
  • 79.4k
2 votes

Integrity constraints in a relational database - should we overlook them?

Changing the title changes the question. FOREIGN KEYs are optional. They do: An FK implicitly create an INDEX in one of the tables. Such an index can be manually added. (So FK is not required fo …
Rick James's user avatar
  • 79.4k
2 votes
Accepted

MySQL - Store date as a value with an ID?

It sounds like you have reinvented "Entity-Attribute-Value" schema. This will be painful in the long run. Meanwhile... Do not "normalize" dates or other 'continuous' values (such as FLOAT). The DA …
Rick James's user avatar
  • 79.4k
2 votes

Advice for my DB design and how to handle null / measuring errors

(Others may disagree, but here goes...) If you have a good "natural" PRIMARY KEY, use it. In my own tables, I find that is the case about 2/3 of the time. What makes it good? Must be UNIQUE (sinc …
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
1 vote
Accepted

Strategies for Database Schema Redesign on Un-Normalized Group of Order Tables in Inventory ...

An "order" is composed of multiple "items", yes? Well, don't mix the two things in a single table. Similarly eBayOrders_account1 seems to be a mashup of orders, orderitems, users and payment. In gen …
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
Accepted

I created a DB schema for a project relating to collecting comments for web pages, is relati...

A couple of cmments: CommentReplies seems to be implementing many-to-many. I would expect it to be one-to-many -- as in, each comment has one 'parent'. One-to-many does not need an extra table; you …
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
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

15 30 50 per page