Does anyone know how i write a code for replication between 2 databases?

for instance if i want to make a replication from my office to home..i'll make data extration (a file that contains only the changes) whith a name (office_to_home.sql)..at home i'll make data import. well from home to the office will be (home_to_office.sql)

Any help would be greatly appreciated.

Thanks, Be`lier