- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are the prerequisites before starting writing and using MySQL views?
MySQL Version
As we know that MySQL 5 introduced views, hence, first of all, we need to check for the version of MySQL before starting writing and using stored procedures. It can be done with the following query −
mysql> Select VERSION(); +-----------+ | VERSION() | +-----------+ | 5.7.20 | +-----------+ 1 row in set (0.10 sec)
Privileges for current user
Actually CREATE VIEW statement requires the CREATE VIEW privilege. Privileges for the current user can be checked with the following query −
mysql> SHOW PRIVILEGES
Selecting a database
Before creating a view we must have to select a database from the available databases. It can be done with the help of the following query −
mysql> USE query; Database changed
From the above query, it is clear that we are using a database named ‘query’.
Advertisements