Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --1
- INSERT INTO SalesLT.Product (Name, ProductNumber, StandardCost, ListPrice, ProductCategoryID, SellStartDate)
- VALUES ('LED Lightsh', 'LT-L123h', 2.56, 12.99, 37, GETDATE())
- SELECT SCOPE_IDENTITY() AS ProductID;
- --2
- INSERT INTO SalesLT.ProductCategory (ParentProductCategoryID, Name)
- VALUES
- (4, 'Bells and Horns')
- INSERT INTO SalesLT.Product (Name, ProductNumber, StandardCost,
- ListPrice, ProductCategoryID, SellStartDate)
- VALUES
- ('Bicycle Bell', 'BB-RING', 2.47, 4.99, IDENT_CURRENT('SalesLT.ProductCategory'), GETDATE()),
- ('Bicycle Horn', 'BB-PARP', 1.29, 3.75, IDENT_CURRENT('SalesLT.ProductCategory'), GETDATE())
- SELECT * FROM SalesLT.Product
- WHERE Name = 'Bicycle Bell' OR Name = 'Bicycle Horn'
- SELECT * FROM SalesLT.ProductCategory
- WHERE Name = 'Bells and Horns'
- --3
- UPDATE SalesLT.Product
- SET ListPrice = ListPrice * 1.10
- WHERE ProductCategoryID =
- (SELECT ProductCategoryID FROM SalesLT.ProductCategory WHERE Name = 'Bells and Horns')
- --4
- UPDATE SalesLT.Product
- SET DiscontinuedDate = GETDATE()
- WHERE ProductCategoryID = 37
- AND ProductNumber <> 'LT-L123';
- --5
- DELETE FROM SalesLT.Product
- WHERE ProductCategoryID =
- (SELECT ProductCategoryID FROM SalesLT.ProductCategory WHERE Name = 'Bells and Horns')
- DELETE FROM SalesLT.ProductCategory
- WHERE ProductCategoryID =
- (SELECT ProductCategoryID FROM SalesLT.ProductCategory WHERE Name = 'Bells and Horns')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement