LIVE Course for free

Rated by 1 million+ students
Get app now
+1 vote
55.7k views
in Computer by (78.0k points)

Consider the table FLIGHT given below Write commands in SQL for (i) to (iv) and output for (v) to (vii).

                              TABLE: FLIGHT

FLCODE START DESTINATION NO_ STOPS NO_FLIGHTS
IC101 Delhi Agartala 1 5
IC102 Mumbai Sikkim 1 3
IC103 Delhi Jaipur 0 7
IC105 Kanpur Chennai 2 2
IC107 Mumbai Kanpur 0 4
IC431 Indore Chennai 3 2
IC721 Delhi Ahmedabad 2 6

(i) Display details of all flights starting from Delhi.

(ii) Display details of flights that have more than 4 number of flights operating.

(iii) Display flight codes, starting place, destination, number of flights in descending order of number of flights.

(iv) Display destinations along with flight codes of all the destinations starting with 'A'.

(v) SELECT MAX(NO_FLIGHTS) FROM FLIGHT

(vi) SELECT DISTINCT(NO_STOPS) FROM FLIGHT

(vii) SELECT START COUNT(.) FROM FLIGHT GROUP BY Start;

1 Answer

+2 votes
by (76.1k points)
selected by
 
Best answer

(i) SELECT * FROM FLIGHT WHERE START = 'Delhi'

(ii) SELECT * FROM FLIGHT WHERE NO _FLIGHTS > 4

(iii) SELECT FLCODE, START, DESTINATION, NO-FLIGHTS FROM FLIGHT ORDER BY NO-FLIGHTS DESC

(iv) SELECT DESTINATION, FLCODE FROM FLIGHT WHERE DESTINATION LIKE "A%";

(v) MAX(No_FLIGHTS)

7

(vi) DISTINCT(NO_STOPS)

0

1

2

3

(vii) DELHI 3 MUMBAI 2 KANPUR 1 INDORE 1

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...