#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Step 12
4 min read

Modifying Views

Learn how to change or update existing Views.

How to Modify a View

To change a View, you can replace it.

Option 1: DROP and CREATE

DROP VIEW active_students; CREATE VIEW active_students AS SELECT student_id, name, grade, age FROM students WHERE is_active = TRUE;

Option 2: CREATE OR REPLACE

CREATE OR REPLACE VIEW active_students AS SELECT student_id, name, grade, age FROM students WHERE is_active = TRUE;

Easier! Replaces if exists, creates if not.

Summary

Modify View = Replace it Use CREATE OR REPLACE for easy updates

Finished this topic?

Mark it complete to track your progress and maintain your streak!