Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7501669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:37:02+00:00 2026-05-29T20:37:02+00:00

For example, I have a table of bank users (user id, user name), and

  • 0

For example, I have a table of bank users (user id, user name), and a table for transactions (user id, account id, amount).
Accounts have the same properties across different users, but hold different amounts (like Alex -> Grocery, it is specific to Alex, but all other users also have Grocery account).

The question is, would it be better to create a separate table of accounts (account id, user id, amount left) or to get this value by selecting all transactions with the needed user id and account id and just summing the ‘amount’ values? It seems that the first approach would be faster, but more prone to error and database corruption – I would need to update accounts every time the transaction happens. The second approach seems to be cleaner, but would it lead to significant speed reduction?

What would you recommend?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:37:03+00:00Added an answer on May 29, 2026 at 8:37 pm

    good question!

    In my opinion you should always avoid duplicated data so I would go with the “summing” every time option

    “It seems that the first approach would be faster, but more prone to error and database corruption – I would need to update accounts every time the transaction happens”

    said everything, you are subject to errors and you’ll have to build a mechanism to maintain the data up-to-date.

    Dont forget that the first approach would be faster to select only. inserts updates and deletes would be slower because you will have to update your second table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's common to have a table where for example the the fields are account,
for example we have a table with the columns id, name, type, year. My
For example I have this table: TableX: code name consecutive 0 a 0 2
In my example I have a table where each row is a user for
for example i have table users , which have 3 fields: id - login
for example i have a table like this : name rating matei 124 andrei
I have one table users with 2 fields : id , name and another
For example have this table: Name | BodyType ---------------- John | 1 Ted |
For example I have a table which stores details about properties. Which could have
Using a site like StackOverflow as an example: I have a table of users,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.