question

UNKNOWN avatar image
UNKNOWN asked

sql: Find all pilots whose total flight hours (total_hours) is greater than the average.

insert into PILOT values ('0001', 'Whiteknuckles, Harry', '9 Muddy Lane',

'Swift Current', '306.911.1234', 0);


insert into PILOT

values ('0002', 'Timson, Jean', '2302 - 67th St NE',

'Calgary', '403.288.1492',0);


insert into PILOT

values ('0003', 'Lee, Wong', '17 Chester Place',

'Calgary', '403.247.6543',0);


insert into PILOT

values ('0004', 'Bedard, George', '7902 - 69 Ave',

'Saskatoon', '306.444.5555',0);


insert into PILOT

values ('0005', 'Trachuk, Tony', '123 - 3rd St',

'Saskatoon', '306.354.1234',0);


insert into PILOT

values (

'0006', 'Paulson, Penny', '49 Gaetz Ave',

'Red Deer', '403.356.4321',0);

commit;

-------------------------------------------------------------------------------------------------------------------


Calgary to Edmonton Flights G10X codes

rem two flights a day


insert into FLIGHT values (

'G101', 'YYC', 'YXD', 7, 1.0);


insert into FLIGHT values (

'G102', 'YXD', 'YYC', 17.00, 1.00);

--------------------------------------------------------------------

rem Saskatoon to Edmonton G21X codes

rem one flight, twice a week, M, W, F


insert into FLIGHT values (

'G210', 'YXD', 'YXE', 6.00, 2.0);


insert into FLIGHT values (

'G211', 'YXE', 'YXD', 16, 2.25);

------------------------------------------------------------------

rem Saskatoon - Calgary routes G22X codes

rem once a week on M, W


insert into FLIGHT values (

'G221', 'YXE', 'YYC', 6.5, 2.5);


insert into FLIGHT values (

'G222', 'YYC', 'YQF', 17.00, 2.75);


pastedimage-br7f5v1c6xwfybkm0yyq3ns03wufdh2o002.png

sqlserversqlcmd#sqljob
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.