How do you join two tables in mySQL? I need to do this: Write the SQL code that will list all of the drivers in the data
Posted: Sun May 15, 2022 8:40 am
How do you join two tables in mySQL? I need to do this:
Write the SQL code that will list all of the drivers in the
database that have been issued tickets, along with the total number
of tickets that they have been issued and the total amount of fines
that they have been charged.
So far I have: SELECT LICENSE_NUM, COUNT(*) AS TICKETS
FROM TICKET GROUP BY LICENSE_NUM
But this only shows the license number, and the count. I need it
to include the driver's name as well from a separate table. How
would I go about that? I just need a general statement to work
from, when I try to add a join in this statement it doesn't
work
Write the SQL code that will list all of the drivers in the
database that have been issued tickets, along with the total number
of tickets that they have been issued and the total amount of fines
that they have been charged.
So far I have: SELECT LICENSE_NUM, COUNT(*) AS TICKETS
FROM TICKET GROUP BY LICENSE_NUM
But this only shows the license number, and the count. I need it
to include the driver's name as well from a separate table. How
would I go about that? I just need a general statement to work
from, when I try to add a join in this statement it doesn't
work