The WHERE clause is incorrect. You need to define some type of equality for teacher.p_id. Like this: WHERE teacher.pid = 055511 AND borrowed.p_id = 0555111; Also, your join syntax is outdated. The better way would be to declare an INNER JOIN like this: FROM dbo.teacher t INNER JOIN dbo.borrowed b on t.p_id = b.p_id --(or some matching criteria) Reference:
http://straightpathsql.com/archives/2012/11/sql-server-join-syntax-its/ Hope that helps!
![thank you for replying, but unfortunately, it did not work, i uploaded a picture] thank you for replying, but unfortunately, it did not work, i uploaded a picture : /storage/temp/3867-lms-database.jpg