
CREATE TABLE [dbo].[Orders](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CustomerName] [varchar](255) NULL,
	[ProductName] [varchar](50) NULL,
	[OrderDate] [date] NULL,
	[Quantity] [decimal](10, 2) NULL,
 CONSTRAINT [PK__Orders__3214EC07C0A3AC52] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

INSERT INTO Orders (CustomerName, ProductName, OrderDate, Quantity)
VALUES
('John Doe',  'ACEM', '2023-02-20', 150.00),
('Jane Smith',  'ACERO KOM', '2023-02-22', 75.50),
('Alice Johnson',  'ACERO RY', '2023-02-21', 200.00),
('Michael Brown',  'ADA 20', '2023-02-23', 120.25),
('Emily Wilson',  'ADA 21', '2023-02-24', 80.00),
('David Taylor',  'ADA 22', '2023-02-25', 100.75),
('Sarah Martinez',  'AGATA 09', '2023-02-26', 300.50),
('James Anderson',  'AGATA 10', '2023-02-27', 50.25),
('Jennifer Thomas',  'AGATA 10BK', '2023-02-28', 150.00),
('Daniel White',  'AGATA 11', '2023-02-28', 200.00),
('Jessica Lee', 'ARMA 01', '2023-03-01', 75.50),
('Matthew Harris', 'ARMA 01-1', '2023-03-02', 125.25),
('Olivia Clark', 'ARMA 02', '2023-03-03', 90.00),
('Andrew King', 'ARMA 03', '2023-03-04', 180.75),
('Sophia Wright', 'CROWN 07', '2023-03-05', 220.50),
('Ethan Hill', 'CROWN 08', '2023-03-06', 150.25),
('Isabella Green', 'CROWN 09', '2024-03-07', 100.00),
('William Baker', 'COT 02', '2021-03-08', 75.50),
('Ava Adams', 'COT 03', '2021-03-09', 200.75),
('Alexander Allen', 'COT 04', '2021-03-10', 90.50),
('Mia Parker', 'EL.TORONTO', '2021-03-11', 180.25),
('Michael Scott', 'EL.TORONTO PSKZ', '2021-03-12', 300.00),
('Abigail Evans', 'EL.TOSCANA', '2021-03-13', 50.75),
('Jayden Murphy', 'ELA 23', '2021-03-14', 75.50),
('Grace Turner', 'ELA 24', '2021-03-15', 150.25),
('Logan Hall', 'ELA 25', '2021-03-16', 180.50),
('Chloe Young', 'LESTO KOM', '2021-03-17', 220.75),
('Christopher Wright', 'LETO 01', '2022-03-18', 90.00),
('Natalie Rodriguez', 'LETO 01RA', '2022-03-19', 100.75),
('Aiden Martinez', 'LEOPAR 05BK', '2022-03-20', 125.50),
('Zoe Martinez', 'LEOPAR 06', '2022-03-21', 75.25),
('Madison Rivera', 'LEONAR 89', '2022-03-22', 90.00),
('Benjamin Reed', 'LEONAR 90', '2022-03-23', 150.75),
('Avery Mitchell', 'METROPOL 03', '2022-03-24', 200.50),
('Elijah Perez', 'METROPOL 03 EKRU', '2022-03-25', 80.25),
('Liam Campbell', 'MEVA', '2024-03-26', 150.00),
('Charlotte Flores', 'MEVSIM', '2024-03-27', 100.75),
('Scarlett Collins', 'MIA 06P', '2024-03-28', 180.50),
('Mason Washington', 'MIA 07', '2024-03-29', 220.25),
('Lucas Parker', 'POLSO-BK', '2024-03-30', 90.00),
('Aria Cooper', 'POLSO-XC', '2024-01-31', 100.75),
('Harper Morris', 'POLY 03', '2024-04-01', 75.50),
('Evelyn Rogers', 'POLY 04', '2024-04-02', 200.25),
('Jackson Sanchez', 'PONCE 08-54644.6', '2024-04-03', 150.00),
('Amelia Long', 'TANPA 14SS', '2023-04-04', 100.75),
('Ella Peterson', 'TANSEL', '2023-04-05', 125.50),
('Daniel Wright', 'TARAKLI 01', '2023-04-06', 75.25),
('Nathan Ramirez', 'TARAKUNYA', '2023-04-07', 90.00),
('Lily Hill', 'TASKENT 07KX', '2023-04-08', 150.75),
('Carter Murphy', 'TASKENT 08BK', '2023-04-09', 200.50),
('John Doe', 'TASKENT 08KX', '2023-04-10', 80.25),
('Jane Smith' , 'ADA 20', '2023-01-23', 120.25),
('Alice Johnson',  'ADA 21', '2023-04-24', 80.00),
('Michael Brown',  'ADA 22', '2023-05-25', 100.75),
('Emily Wilson',  'AGATA 09', '2023-06-26', 300.50),
('David Taylor', 'ARMA 03', '2023-01-04', 180.75),
('Sarah Martinez', 'CROWN 07', '2023-12-05', 220.50),
('James Anderson', 'CROWN 08', '2023-11-06', 150.25),
('Jennifer Thomas', 'LETO 01RA', '2022-09-19', 100.75),
('Daniel White', 'LEOPAR 05BK', '2022-01-20', 125.50),
('Jessica Lee', 'LEOPAR 06', '2022-04-21', 75.25),
('Matthew Harris', 'LEONAR 89', '2022-05-22', 90.00),
('Olivia Clark', 'COT 02', '2021-06-08', 75.50),
('Andrew King', 'COT 03', '2021-07-09', 200.75),
('Sophia Wright', 'COT 04', '2021-08-10', 90.50),
('Ethan Hill', 'ACEM', '2023-01-20', 150.00),
('Isabella Green',  'ACERO KOM', '2023-03-22', 75.50),
('William Baker', 'POLY 04', '2024-05-02', 200.25),
('Ava Adams', 'PONCE 08-54644.6', '2024-01-03', 150.00),
('Alexander Allen', 'TANPA 14SS', '2023-05-04', 100.75),
('Mia Parker',  'AGATA 11', '2023-08-28', 200.00),
('Michael Scott', 'ARMA 01', '2023-06-01', 75.50),
('Abigail Evans', 'ARMA 01-1', '2022-03-02', 125.25),
('Jayden Murphy',  'ADA 22', '2024-02-25', 100.75),
('Grace Turner',  'AGATA 09', '2024-01-26', 300.50),
('Logan Hall',  'AGATA 10', '2024-06-27', 50.25),
('Chloe Young',  'ACEM', '2023-06-20', 150.00),
('Christopher Wright',  'ACERO KOM', '2024-01-22', 75.50),
('Natalie Rodriguez', 'MEVA', '2024-02-26', 150.00),
('Aiden Martinez', 'MEVSIM', '2024-09-27', 100.75),
('Zoe Martinez', 'MIA 06P', '2024-10-28', 180.50),
('Madison Rivera', 'MIA 07', '2024-11-29', 220.25),
('Benjamin Reed', 'LESTO KOM', '2021-01-17', 220.75),
('Avery Mitchell', 'LETO 01', '2022-02-18', 90.00),
('Elijah Perez', 'LETO 01RA', '2022-06-19', 100.75),
('Liam Campbell',  'AGATA 09', '2023-08-26', 300.50),
('Charlotte Flores', 'ARMA 03', '2023-09-04', 180.75),
('Scarlett Collins', 'CROWN 07', '2023-09-05', 220.50),
('Mason Washington', 'POLSO-XC', '2024-04-30', 100.75),
('Lucas Parker', 'POLY 03', '2024-05-01', 75.50),
('Aria Cooper', 'POLSO-XC', '2024-05-30', 100.75),
('Harper Morris', 'POLY 03', '2024-07-01', 75.50),
('Evelyn Rogers', 'COT 04', '2021-09-10', 90.50),
('Jackson Sanchez', 'PONCE 08-54644.6', '2024-01-03', 150.00),
('Amelia Long', 'TANPA 14SS', '2023-02-04', 100.75),
('Ella Peterson',  'AGATA 11', '2023-03-28', 200.00),
('Daniel Wright', 'COT 04', '2021-06-10', 90.50),
('Nathan Ramirez',  'ACEM', '2023-07-20', 150.00),
('Lily Hill', 'LESTO KOM', '2021-12-17', 220.75),
('Carter Murphy', 'LETO 01', '2022-11-18', 90.00),
('Mia Parker', 'LETO 01RA', '2022-12-19', 100.75)


