Week5 - Views / Assess

The questions can come in any order, so make sure you are selecting right option for all questions.

1. Create a view named 'travel_payment_details' to display the details of the travel_payment whose amount is greater than 30.
create view travel_payment_details as
select * 
from travel_payment 
where amount>30
2. Create a view named 'train_details_with_deviation' to display the metro train id,position and updated time of all the trains having deviation.
create view train_details_with_deviation as
select id,position,updated_time 
from metro_train 
where id in (
  select metro_train_id 
  from train_arrival_time 
  where deviation !=0);

Post a Comment