I am creating my database with primary key i am passing this primary key to another table suppose, now i am deleting primary key my query is not fetching the value because i am using join to retrieve the data what is solution for that because this primary id is missing in the reference table in php mysql.

**community table :**

```
 c.d_id    communityname
   1          BC
   2          SC
   3          ST

```

**student Table**

```
  ID           Community
   1             1
   2             3
   3             1

```

**SQL**

```
SELECT c.communityname FROM student  s left join community c on c.d_id=s.community WHERE s.stud_rollno = '".$rollno."' GROUP BY stud_rollno

```