Adding (not working) SQL functionality