Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FIGURA5.4
--Sql Server 2014 Express Edition --Batches are separated by 'go' select @@version as 'sql server version' CREATE TABLE [dbo].[PERSON]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [P_LNAME] [nvarchar](255) NULL, [P_FNAME] [nvarchar](255) NULL, [P_IS_EMP] [nvarchar](255) NULL, [P_IS_STU] [nvarchar](255) NULL ) GO CREATE TABLE [dbo].[EMPLOYEE]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [EMP_HERE_DATE][nvarchar](255) NULL, [EMP_IS_ADM][nvarchar](255) NULL, [EMP_IS_PROF][nvarchar](255) NULL ) GO CREATE TABLE [dbo].[STUDENT]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [STU_MAJOR][nvarchar](255) NULL, [STU_TYPE][nvarchar](255) NULL ) GO CREATE TABLE [dbo].[ADMINISTRATOR]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [ADM_TITLE][nvarchar](255) NULL ) GO CREATE TABLE [dbo].[PROFESSOR]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [PROF_RANK][nvarchar](255) NULL ) GO CREATE TABLE [dbo].[GRADUATE]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [GRAD_THESIS][nvarchar](255) NULL ) GO CREATE TABLE [dbo].[UNDERGRAND]( [P_ID] [nvarchar](255) Primary Key NOT NULL, [UND_HOURS][nvarchar](255) NULL ) GO INSERT INTO [dbo].[PERSON] VALUES ('4593', 'Luna', 'Carlos', ' ', ' '), ('5698', 'Vargas', 'Arturo', ' ', ' '), ('7893', 'León', 'Jorge', ' ', ' ') INSERT INTO [dbo].[EMPLOYEE] VALUES('4593','2020-04-21 13:05', ' ', ' '), ('5697','2020-07-07 16:02', ' ', ' '), ('7893','2020-08-01 17:55', ' ', ' ') INSERT INTO [dbo].[STUDENT] VALUES ('4593', ' ', ' '), ('5697', ' ', ' '), ('7893', ' ', ' ') INSERT INTO [dbo].[ADMINISTRATOR] VALUES('4593', ' '), ('5697', ' '), ('7893', ' ') INSERT INTO [dbo].[PROFESSOR] VALUES('4593', ' '), ('5697', ' '), ('7893', ' ') INSERT INTO [dbo].[GRADUATE] VALUES('4593', ' '), ('5697', ' '), ('7893', ' ') INSERT INTO [dbo].[UNDERGRAND] VALUES('4593', ' '), ('5697', ' '), ('7893', ' ') select * from PERSON select * from EMPLOYEE select * from STUDENT select * from ADMINISTRATOR select * from PROFESSOR select * from GRADUATE select * from UNDERGRAND
run
|
edit
|
history
|
help
0
sadasd
Cross Apply vs Inner Join
pivot example
Allocations Check
Output
function used in cte
store1
dk
Program 3 Lab Assignment
string conversion