Skip to content
Advertisement

SQL subtracting columns

I have two tables :

flight:

Flightbooking:

I want to subtract booked seats from max capacity to give the number of available seats for each flight .

Expected results:

I am new to SQL so any help would be appreciated – thanks in advance.

Advertisement

Answer

Use aggregation and join:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement