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 vote

Should I break a large user table into smaller tables for specific roles and information?

For "thousands", splitting (or not) will make little difference to performance. Even for millions, it may not matter. For maintainability and performance, let's see the main queries. JSON may be an …
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 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
-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
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
0 votes

Normalization using DENSE_RANK and LAST_INSERT_ID

You don't need to stand on your head to get the id: Step 1: Populate Orders in a single statement: INSERT INTO Orders (scanId, customerId) -- Leave out; `id` it will be set SELECT DISTINCT scanI …
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
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

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
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
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
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
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
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
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

15 30 50 per page