Create bdd.py

This file contains database functions.