Prepare base sql system