# Best database structure for a "budget" with categories?

**URL:** <https://forum.kirupa.com/t/best-database-structure-for-a-budget-with-categories/302155>\
**Category:** programming\
**Created:** [December 22, 2009, 4:00pm UTC](https://forum.kirupa.com/t/best-database-structure-for-a-budget-with-categories/302155 "2009-12-22T16:00:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IQAndreas](https://avatars.discourse-cdn.com/v4/letter/i/f08c70/32.png) [@IQAndreas](https://forum.kirupa.com/u/IQAndreas)\
**Post date:** [December 22, 2009, 4:00pm UTC](https://forum.kirupa.com/t/best-database-structure-for-a-budget-with-categories/302155/1 "2009-12-22T16:00:30Z")

</div>

Yet again I am not quite sure how to set the database up for this one… Any opinions, even brief, are appreciated.

The site I am working on allows users to have a budget for their wedding. Each item in the budget is organized into several categories. There are several default categories to choose from, but users can also add their own **categories**. If they add a prechosen category, they are recomended several companies to choose from.

Each category can have a number of **items**. Each item can be a general price, a price based on number of guests, and a price based on quantity of something. Each item also has a “comments”, “company”, and “name” property.

Here is a quick sketch on how the budget is set up:  
[http://iqandreas.isbetterthanyou.org/PlaneraDittBrollop/budget/budget.htm](http://iqandreas.isbetterthanyou.org/PlaneraDittBrollop/budget/budget.htm)

This seems like it could be stored best as XML, however, how can everything be stored efficiently in the database?

EDIT: In a hurry. More details later. Please post now if possible…
