Answers for "how to create a view"

SQL
1

Create View

CREATE VIEW vw_Names  
   AS  
   SELECT ProductName, Price FROM Products;  
GO
Posted by: Guest on June-15-2021
0

create view

CREATE VIEW sales.daily_sales
AS
SELECT
    year(order_date) AS y,
    month(order_date) AS m,
    day(order_date) AS d,
    p.product_id,
    product_name,
    quantity * i.list_price AS sales
FROM
    sales.orders AS o
INNER JOIN sales.order_items AS i
    ON o.order_id = i.order_id
INNER JOIN production.products AS p
    ON p.product_id = i.product_id;
Code language: SQL (Structured Query Language) (sql)
Posted by: Guest on September-17-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language