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

  • SEARCH
  • Home
  • 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 6567971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:23:59+00:00 2026-05-25T14:23:59+00:00

Possible Duplicate: Use SQL View or SQL Query? What is the reason writting a

  • 0

Possible Duplicate:
Use SQL View or SQL Query?

What is the reason writting a views instead of writting a sql statement?

  • 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-25T14:24:00+00:00Added an answer on May 25, 2026 at 2:24 pm

    Yes, there are lots of reasons.

    1. Security: when you want to limit what certain user can see from a table you can just grant access to the view instead of the underlying table.
    2. Simplicity: when you need to use the query/view on a subquery. Or just when you don’t want to type several times the same complex query over and over again.
    3. Materialized Views (if your RDBMS supports it): can increase performance on some analytical queries (Data-warehousing).
    4. Partitioning: if you want a relation (view) representing just a subset of other relation (table). I.E. you can create invoices_2011 view with just invoices made in 2011 from the table invoices.

    Update:

    On the example asked:

    Let’s say you have this table:

    create table customers (
       customer_id integer primary key,
       name varchar(200) not null,
       dob date
    );
    

    And you want user bart to see only name and dob of customers born before 1980. You can’t grant access to customers table to bart because he could see anything stored on it.

    You instead create a view:

    create view customers_1980 as 
    select name, dob from customers
     where dob < '1980-01-01';
    

    And then grant bart access to that view:

    grant select on customers_1980 to bart;
    

    This way, bart will only have access to the restricted view subset of customers table.

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

Sidebar

Related Questions

Possible Duplicate: Is there a good reason to use upper case for T-SQL keywords?
Possible Duplicate: Internationalization in SSRS We use SQL Server Reporting Services for our web
Possible Duplicate: Parameterizing a SQL IN clause? Hi, I have a query looks like
Possible Duplicate: Why use TryCast instead of DirectCast? I want to know about TryCast
Possible Duplicate: Can I use pure SQL in ASP.net MVC? i asked a similar
Possible Duplicate: When should I use semicolons in SQL Server? When we are writing
Possible Duplicate: Using an ORM or plain SQL? Would you elect to use an
Possible Duplicate: Why would someone use WHERE 1=1 AND <conditions> in a SQL clause?
Possible Duplicate: SQL query multiple tables I have these 2 tables: ASSOCIATION_TABLE: [id, key,
Possible Duplicate: What does a caret (^) do in a SQL query? Why does

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.