Ask the Expert

Getting prices for customers in Access

The problem I get here is I am designing a database entry for my project. My paper needs to have different prices for different customers in the database (Access). However, I do not know how to set it up. This means that each customer has its own price; therefore, what the owner needs to do is just input the quantity, click the customer's name, so, how can I do that? Do I need to use Visual Basic or SQL to design it?

    Requires Free Membership to View

You can design this in several different ways, depending on the complexity of your underlying problem. The simplest schema that meets the criteria you described is to put the cost column in the customer table. You can then compute the cost of an order by fetching the price from the customer row and multiplying by the quantity.

As an observation, this design is very simple minded. It doesn't support his tory, it doesn't support customer classes, and it just meets the requirements in your original question. If you have additional constraints, please post a message in the SearchDatabase forums to allow for some dialog about what else you need for your solution.

For More Information

  • What do you think about this answer? E-mail the editors at editor@searchDatabase.com with your feedback.
  • The Best Database Design Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
  • Ask your database design -- or help out your peers by answering them -- in our live discussion forums.
  • Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.

This was first published in May 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: