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

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.