/*
Generated by Claude on 4th June 2024

Create table and sample data for use in the Generative AI course, SQL section exercises 
*/
-- Create the PricePaidSW12 table
CREATE TABLE PricePaidSW12 (
    TransactionID UNIQUEIDENTIFIER PRIMARY KEY,
    Price MONEY NOT NULL,
    TransactionDate DATE NOT NULL,
    PostCode NVARCHAR(8) NOT NULL,
    PropertyType NCHAR(1) NOT NULL,
    IsNew NCHAR(1) NOT NULL,
    Duration NCHAR(1) NOT NULL,
    PAON NVARCHAR(100) NOT NULL,
    SAON NVARCHAR(100) NULL,
    Street NVARCHAR(100) NOT NULL
);

-- Insert the provided rows
INSERT INTO PricePaidSW12 (TransactionID, Price, TransactionDate, PostCode, PropertyType, IsNew, Duration, PAON, SAON, Street)
VALUES 
    ('{F5BAD8EE-DE09-468D-AA16-FE3F37F818D0}', 289950.00, '2005-05-31', N'SW12 9NU', N'F', N'N', N'L', N'33', NULL, N'HAZELBOURNE ROAD'),
    ('{83F5BAF5-E120-4378-9557-8D84CA70ADAA}', 410000.00, '2005-01-28', N'SW12 0JD', N'T', N'N', N'F', N'154', NULL, N'HYDETHORPE ROAD'),
    ('{266236D9-1551-4D10-8B31-FE49AE4876AB}', 415000.00, '2005-09-30', N'SW12 0EP', N'T', N'N', N'F', N'122', NULL, N'CAMBRAY ROAD'),
    ('{0F9FD0F7-72E0-47C7-B68B-FFAF8B7CA0A8}', 272600.00, '2005-12-09', N'SW12 9RP', N'F', N'N', N'L', N'105', N'GROUND FLOOR FLAT', N'FERNLEA ROAD');