You have pretty much 4 choices:
NoSQL - definition Every record is stored as a set of Key/Value pairs. It is very flexible and fast. Not all of the report writers out there support this style of storage. There are many example database implementations of NoSQL. The one that seems to be most popular right now, is MongoDB.
EAV - definition This is where you turn either the whole table or a portion (in another table) on its side. This is a good choice if you already have a relational database in-house that you can't move away from easily. The custom info table example you gave is a good example of an EAV table.
Standard tables with XML columns - Think of this as NoSQL meets relational tables. The data stored in an XML column can be any format that XML supports, including multiple correlated sub-data. For the columns that you know are going to be "regular" columns, they can be built as the appropriate type of column to store the data (LastName, Address, City, State, etc.).
Standard tables with lots of extra columns - You have a relational database, you can't use either XML or EAV, and NoSQL is not an option. Add lots of extra columns of each type. I would guess 30 or more varchar, 30 or more integer, 15 or more numerics. And once you use a column for a value, don't re-use it. And don't delete the column either.
Out of all of these solutions, my own opinion is that you will find either the NoSQL or the EAV approach to be the most successful with the least amount of refactoring your code and your schema.
You will have a situation where you collect data one year, not the next, and then collect it again afterward. Trying to get the older data updated with the correct information is problematic and expensive. Storage is neither.
More generally: I would START with a list of questions that I want to answer. Like:
Who am I paying the most? Did I pay the sewage-hauling bill this month? What are my cash requirements for this month? Will I need to go out and kill stuff for food?
The nature of these questions should drive the design of the schema.
That said, this schema looks pretty good.
I agree with the idea that the debits and credits could be in a single table.
Best Answer
The simplest solution is this:
That takes the list of result rows and returns each one only once, even if it appears in the table multiple times. See "DISTINCT" in http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10002.htm fro details.
If you also want to know mor information about each row group, like how many hotels exist in each city you can use
GROUP BY
instead:This again returns each city only once but additionally counts how often it appears in the table. See http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_10002.htm#i2065777 for more details on that.
SQL Fiddle
Oracle 11g R2 Schema Setup:
Query 1:
Results:
Query 2:
Results:
If you want to create a view for each country you can just add a WHERE clause with the country name like this:
SQL Fiddle
Oracle 11g R2 Schema Setup:
Query 1:
Results:
Query 2:
Results: