Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Task1
--Sql Server 2014 Express Edition --Batches are separated by 'go' --Task 1 CREATE TABLE ProductMaster( ProductMasterID int NOT NULL PRIMARY KEY, ProductName varchar(50), Price Money ); go INSERT INTO ProductMaster(ProductMasterID,ProductName,Price) VALUES (1,'Laptop',500) INSERT INTO ProductMaster(ProductMasterID,ProductName,Price) VALUES (2,'Pencil',10.50) INSERT INTO ProductMaster(ProductMasterID,ProductName,Price) VALUES (3,'Bread',15.20) INSERT INTO ProductMaster(ProductMasterID,ProductName,Price) VALUES (4,'Egg',2.5); CREATE TABLE Product( ProductMasterID int, ProductName varchar(100), Price Money ); go CREATE PROCEDURE transfer AS INSERT INTO Product SELECT * FROM ProductMaster DELETE FROM ProductMaster go EXEC transfer; SELECT * FROM Product; go DROP TABLE Product; DROP TABLE ProductMaster;
run
|
edit
|
history
|
help
0
SQL Directives Order of Execution
do several updates at once
Left join producing wrong result
islands and gaps problem
Empleados
using lead() and sum() with over() in mssql
Gangadhar
elie homsi's code
Group by
Get amount of users that bought something soon after registration