比较2个表并根据条件更新一个表

I have 2 tables

table1

name    phoneno    email    status

name1 11111111 email1 

name2 22222222 email2

name3 33333333 email3 

name4 44444444 email4

table2

deviceaddr

email1

email3

Now i need to compare these 2 tables and update my first table such that if table1.email=table2.deviceaddr then my table1 should be updated like shown below:

table1

name    phoneno    email    status

name1 11111111 email1 present

name2 22222222 email2

name3 33333333 email3 present

name4 44444444 email4

How to write the SQL query for this? I am using PHPMyAdmin

You can try this :

update table1
set status = 'present'
where email in (select deviceaddr from table2)