title: Yii Framework database relations in models
body: <p>I am doing a small POS application in <a href="http://www.yiiframework.com/" rel="nofollow">Yii Framework</a>. I have my database looking like this.
  Now I have done the part for model and crud. But here I am little bit confused with the building relation among them. So can some one kindly tell me what will be the relations among them in models? Any help and suggestions will be really appreciable. Thanks..</p>
  
  <pre><code>====================
        mspl_sales
  ====================
  id
  product_id
  store_id
  discount_id
  agent_id
  date
  price
  discount_percentage
  
  
  ===================
  mspl_requistitation
  ===================
  id
  store_id
  product_id
  agent_id
  date
  requisition_number
  procure_quantity
  balance_store_stock
  priority
  
  
  
  ==================
     mspl_product
  ==================
  id
  product_name
  cost_price
  selling_price
  
  
  
  ==================
    mspl_store
  =================
  id
  store_name
  store_location
  
  
  
  ==================
      mspl_discount
  ==================
  id
  discount_type
  
  
  =================
  mspl_agent
  ===============
  id
  user_name
  email_id
  agent_code
  authorization_password
  </code></pre>