You are on page 1of 2

1.

Add a new currency and its rate

BEGIN TRANSACTION;
INSERT INTO [Sales].[Currency]
VALUES('MDL', 'Leu Moldovenesc', '2024-04-14');
INSERT INTO [Sales].[CurrencyRate]
([CurrencyRateDate], [FromCurrencyCode], [ToCurrencyCode], [AverageRate],
[EndOfDayRate], [ModifiedDate])
VALUES('2024-04-15','MDL', 'EUR', 19.50, '2024-04-15', '2024-04-14')
COMMIT;

2. Delete currency with code MDL

BEGIN TRANSACTION;
DELETE FROM [Sales].[CountryRegionCurrency]
WHERE[CurrencyCode] = 'MDL';
DELETE FROM [Sales].[Currency]
WHERE [CurrencyCode] = 'MDL';
ROLLBACK;

3. Update Currency code

BEGIN TRANSACTION;
UPDATE [Sales].[CountryRegionCurrency]
SET [CurrencyCode] = 'AHD'
WHERE [CountryRegionCode] = 'AE';
UPDATE [Sales].[Currency]
SET [CurrencyCode] = 'AHD'
WHERE [CurrencyCode] = 'AED';
UPDATE [Sales].[CurrencyRate]
SET [FromCurrencyCode] = 'AHD'
WHERE [FromCurrencyCode] = 'AED';
UPDATE [Sales].[CurrencyRate]
SET [ToCurrencyCode] = 'AHD'
WHERE [ToCurrencyCode] = 'AED'
ROLLBACK;

4. Update person phone number and person email

BEGIN TRANSACTION;
UPDATE [Person].[PersonPhone]
SET [PhoneNumber] = '04646486484'
WHERE [BusinessEntityID] = 1;
UPDATE [Person].[EmailAddress]
SET [EmailAddress] = 'newAddress@hotmail.com'
WHERE [BusinessEntityID] = 1;
ROLLBACK;

5. Delete Phone number Type

BEGIN TRANSACTION;
DELETE FROM [Person].[PersonPhone]
WHERE[PhoneNumberTypeID] = 3;
DELETE FROM [Person].[PhoneNumberType]
WHERE [Name] = 'Work';
COMMIT;

6. Add a new type off phone number


BEGIN TRANSACTION;
INSERT INTO [Person].[PhoneNumberType] ([Name], [ModifiedDate])
VALUES('Remote', '2024-04-14');
UPDATE [Person].[PersonPhone]
SET [PhoneNumberTypeID] = 5
WHERE [PhoneNumber] LIKE '818%'
COMMIT;

7. Update product cost

BEGIN TRANSACTION;
UPDATE [Production].[Product]
SET [StandardCost]= 250.00
WHERE [ProductID] = 1;
INSERT INTO [Production].[ProductCostHistory]
([ProductID],[StartDate],[EndDate],[StandardCost] ,[ModifiedDate])
VALUES (1, '2024-04-14', null, 250.00, '2024-04-14');
ROLLBACK;

8. Update product cost

BEGIN TRANSACTION;
UPDATE [Production].[Product]
SET [ListPrice] = 300.00
WHERE [ProductID] = 1;
INSERT INTO [Production].[ProductListPriceHistory]
([ProductID],[StartDate],[EndDate],[ListPrice] ,[ModifiedDate])
VALUES (1, '2024-04-14', null, 300.00, '2024-04-14');
ROLLBACK;

You might also like