The following walkthrough describes how to create a view. Tables created in the previous parts of walkthrough will be used there.
In order to complete this walkthrough, you will need access to MySQL server 5.0 or higher.
You also should have the following privileges:
dbForge Studio for MySQL supports views on MySQL 5.0 and higher.
View is a logical table based on one or more tables or views. A view contains no data itself, but retrieves it from underlying tables and views when requested. Let’s create a view that takes data from two tables (Dept and Emp), joins them and shows the result set.
In the template that appears paste the following text:
SELECT demobase.emp.ename AS name, demobase.emp.job, demobase.emp.sal AS salary, demobase.dept.dname AS department FROM demobase.emp, demobase.dept WHERE demobase.emp.deptno = demobase.dept.deptno
It says, take employee name, job and salary from the table Emp, and determine from which department the employee is. Show this data for every employee.