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

  • Home
  • SEARCH
  • 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 6069667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:50:49+00:00 2026-05-23T09:50:49+00:00

I need an advice if i am doing the right thing at MySQL database.

  • 0

I need an advice if i am doing the right thing at MySQL database. I am connecting this database which i named inventory to a java application, this consist of a table named item and here are the details:

  1. id – int(11), AUTO_INCREMENT
  2. item_name – varchar(50)
  3. category – varchar(25)
  4. q_box – int(11)
  5. unit_price_box – double
  6. sub_total_box – double
  7. q_pc – int(11)
  8. unit_price_pc – double
  9. sub_total_pc – double
  10. grand_total – double
  11. recent_date_purchased – date
  12. last_date_modified – timestamp

I am already using this to store stocks in the development of an inventory application, but what i want to do now is to add a table which will store orders from customers.

I am planning to do this:

table name: orders

which consists of the following:

  1. order_id – int(11), AUTO_INCREMENT
  2. item_name – varchar(50)
  3. category – varchar(25)
  4. q_box – int(11)
  5. unit_price_box – double //this is the retail/wholesale price per box
  6. sub_total_box – double
  7. q_pc – int(11)
  8. unit_price_pc – double //this is the retail/wholesale price per pc
  9. sub_total_pc – double
  10. grand_total – double
  11. customer_name – varchar(50)
  12. last_date_modified – timestamp

    My question is: Am I violating any MySQL rules since I am using a same variable?

or do you have any advice? Any advice would be highly appreciated..

Thanks in advance 🙂

  • 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-23T09:50:50+00:00Added an answer on May 23, 2026 at 9:50 am

    You might be better off with the items table, as well as an orders and order_items table.

    orders

    id int(11), AUTO_INCREMENT
    customerid int(11)
    orderdate datetime
    PRIMARY KEY (id)
    FOREIGN KEY (customerid) REFERENCES Customers(Id)
    

    order_items

    orderid int(11),
    itemid int(11)
    FOREIGN KEY (orderid) REFERENCES Orders(id)
    FOREIGN KEY (itemid) REFERENCES Items(Id)
    

    That way there is less repeated data.

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

Sidebar

Related Questions

I need advice on how to have my C# console application display text to
I need advice regarding subselect performance in MySQL. For a reason that I can't
I need your advice about framework selection (Java vs Mono) for a new large
I need the advice from someone who knows Java very well and the memory
I want to spawn 200 threads simultaneously in Java. What I'm doing right now
I need some specific and some general advice. I'm a fairly proficient Java programmer
I need a little advice in manipulating DataGridView in Visual Basic .Net. This is
I need to do some UML diagrams, and doing the work right in Eclipse
I need advice on the following HTML: <!-- Beginning of ROW !--> <div id="row1">
edit: I need advice on best way to search with regex in vim and

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.