Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4114340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:26:36+00:00 2026-05-20T22:26:36+00:00

I have read about the CREATE VIEW syntax of MySQL , but never used

  • 0

I have read about the CREATE VIEW syntax of MySQL, but never used it in practice.

Please show me some examples of its applications.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T22:26:37+00:00Added an answer on May 20, 2026 at 10:26 pm

    A non-materialized view is effectively a macro – referencing a view means the query it contains is used in the view references place. IE:

    CREATE VIEW your_vw AS
       SELECT *
         FROM EMPLOYEES
    

    This:

    SELECT * FROM your_vw
    

    …will return a resultset that matches what you’d get from using:

    SELECT x.*
      FROM (SELECT *
              FROM EMPLOYEES) x
    

    I mentioned non-materialized, but MySQL doesn’t support materialized views. Other databases (Oracle, SQL Server calls them “indexed views”, DB2) support materialized views, but that’s not the question. From now on, I’ll only talk about non-materialized views when I write about views.

    Views are used for encapsulation/abstraction – unless the user has access, they can’t see what the underlying query for a view is. This is good/bad depending on the situation – good if you’re worried about giving out data model information; bad in most other cases. Using an ORDER BY in a view is bad because it takes resources to apply the order, which because of encapsulation/abstraction someone else might apply an order by to — it’s a waste of resources. Layering views (views built on views) is also another bad practice – you won’t get an error until the view is run.

    Views used to provide access to data without needing to grant access to the table, but they’ve evolved to support updating the underlying table. I prefer to grant access to the table for such situations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to WPF, have read some books about it, but now I
I just got Delphi 2009 and have previously read some articles about modifications that
I just started to read about this new technology... Does someone have some knowledge
I have read many topics about UITableViews not refreshing on iPhone, but couldn't find
I have read about partial methods in the latest C# language specification , so
I am using VS2008 to develop a WinForms 2.0 application. I have read about
I have read this post about how to test private methods. I usually do
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I have read the post here about using setTimeout() during intensive DOM processing (using
I have read lots of information about page caching and partial page caching in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.