Question

What, if any, is the difference between MySQL views and the way that phpMyAdmin shows its tables? When I created a view on phpMyAdmin by clicking "Create view" under "Query results operations" under "Browse" in a table:

phpMyAdmin depiction of a table,

the created view looked exactly like the view shown in the "Browse" window for that table:

MySQL view created in phpMyAdmin

I am more talking about visual style here, I know that since I used the defaults the table includes the same columns/rows. Do all SQL views look the same, visually, as phpMyAdmin tables as shown in the GUI? Is that some sort of standard, or just the way phpMyAdmin does it, and others could be different?

Is it possible to create views in the browser, or are they just created on the server for the convenience of the developer? W3schools doesn't have a syntax-testing tool for views, which makes me wonder, as they have one for pretty much everything else.

I am using phpMyAdmin 4.1.5.

Was it helpful?

Solution

You are asking about visual style. Neither tables nor views have a particular style. The tool you use -- the command line, PHPMySQLAdmin, MySQL Workbench, or whatever -- can display them however the developer likes.

For convenience, views and tables will likely look very similar or the same in most tools, because they have similar structures (but not the same functions or purposes). But how they look is up to the developer of the tool.

OTHER TIPS

If you do not do anything else, a view of a table will be the same as the table itself. You might create a view of an employee table called phonebook that had only name, office number and phone extension. The employee table might only be readable by the HR director while the phonebook view would be accessible to the entire company. In this case the view has fewer columns than the underlying table.

Or you could join the employee record with the department record that he is assigned to and create a view with more columns than are in the underlying "employee" table. It sounds like you just took some default options and created a view that was just like the underlying table. It is ok for a start, but now drop the view that you made and recreate it with some purpose in mind and you will see the differences when you browse it in phpmyadmin.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top