Hi Ashu0007,
Welcome to our forum and thanks for contacting us with your question!
On this forum we provide support strictly related to Highcharts, so if you want to learn how to get data from your DB or how to create sql queries, you should head over to related sources of knowledge or Stack Overflow. To build a pie chart, you need to make sure that your data fits formats specified here:
https://api.highcharts.com/highcharts/series.pie.data
If the initial format of your data is differnt, you will most likely have to parse your data.
Let me know if you have any further questions.
Regards!