Ref Integrity added, operation table improved

operation table not working with foreign keys