-2
創建一個名爲VDept_Headcount的視圖,該視圖報告每個部門的人員總數。該報告包括3列如下:Dept_Name,Dept_Number,No_Emp。包括所有部門。顯示視圖,通過SQL的內容(從VDept_Headcount選擇*;)更改我的代碼中的視圖,不能在時間添加行乘數
USE COMPANY
GO
--1-1) Create a view named VDept_Headcount that reports headcount for each department.
CREATE VIEW VDept_Headcount(Dept_Name, Dept_Number, No_Emp)
AS
SELECT d.DNAME, d.DNUMBER, COUNT(e.DNO)
FROM DEPARTMENT d LEFT OUTER JOIN EMPLOYEE e ON e.DNO = d.DNUMBER
GROUP BY d.DNAME, d.DNUMBER;
GO
SELECT *
FROM VDept_Headcount;
USE COMPANY
GO
--Add yourself into Employee
INSERT INTO EMPLOYEE
VALUES('Dan', NULL, 'Chan', '122345687', '13-Nov-1948', '323 Williams Ct, Columbus, OH', 'M', 55000, '987654321', 5);
SELECT *
FROM VDept_Headcount;
基本上我想知道有沒有辦法來添加行不使用Groupon的?