Answer:
CREATE VIEW [MAINE_TRIPS] AS
SELECT trips_id, trip_name, start_location, distance, maximum_group_size , type, season
FROM trip
WHERE STATE = 'ME';
- To update a view, use the CREATE OR REPLACE VIEW clause. This would update the view with no errors.
Explanation:
The SQL statement above creates a view called MAINE_TRIPS from the trip table. A view is a virtual table that hold the result of query from an actual table.
It accepts all clauses like a normal table. For example, to get the trip id, name and distance column and the rows with the trip type biking;
SELECT trip_id, trip_name, distance FROM [MAINE_TRIPS]
WHERE type = 'biking'