Thursday, June 10, 2021
Views are virtual tables that you can create that others can use without knowing the complexity of the query, but can be used like a table. Also they can provided an added security by giving developers access to a view instead of the underlying table. Views does not contain data in itself the data stays at the tables that the views are created from. Complex views can degrade performance since they contain no data the query must be processed every time.
Let's say a junior developer just came on board and he doesn't really know SQL that well. You can create a view of the more complex views to work with until he gets better with his SQL.
The view above queries the employees territories using joins, by creating a view the person using the view does not have to know the underlying table structures that is in the database they can just use the view.
If you check in SQL Server you will see that a new view call EmployeeTerritoriesDescriptions has been created

To select a view you just select it like any other table, by using the SELECT statement. Here is an example of how you would select the EmployeeTerritoriesDescriptions view after it has been created.
Here are the results:

As you can see a view is a great way to hide the complexity of a query. All you need to do is query the columns in the view and don't have to worry about the complex query any longer.
CREATE VIEW EmployeeTerritoriesDescriptions AS SELECT e.FirstName + ' ' + e.LastName AS Name, t.TerritoryDescription,t.TerritoryID FROM Employees e INNER JOIN EmployeeTerritories et ON et.EmployeeID = e.EmployeeID INNER JOIN Territories t ON t.TerritoryID = et.TerritoryID
The view above queries the employees territories using joins, by creating a view the person using the view does not have to know the underlying table structures that is in the database they can just use the view.
If you check in SQL Server you will see that a new view call EmployeeTerritoriesDescriptions has been created

To select a view you just select it like any other table, by using the SELECT statement. Here is an example of how you would select the EmployeeTerritoriesDescriptions view after it has been created.
SELECT Name,TerritoryDescription,TerritoryID FROM EmployeeTerritoriesDescriptions
Here are the results:

As you can see a view is a great way to hide the complexity of a query. All you need to do is query the columns in the view and don't have to worry about the complex query any longer.
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
you can download from here download notepad++
ReplyDeleteThanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts.
ReplyDeleteBusiness Submission & Search:
https://www.luxuryhotelholidays.com/blog/item/2015-greece-and-the-%E2%82%ACuro-grexit#comment1464045
ReplyDeleteNice blogs. thanks for sharing these information with all of us. Kinemaster Lite
ReplyDeletePredicting such kind of material in the years to come as it is absolutely helpful and educational.
ReplyDeleteurl opener
online filmek
uwatchfree
E9F9ED2335
ReplyDeleteGörüntülü Seks
Sanal Sex
Skype Show
Really insightful post! Thanks for sharing such valuable information. For students struggling with legal coursework, resources like Business Law Assignment Help can also make a big difference in understanding these concepts better. Looking forward to more posts like this!
ReplyDeleteGreat insights! This was an informative and well-written post that explains the topic in a simple and engaging way. Thanks for sharing such valuable information. Students looking for university assignment help can definitely benefit from resources and discussions like this.
ReplyDeletehi OET is widely acknowledged as a reliable English language competency test for professionals looking to work or study in English-speaking nations in the healthcare, nursing, and medical fields. In addition to fulfilling licensure and registration requirements, it assists physicians, nurses, pharmacists, dentists, and other healthcare professionals in developing the communication skills necessary for worldwide job prospects. At FITA Academy OET Coaching Center in Chennai offers industry-focused training with knowledgeable instructors, engaging lessons, extensive study materials, frequent practice exams, and individualized coaching. In order to attain excellent OET scores and pursue prosperous healthcare employment overseas, the course gives students and healthcare professionals good listening, reading, writing, and speaking skills.
ReplyDeletehttps://www.fita.in/oet-coaching-centre-in-chennai/
For healthcare professionals who intend to work, register, or pursue higher education in English-speaking nations, the Occupational English Test (OET) is a specific English language test. The FITA Academy provides thorough, career-focused OET Coaching Center in Chennai using knowledgeable instructors, organized lesson plans, engaging classroom activities, and a lot of practice for mock exams. With an emphasis on communication skills, exam strategies, and individualized performance evaluation, the course covers Listening, Reading, Writing, and Speaking with a healthcare-specific approach. Learners acquire the competence and self-assurance required to succeed on the OET exam through regular practice and one-on-one mentorship.
ReplyDelete