$HASH{country}{fruits} = 1 where country can have value Canada , US , Taiwan , England etc.. where fruits can have value apples[AA-ZZ] , pears[AA-ZZ] , watermelons[AA-ZZ] etc so example database look would be : Country : Canada US Taiwan Fruits : apples applesAB applesZB pearsWE pearsDF watermelons orangesUPE orangesABC . . . . . . . . . note : different countries can have different number of elements in fruits