Please, DON'T SHOUT!
You need to generate rows from up to the maximum number of seats. If you cross join this with the relevant aircraft, you can use a case expression to determine which class each seat is in.
Here's something to get you started:
create table airplanes (
airplane_id integer,
start_a integer,
end_a integer,
start_b integer,
end_b integer,
start_c integer,
end_c integer
);
create table flight_seats (
flight_id integer,
dep_date date,
seat_no integer,
class varchar2(1)
);
insert into airplanes values (1, 1, 30, 31, 100, 101, 350);
insert into flight_seats
with seats as (
select rownum r
from dual
connect by level <= 350
)
select 1 flt_id,
date'2015-01-01' dep_date,
r seat,
case
when r between start_a and end_a then 'A'
when r between start_b and end_b then 'B'
when r between start_c and end_c then 'C'
end class
from seats, airplanes;
350 rows inserted.
select * from flight_seats
order by seat_no;
FLIGHT_ID DEP_DATE SEAT_NO C
---------- ----------- ---------- -
1 01 Jan 2015 1 A
1 01 Jan 2015 2 A
... <snip> ...
1 01 Jan 2015 30 A
1 01 Jan 2015 31 B
... <snip> ...
1 01 Jan 2015 100 B
1 01 Jan 2015 101 C
... <snip> ...
1 01 Jan 2015 350 C
350 rows selected
You'll need to update this to select the relevant aircraft type and limit the total rows appropriately.