adding sqls and ERM