-- POSTGRES
CREATE TABLE "Orders" (
    "Id" SERIAL PRIMARY KEY,
    "CustomerName" VARCHAR(255),
    "ProductName" VARCHAR(50),
    "OrderDate" timestamptz,
    "Quantity" DECIMAL(10, 2)
);

INSERT INTO "Orders" ("CustomerName", "ProductName", "OrderDate", "Quantity")
VALUES
('John Doe',  'ACEM', '2023-02-20', 150.00),
('Jane Smith',  'ACERO KOM', '2023-02-22', 75.50),
('Alice Johnson',  'ACERO RY', '2023-02-21', 200.00),
('Michael Brown',  'ADA 20', '2023-02-23', 120.25),
('Emily Wilson',  'ADA 21', '2023-02-24', 80.00),
('David Taylor',  'ADA 22', '2023-02-25', 100.75),
('Sarah Martinez',  'AGATA 09', '2023-02-26', 300.50),
('James Anderson',  'AGATA 10', '2023-02-27', 50.25),
('Jennifer Thomas',  'AGATA 10BK', '2023-02-28', 150.00),
('Daniel White',  'AGATA 11', '2023-02-28', 200.00),
('Jessica Lee', 'ARMA 01', '2023-03-01', 75.50),
('Matthew Harris', 'ARMA 01-1', '2023-03-02', 125.25),
('Olivia Clark', 'ARMA 02', '2023-03-03', 90.00),
('Andrew King', 'ARMA 03', '2023-03-04', 180.75),
('Sophia Wright', 'CROWN 07', '2023-03-05', 220.50),
('Ethan Hill', 'CROWN 08', '2023-03-06', 150.25),
('Isabella Green', 'CROWN 09', '2024-03-07', 100.00),
('William Baker', 'COT 02', '2021-03-08', 75.50),
('Ava Adams', 'COT 03', '2021-03-09', 200.75),
('Alexander Allen', 'COT 04', '2021-03-10', 90.50),
('Mia Parker', 'EL.TORONTO', '2021-03-11', 180.25),
('Michael Scott', 'EL.TORONTO PSKZ', '2021-03-12', 300.00),
('Abigail Evans', 'EL.TOSCANA', '2021-03-13', 50.75),
('Jayden Murphy', 'ELA 23', '2021-03-14', 75.50),
('Grace Turner', 'ELA 24', '2021-03-15', 150.25),
('Logan Hall', 'ELA 25', '2021-03-16', 180.50),
('Chloe Young', 'LESTO KOM', '2021-03-17', 220.75),
('Christopher Wright', 'LETO 01', '2022-03-18', 90.00),
('Natalie Rodriguez', 'LETO 01RA', '2022-03-19', 100.75),
('Aiden Martinez', 'LEOPAR 05BK', '2022-03-20', 125.50),
('Zoe Martinez', 'LEOPAR 06', '2022-03-21', 75.25),
('Madison Rivera', 'LEONAR 89', '2022-03-22', 90.00),
('Benjamin Reed', 'LEONAR 90', '2022-03-23', 150.75),
('Avery Mitchell', 'METROPOL 03', '2022-03-24', 200.50),
('Elijah Perez', 'METROPOL 03 EKRU', '2022-03-25', 80.25),
('Liam Campbell', 'MEVA', '2024-03-26', 150.00),
('Charlotte Flores', 'MEVSIM', '2024-03-27', 100.75),
('Scarlett Collins', 'MIA 06P', '2024-03-28', 180.50),
('Mason Washington', 'MIA 07', '2024-03-29', 220.25),
('Lucas Parker', 'POLSO-BK', '2024-03-30', 90.00),
('Aria Cooper', 'POLSO-XC', '2024-01-31', 100.75),
('Harper Morris', 'POLY 03', '2024-04-01', 75.50),
('Evelyn Rogers', 'POLY 04', '2024-04-02', 200.25),
('Jackson Sanchez', 'PONCE 08-54644.6', '2024-04-03', 150.00),
('Amelia Long', 'TANPA 14SS', '2023-04-04', 100.75),
('Ella Peterson', 'TANSEL', '2023-04-05', 125.50),
('Daniel Wright', 'TARAKLI 01', '2023-04-06', 75.25),
('Nathan Ramirez', 'TARAKUNYA', '2023-04-07', 90.00),
('Lily Hill', 'TASKENT 07KX', '2023-04-08', 150.75),
('Carter Murphy', 'TASKENT 08BK', '2023-04-09', 200.50),
('John Doe', 'TASKENT 08KX', '2023-04-10', 80.25),
('Jane Smith' , 'ADA 20', '2023-01-23', 120.25),
('Alice Johnson',  'ADA 21', '2023-04-24', 80.00),
('Michael Brown',  'ADA 22', '2023-05-25', 100.75),
('Emily Wilson',  'AGATA 09', '2023-06-26', 300.50),
('David Taylor', 'ARMA 03', '2023-01-04', 180.75),
('Sarah Martinez', 'CROWN 07', '2023-12-05', 220.50),
('James Anderson', 'CROWN 08', '2023-11-06', 150.25),
('Jennifer Thomas', 'LETO 01RA', '2022-09-19', 100.75),
('Daniel White', 'LEOPAR 05BK', '2022-01-20', 125.50),
('Jessica Lee', 'LEOPAR 06', '2022-04-21', 75.25),
('Matthew Harris', 'LEONAR 89', '2022-05-22', 90.00),
('Olivia Clark', 'COT 02', '2021-06-08', 75.50),
('Andrew King', 'COT 03', '2021-07-09', 200.75),
('Sophia Wright', 'COT 04', '2021-08-10', 90.50),
('Ethan Hill', 'ACEM', '2023-01-20', 150.00),
('Isabella Green',  'ACERO KOM', '2023-03-22', 75.50),
('William Baker', 'POLY 04', '2024-05-02', 200.25),
('Ava Adams', 'PONCE 08-54644.6', '2024-01-03', 150.00),
('Alexander Allen', 'TANPA 14SS', '2023-05-04', 100.75),
('Mia Parker',  'AGATA 11', '2023-08-28', 200.00),
('Michael Scott', 'ARMA 01', '2023-06-01', 75.50),
('Abigail Evans', 'ARMA 01-1', '2022-03-02', 125.25),
('Jayden Murphy',  'ADA 22', '2024-02-25', 100.75),
('Grace Turner',  'AGATA 09', '2024-01-26', 300.50),
('Logan Hall',  'AGATA 10', '2024-06-27', 50.25),
('Chloe Young',  'ACEM', '2023-06-20', 150.00),
('Christopher Wright',  'ACERO KOM', '2024-01-22', 75.50),
('Natalie Rodriguez', 'MEVA', '2024-02-26', 150.00),
('Aiden Martinez', 'MEVSIM', '2024-09-27', 100.75),
('Zoe Martinez', 'MIA 06P', '2024-10-28', 180.50),
('Madison Rivera', 'MIA 07', '2024-11-29', 220.25),
('Benjamin Reed', 'LESTO KOM', '2021-01-17', 220.75),
('Avery Mitchell', 'LETO 01', '2022-02-18', 90.00),
('Elijah Perez', 'LETO 01RA', '2022-06-19', 100.75),
('Liam Campbell',  'AGATA 09', '2023-08-26', 300.50),
('Charlotte Flores', 'ARMA 03', '2023-09-04', 180.75),
('Scarlett Collins', 'CROWN 07', '2023-09-05', 220.50),
('Mason Washington', 'POLSO-XC', '2024-04-30', 100.75),
('Lucas Parker', 'POLY 03', '2024-05-01', 75.50),
('Aria Cooper', 'POLSO-XC', '2024-05-30', 100.75),
('Harper Morris', 'POLY 03', '2024-07-01', 75.50),
('Evelyn Rogers', 'COT 04', '2021-09-10', 90.50),
('Jackson Sanchez', 'PONCE 08-54644.6', '2024-01-03', 150.00),
('Amelia Long', 'TANPA 14SS', '2023-02-04', 100.75),
('Ella Peterson',  'AGATA 11', '2023-03-28', 200.00),
('Daniel Wright', 'COT 04', '2021-06-10', 90.50),
('Nathan Ramirez',  'ACEM', '2023-07-20', 150.00),
('Lily Hill', 'LESTO KOM', '2021-12-17', 220.75),
('Carter Murphy', 'LETO 01', '2022-11-18', 90.00),
('Mia Parker', 'LETO 01RA', '2022-12-19', 100.75);

CREATE PROCEDURE PDashboard_Widgets
	@Tarih1 datetime,
	@Tarih2 datetime 
AS

SET DATEFORMAT 'DMY'

SELECT 'Revenue' AS label, '$' AS valuePrefix, '01/01/2025' AS date, 21827.13 AS dataValue, 11.4 AS growShrink
UNION
SELECT 'Orders' AS label, 'mt' AS valuePrefix, '01/01/2025' AS date, 1758 AS dataValue, -3.2 AS growShrink
UNION
SELECT 'Purchases' AS label, '$' AS valuePrefix, '05/01/2025' AS date, 7249.31 AS dataValue, 5.7 AS growShrink
