Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+1 vote
23.1k views
in Information Technology by (71.3k points)

Consider the tables given below while attempting the following questions:

Train

Reservation

With reference to the above given tables, write commands in SQL for (i) and (ii) and output for (iii) below:

(i) To display the Train name along with its passenger name. 

(ii) To display Train detail which has no reservation yet. 

(iii) SELECT T.* from Train T, Reservation R where T.TrainId=R.TrainId AND Source LIKE “%Delhi” OR Destination LIKE “%Delhi”;

1 Answer

+1 vote
by (76.5k points)
selected by
 
Best answer

(i) select TName, Passenger from Train T, Reservation R where T.TrainId=R.TrainId;

(ii) select T.* from Train T, Reservation R where T.TrainId!=R.TrainId;

(iii)

TrainId TName Source Destination
3424 Lucknow Mail Lucknow New Delhi
5400 Century Express New Delhi Kanpur

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

...