basic database script and functionalities