{"id":762,"date":"2018-09-29T16:28:31","date_gmt":"2018-09-29T09:28:31","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=762"},"modified":"2020-04-11T20:13:17","modified_gmt":"2020-04-11T13:13:17","slug":"sql-server-create-view","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/","title":{"rendered":"SQL Server CREATE VIEW"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the SQL Server <code>CREATE VIEW<\/code> statement to create new views.<\/p>\n\n\n\n<p>To create a new <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/\">view<\/a> in SQL Server, you use the <code>CREATE VIEW<\/code> statement as shown below:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">VIEW<\/span> &#91;<span class=\"hljs-keyword\">OR<\/span> <span class=\"hljs-keyword\">ALTER<\/span>] schema_name.view_name &#91;(column_list)]\n<span class=\"hljs-keyword\">AS<\/span>\n    select_statement;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, specify the name of the view after the <code>CREATE VIEW<\/code> keywords. The <code>schema_name<\/code> is the name of the schema to which the view belongs.<\/li><li>Second, specify a <code>SELECT<\/code> statement (<code>select_statement<\/code>) that defines the view after the <code>AS<\/code> keyword. The <code><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select\/\">SELECT<\/a><\/code> statement can refer to one or more tables.<\/li><\/ul>\n\n\n\n<p>If you don&#8217;t explicitly specify a list of columns for the view, SQL Server will use the column list derived from the <code>SELECT<\/code> statement.<\/p>\n\n\n\n<p>In case you want to redefine the view e.g., adding more columns to it or removing some columns from it, you can use the <code>OR ALTER<\/code> keywords after the <code>CREATE VIEW<\/code> keywords.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-create-view-examples'>SQL Server CREATE VIEW examples <a href=\"#sql-server-create-view-examples\" class=\"anchor\" id=\"sql-server-create-view-examples\" title=\"Anchor for SQL Server CREATE VIEW examples\">#<\/a><\/h2>\n\n\n\n<p>We will use the <code>orders<\/code>, <code>order_items<\/code>, and <code>products<\/code> tables from the <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-sample-database\/\">sample database<\/a> for the demonstration.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"219\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png\" alt=\"SQL Server CREATE VIEW sample tables\" class=\"wp-image-162\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png 718w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products-300x92.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='creating-a-simple-view-example'>Creating a simple view example <a href=\"#creating-a-simple-view-example\" class=\"anchor\" id=\"creating-a-simple-view-example\" title=\"Anchor for Creating a simple view example\">#<\/a><\/h3>\n\n\n\n<p>The following statement creates a view named <code>daily_sales<\/code> based on the <code>orders<\/code>, <code>order_items<\/code>, and <code>products<\/code> tables:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">VIEW<\/span> sales.daily_sales\n<span class=\"hljs-keyword\">AS<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span>\n    <span class=\"hljs-keyword\">year<\/span>(order_date) <span class=\"hljs-keyword\">AS<\/span> y,\n    <span class=\"hljs-keyword\">month<\/span>(order_date) <span class=\"hljs-keyword\">AS<\/span> m,\n    <span class=\"hljs-keyword\">day<\/span>(order_date) <span class=\"hljs-keyword\">AS<\/span> d,\n    p.product_id,\n    product_name,\n    quantity * i.list_price <span class=\"hljs-keyword\">AS<\/span> sales\n<span class=\"hljs-keyword\">FROM<\/span>\n    sales.orders <span class=\"hljs-keyword\">AS<\/span> o\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.order_items <span class=\"hljs-keyword\">AS<\/span> i\n    <span class=\"hljs-keyword\">ON<\/span> o.order_id = i.order_id\n<span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> production.products <span class=\"hljs-keyword\">AS<\/span> p\n    <span class=\"hljs-keyword\">ON<\/span> p.product_id = i.product_id;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Once the <code>daily_sales<\/code> view is created, you can query data against the underlying tables using a simple <code>SELECT<\/code> statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    * \n<span class=\"hljs-keyword\">FROM<\/span> \n    sales.daily_sales\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    y, m, d, product_name;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following shows the output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"462\" height=\"245\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-View-example.png\" alt=\"SQL Server Create View example\" class=\"wp-image-764\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-View-example.png 462w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-View-example-300x159.png 300w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='redefining-the-view-example'>Redefining the view example <a href=\"#redefining-the-view-example\" class=\"anchor\" id=\"redefining-the-view-example\" title=\"Anchor for Redefining the view example\">#<\/a><\/h3>\n\n\n\n<p>To add the customer name column to the <code>sales.daily_sales<\/code> view, you use the <code>CREATE VIEW OR ALTER<\/code> as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">OR<\/span> <span class=\"hljs-keyword\">ALTER<\/span> sales.daily_sales (\n    <span class=\"hljs-keyword\">year<\/span>,\n    <span class=\"hljs-keyword\">month<\/span>,\n    <span class=\"hljs-keyword\">day<\/span>,\n    customer_name,\n    product_id,\n    product_name\n    sales\n)\n<span class=\"hljs-keyword\">AS<\/span>\n<span class=\"hljs-keyword\">SELECT<\/span>\n    <span class=\"hljs-keyword\">year<\/span>(order_date),\n    <span class=\"hljs-keyword\">month<\/span>(order_date),\n    <span class=\"hljs-keyword\">day<\/span>(order_date),\n    <span class=\"hljs-keyword\">concat<\/span>(\n        first_name,\n        <span class=\"hljs-string\">' '<\/span>,\n        last_name\n    ),\n    p.product_id,\n    product_name,\n    quantity * i.list_price\n<span class=\"hljs-keyword\">FROM<\/span>\n    sales.orders <span class=\"hljs-keyword\">AS<\/span> o\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span>\n        sales.order_items <span class=\"hljs-keyword\">AS<\/span> i\n    <span class=\"hljs-keyword\">ON<\/span> o.order_id = i.order_id\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span>\n        production.products <span class=\"hljs-keyword\">AS<\/span> p\n    <span class=\"hljs-keyword\">ON<\/span> p.product_id = i.product_id\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.customers <span class=\"hljs-keyword\">AS<\/span> c\n    <span class=\"hljs-keyword\">ON<\/span> c.customer_id = o.customer_id;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, we specified the column list for the view explicitly.<\/p>\n\n\n\n<p>The following statement queries data against the <code>sales.daily_sales<\/code> view:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    * \n<span class=\"hljs-keyword\">FROM<\/span> \n    sales.daily_sales\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n    y, \n    m, \n    d, \n    customer_name;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here is the output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"568\" height=\"283\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-or-Alter-view-example.png\" alt=\"SQL Server Create or Alter view example\" class=\"wp-image-765\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-or-Alter-view-example.png 568w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-or-Alter-view-example-300x149.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='creating-a-view-using-aggregate-functions-example'>Creating a view using aggregate functions example <a href=\"#creating-a-view-using-aggregate-functions-example\" class=\"anchor\" id=\"creating-a-view-using-aggregate-functions-example\" title=\"Anchor for Creating a view using aggregate functions example\">#<\/a><\/h3>\n\n\n\n<p>The following statement creates a view named <code>staff_sales<\/code>those summaries the sales by staffs and years using the <code>SUM()<\/code> aggregate function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">VIEW<\/span> sales.staff_sales (\n        first_name, \n        last_name,\n        <span class=\"hljs-keyword\">year<\/span>, \n        amount\n)\n<span class=\"hljs-keyword\">AS<\/span> \n    <span class=\"hljs-keyword\">SELECT<\/span> \n        first_name,\n        last_name,\n        <span class=\"hljs-keyword\">YEAR<\/span>(order_date),\n        <span class=\"hljs-keyword\">SUM<\/span>(list_price * quantity) amount\n    <span class=\"hljs-keyword\">FROM<\/span>\n        sales.order_items i\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.orders o\n        <span class=\"hljs-keyword\">ON<\/span> i.order_id = o.order_id\n    <span class=\"hljs-keyword\">INNER<\/span> <span class=\"hljs-keyword\">JOIN<\/span> sales.staffs s\n        <span class=\"hljs-keyword\">ON<\/span> s.staff_id = o.staff_id\n    <span class=\"hljs-keyword\">GROUP<\/span> <span class=\"hljs-keyword\">BY<\/span> \n        first_name, \n        last_name, \n        <span class=\"hljs-keyword\">YEAR<\/span>(order_date);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The following statement returns the contents of the view:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>  \n    * \n<span class=\"hljs-keyword\">FROM<\/span> \n    sales.staff_sales\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n\tfirst_name,\n\tlast_name,\n\t<span class=\"hljs-keyword\">year<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The output is:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"196\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Create-View-with-aggregate-function.png\" alt=\"SQL Server Create View with aggregate function\" class=\"wp-image-767\"\/><\/figure>\n\n\n\n<p>In this tutorial, you have learned how to create a new view by using the SQL Server <code>CREATE VIEW<\/code> statement.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"762\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/\"\n\t\t\t\tdata-post-title=\"SQL Server CREATE VIEW\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"762\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/\"\n\t\t\t\tdata-post-title=\"SQL Server CREATE VIEW\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":759,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-762","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server CREATE VIEW - Creating New Views in SQL Server<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server CREATE VIEW - Creating New Views in SQL Server\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-11T13:13:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/\",\"name\":\"SQL Server CREATE VIEW - Creating New Views in SQL Server\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/orders-order_items-products.png\",\"datePublished\":\"2018-09-29T09:28:31+00:00\",\"dateModified\":\"2020-04-11T13:13:17+00:00\",\"description\":\"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/orders-order_items-products.png\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/orders-order_items-products.png\",\"width\":718,\"height\":219},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/sql-server-create-view\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Views\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-views\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server CREATE VIEW\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server CREATE VIEW - Creating New Views in SQL Server","description":"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server CREATE VIEW - Creating New Views in SQL Server","og_description":"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2020-04-11T13:13:17+00:00","og_image":[{"url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/","name":"SQL Server CREATE VIEW - Creating New Views in SQL Server","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png","datePublished":"2018-09-29T09:28:31+00:00","dateModified":"2020-04-11T13:13:17+00:00","description":"This tutorial shows you how to use the SQL Server CREATE VIEW statement to create a new view in the database.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/orders-order_items-products.png","width":718,"height":219},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/sql-server-create-view\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Views","item":"https:\/\/www.sqlservertutorial.net\/sql-server-views\/"},{"@type":"ListItem","position":3,"name":"SQL Server CREATE VIEW"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=762"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/762\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/759"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}