Amir Orfi

Generation

text to sql syntaxMon, 16 Jan 2023

Find patient with many diseases not paid

select p.name, count(d.id) as num_diseases, sum(b.paid) as total_paid, sum(b.amount) as total_amount from patients p, diseases d, bills b where p.id=d.patient_id and d.id=b.disease_id group by p.name having total_paid!=total_amount;

Questions about programming?Chat with your personal AI assistant