C#
JavaScript
Java
SQL
-- Salesperson
CREATE TABLE dbo.Salesperson
(
ID int IDENTITY(1,1) NOT NULL,
Name nchar(10) NOT NULL,
Age tinyint NOT NULL,
Salary int NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.Salesperson ADD CONSTRAINT
PK_Salesperson PRIMARY KEY CLUSTERED
(
ID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE dbo.Salesperson SET (LOCK_ESCALATION = TABLE)
GO
---------------------------
-- Customer
CREATE TABLE dbo.Customer
(
ID int IDENTITY(1,1) NOT NULL,
Name nchar(10) NOT NULL,
City nchar(10) NOT NULL,
IndustryType char(1) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.Customer ADD CONSTRAINT
PK_Customer PRIMARY KEY CLUSTERED
(
ID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE dbo.Customer SET (LOCK_ESCALATION = TABLE)
GO
---------------------------
-- Orders
CREATE TABLE dbo.Orders
(
OrderNumber int IDENTITY(1,1) NOT NULL,
OrderDate date NOT NULL,
CustId int NOT NULL,
SalespersonId int NOT NULL,
Amount int NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.Orders ADD CONSTRAINT
PK_Orders PRIMARY KEY CLUSTERED
(
OrderNumber
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE dbo.Orders SET (LOCK_ESCALATION = TABLE)
GO
---------------------------
-- data
INSERT INTO [dbo].[Salesperson]
([ID],[Name],[Age],[Salary])
VALUES
(1,'Abe',61,140000),
(2,'Bob',34,44000),
(5,'Chris',34,40000),
(7,'Dan',41,52000),
(8,'Ken',57,115000),
(11,'Joe',38,38000)
GO
INSERT INTO [dbo].[Customer]
([ID],[Name],[City],[IndustryType])
VALUES
(4,'Samsonic','pleasant','J'),
(6,'Panasung','oaktown','J'),
(7,'Samony','jackson','B'),
(9,'Orange','Jackson','B')
GO
INSERT INTO [dbo].[Orders]
([OrderNumber],[OrderDate],[CustId],[SalespersonId],[Amount])
VALUES
(10,'8/2/96',4,2, 540),
(20,'1/30/99',4,8, 1800),
(30,'7/14/95',9,1, 460),
(40,'1/29/98',7,2, 2400),
(50,'2/3/98',6,7, 600),
(60,'3/2/98',6,7, 720),
(70,'5/6/98',9,7, 150)
GO
Regular Expression
RegEx101(support PHP, JavaScript and Python)
Online IDE
Drawing Tools