SQL functionality

In dev