๐ Creating and Using Views in Oracle SQL

As part of my continued hands-on learning with Oracle Autonomous Database, I explored how to create and use views in SQL. Views are virtual tables that help simplify complex queries and improve data management.
๐ฏ Objective
The goal of this activity was to:
Understand what a view is Learn how to create a view Use views to simplify data access
๐ป Step 1: Creating the Table
CREATE TABLE employees (
emp_id NUMBER,
emp_name VARCHAR2(50),
department VARCHAR2(50),
salary NUMBER );
๐งช Step 2: Inserting Data
INSERT INTO employees
VALUES (1, 'Ali', 'IT', 50000); INSERT INTO employees
VALUES (2, 'Ahmed', 'HR', 70000);
INSERT INTO employees VALUES (3, 'Sara', 'IT', 60000);
INSERT INTO employees VALUES (4, 'Zara', 'HR', 65000);
๐๏ธ Step 3: Creating a View
CREATE VIEW high_salary_employees
AS SELECT emp_name, salary FROM employees WHERE salary > 60000;
๐ Step 4: Using the View
SELECT * FROM high_salary_employees;
This query retrieves employees with high salaries using the created view.
๐ก What I Learned
What views are in Oracle SQL How to create and use views Simplifying queries using virtual tables
๐ Conclusion
This activity helped me understand how views can simplify data retrieval and improve query readability. Views are widely used in real-world database systems for better data abstraction.





