How can I design a relationship between two types of users? I have two types of users in drupal-7: children users and parents users. How can I design a relationship between these types of users? 

Also How can I maintain this relationship in the code? i.e. getting the parent of the child or vice versa.
You can use the User Relationships module for that.


  Administrators are able create relationship types (friend, coworker, etc). Relationship types can be setup to be one-way or mutual. If a relationship type is one-way (subscriber) only the requester is shown as relating to the requestee. Relationship types can also be set as needing or not needing approval. 


I've used this module for one of my project. It works great!