title: I have 3 tables Flight_schedule, Flights and third is Route I need a stored procedure in SQL which give the cheapest flight on a given date
body: <p>I have 3 tables Flight_schedule, Flights and third is Route I need a stored procedure in SQL which give the cheapest flight on a given date.</p>
  <p>When the parameter date is passed to procedure suppose 2 February so the result would be the lowest fare flight on the 2 Feb.</p>
  <p>Here is the code where I have joined the tables and passed the parameter to stored procedure but when I am confused in the condition part.</p>
  <pre><code>Create proc spCheapestFlight 
  @FLIGHT_DATE DATE 
  AS  
  BEGIN  
  SELECT Flight_schedule.FlightDate,Flight_schedule.Departure,route.source, route.destination, 
      Flight_schedule.Arrival 
      ,Flight_schedule.Fare,Flights.Flight_name 
      FROM Flight_schedule 
      inner join route ON Flight_schedule.Route_id=route.Route_id inner join  
  Flights on Flights.Flight_id=Flight_schedule.Flight_id 
  where Flight_schedule.FlightDate = @FLIGHT_DATE   
  END 
  </code></pre>