Code to create table automatically in database when activating custom plugin.

I have a custom plugin and I want to know how to achieve this when I will activate a plugin it should create a table automatically in the database.

Any help would be great.

Thanks in advance.

I have a custom plugin and I want to know how to achieve this when I will activate a plugin it should create a table automatically in the database.
Any help would be great.
Thanks in advance.

Hi, did you then understand how to create tables from plugin entities?