Skip to toolbar

Forum

Create View Mysql: ...
 
Notifications
Clear all

Create View Mysql: Can you help me to create these views using employee table as reference?  


Saba Ot
Posts: 42
 Saba Ot
Guest
(@Saba Ot)
Joined: 4 months ago

Create View Mysql: Query examples are given below. 

Query1:

Create a view call employee_ve based on the employee number, employee names, and department numbers from the emp table. Change the heading for the emp name to EMPLOYEE.

Query2
Display the contents of the employee_ve view

Query3
Create a view called SALARY_VE based on the employee names, salaries, and salary grades for all employees. Use the EMP and salary grade respectively

Query4
Create a view named DEPT115 that contains the emp numbers, emp names, and department numbers for all employees in department 115. Do not allow an employee to be reassigned to another department through the view.

Query5
Create an index on the department number of the Emp table. Drop the newly created index.

Topic Tags
2 Replies
Vikky
Posts: 13
 Vikky
Guest
(@Vikky)
Joined: 4 months ago

Query2

 

First choose the view which you want to see the content or a script.

Just right click on the view area choose "script view as"  and then choose sub option called "create to" and then click on "New Query Window". 

Hope this is what you expected for this query.  

Right-click on the selected views and choose "Script View As" =>Create To => New Query Window.

Reply
Vikky
Posts: 13
 Vikky
Guest
(@Vikky)
Joined: 4 months ago

Query5

You can create different types of indexes based on your requirement.

Here is one simple example how you can create a index in SQL server.

Create or Replace INDEX emp_dept_index ON employee(department_number)

Thats it. Create index is very simple. 

 

Reply

Leave a reply

Author Name

Author Email

Title *

Maximum allowed file size is 10MB

 
Preview 0 Revisions Saved
Share: