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 7650547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:16:47+00:00 2026-05-31T11:16:47+00:00

So, I am creating a transaction database table to store, well, transactions between the

  • 0

So, I am creating a transaction database table to store, well, transactions between the merchant and customer.

Sometimes the customer will pay with a store card and other times with a credit card (cash is not used in this system).

How do I model this in the database. My current thinking is that the transaction table has a field for store card transaction and one for credit card transaction. These fields will then reference two seperate tables to store data specific to the payment method.

This means that one of these fields will always be null while the other is a reference to the appropriate payment method table.

Example:
A transaction was completed with a credit card and not a store card. This means that in the transaction table, the store card field is null, while the credit card field contains a reference to the credit card transaction table. This credit card transaction table stores data related to a credit card transaction e.g. auth code, transaction id etc.

The reason this has me confused is because I was taught in college that NULL values are bad. But is this not a case where they are required.

Is there a term for this type of problem or what query should I be using to match it in Google?

Many thanks, Conor.

  • 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-31T11:16:48+00:00Added an answer on May 31, 2026 at 11:16 am

    Do not use two card number fields

    CardNumber should be one column and contain any card number from any transaction. You should have another table somewhere on the system that keeps track of which “Store Cards” have been issued. A join from the transaction table to the “Store Card” table will identify which transactions were made using store cards and which ones were made using credit cards.

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

Sidebar

Related Questions

I'm creating an application that will store geolocation data for specific transactions. Should I
I have the following database tables/EF objects public class Transaction { //some other properties
I am designing a database that needs to store transaction time and valid time,
While creating complex procedures the whole function is treated as a transaction or If
I have some code using a System.Transactions.TransactionScope , that creating a new instance of
Creating an XPathDocument with referenced DTD sometimes throws a web exception. Why?
I'm creating a simple set of tables to store a number of lists. The
Just a question about best-practices when upgrading an existing database. Assuming there will be
I'm really upset with Hibernate! I have a database table (mysql) that holds parent-child
I'm working on creating a checkbook app for android using a database to record

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.