locked
What Approach to follow? RRS feed

  • Question

  • User-1623383795 posted

    I have a tbl that lists cars, and I would like to sell these cars. I am thinking I would require another table such as sales?

    Then if was to display the details of the sold vehicle, I would need to use a table join?

    Am I on the right lines?

    Thursday, February 16, 2012 9:38 AM

All replies

  • User1604174074 posted

    I think you can add sold details in sales table itself and use quries to get the sold details...

    Thursday, February 16, 2012 9:45 AM
  • User-1623383795 posted

    What so in tblSales have e.g. name, model, price columns???

    Thursday, February 16, 2012 9:59 AM
  • User-1623383795 posted

    Ok I agree with that.... So far I have two display on the webpage that 1 that displays all vehicles and the other displays sold vehicles, I can select vehicles using a drop down and display them with the sales table. But ideally it should delete the selected value within the tblvehicle, or be flagged as sold, any advice on achieving this.

    Thursday, February 16, 2012 10:25 AM
  • User-1407477457 posted

    What so in tblSales have e.g. name, model, price columns???

    tblSales would have a vehicleID and information about the sale.  You would get information about the vehicle from the vehicle table.

    The other suggestion about having a field in your vehicles table to indicate whether it's been sold is a good one.

    Thursday, February 16, 2012 10:36 AM
  • User-1623383795 posted

    I understand that it is a good method, I have considered that. But ideally would it work in a real situation? Would you have a stock table, and with in that have a sold indicator, marking stock as sold?? Is that an appropriate way.

    Thursday, February 16, 2012 10:52 AM
  • User-1623383795 posted

    I understand that it is a good method, I have considered that. But ideally would it work in a real situation? Would you have a stock table, and with in that have a sold indicator, marking stock as sold?? Is that an appropriate way.

    Thursday, February 16, 2012 10:52 AM
  • User269602965 posted

    Sample database model for car sales

    http://www.databaseanswers.org/data_models/car_sales/index.htm

    Thursday, February 16, 2012 11:01 AM
  • User-1623383795 posted

    So it makes sense to have two tables one for sales stock and sold items.

    Thursday, February 16, 2012 11:17 AM
  • User-1407477457 posted

    So it makes sense to have two tables one for sales stock and sold items.

    Not to me.  But it's your opinion that matters, not mine.

    Thursday, February 16, 2012 3:31 PM