On Integrating Logic Programming and Databases