Edited SQL - db