Yes, unlink() deletes the designated file.
You should be a little more clear in your intentions. So you are storing the file path in a mysql database?
If so, then yes you can remove the file path and leave the image intact. That would use the UPDATE or DELETE query.
As long as you use the MySQLi or PDO libraries with prepared statements you should be fine