MySQL Inner Join

INNER JOIN is used to combine rows from two or more tables based on a related column between them. It returns only those records that have matching values in both tables.

Syntax:

    SELECT table1.column_name, table2.column_name
    FROM table1
    INNER JOIN table2
    ON table1.common_column = table2.common_column;

Query

    SELECT 
    students.student_id, 
    students.student_name, 
    students.student_course,  
    fees.total_fees, 
    fees.paid_fees, 
    fees.pending_fees, 
    fees.status 
    FROM students 
    INNER JOIN fees 
    ON students.student_id = fees.student_id;

Out Put