From the course: Learning phpMyAdmin

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating a view

Creating a view

From the course: Learning phpMyAdmin

Start my 1-month free trial

Creating a view

- Views are particularly useful for hiding the complexity of queries that involve calculations, such as working out minimum and maximum values and averages. You define the complex query once as a view and then run the view to get the information you want. The best way to create a view in phpMyAdmin is to run the complex query first. Make sure it produces the desired results and then convert it into a view. We're working with the up_and_running database so we need to select that in the panel on the left and then select the Import tab. In the exercise files for this video is a file called car_stats.sql. Before we import it, let's take a look at it in a text editor. It's a select query that selects the make then MIN(price) as minimum, the MAX(price) as the maximum the price range, the average and then the count. And we're grouping everything by make. So this is the query that we're going to use for a view. So let's go back to phpMyAdmin and then under File to Import, choose File. Then…

Contents