Skip to content
Advertisement

Missing keyword from CREATE VIEW

The question for the section is: Create a view called TITLE_UNAVAIL to show the movie titles and media_id of the media not returned yet. The view should not allow any DML operations.

This is for Oracle SQL. The columns are in 2 separate tables which is why I used a JOIN but every time I run the code, I keep receiving an ORA-00905:missing keyword error

CREATE OR REPLACE VIEW view_title_unavail
  ("Title", "ID")
AS SELECT m.title, h.media_id
  FROM m_movies m JOIN m_rental_history h
  WHERE m.title IS NULL
WITH READ ONLY;

Advertisement

Answer

When you use the JOIN keyword, then you need to specify the join condition via the ON keyword. You will need an on condition, or, if you want a Descartes multiplication, then just put the tables into the from clause with comma between them.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement