CREATE TABLE Property(
propertyRef varchar(15) NOT NULL,
sellerID varchar(4) NOT NULL,
houseNumber int NOT NULL,
street varchar(75) NOT NULL,
city varchar(9) NOT NULL,
postcode varchar(8) NOT NULL,
numberOfBedrooms int NOT NULL,
estimatedValue int NOT NULL,
askingPrice int NOT NULL
);

-- The following may be added to the CREATE statement
-- Primary Key Syntax (added after field name and NOT NULL)
--     PRIMARY KEY (fieldName)
--          or for compound PK
--     CONSTRAINT PK_compoundFieldName PRIMARY KEY (field1,field2)
-- Foreign Key Syntax (added after field list)
--     FOREIGN KEY (field name) REFERENCES tableName(fieldName)
-- Text Field Max Size
--     Edit (255) to required length
-- Validation of length of text (added after create statement as new statement
--     CHECK (CHAR_LENGTH(fieldName) > value)
-- Range Check (added after field list)
--     CHECK (fieldName >= value)
--     CHECK (fieldName >= value AND fieldName <= value2)
-- Restricted choice
--     CHECK(fieldName in ('value1','value2','value3')) 

-- Note
-- At N5 Check constraints (that are ignored by a MySQL server) 
-- are being used instead of triggers.

INSERT INTO Property VALUES("ABDN-107","6932",194,"Station Street","Aberdeen","AB82 2RT",4,245500,236800);
INSERT INTO Property VALUES("ABDN-115","1969",20,"Church Street","Aberdeen","AB60 9CX",3,148000,150000);
INSERT INTO Property VALUES("ABDN-136","2856",181,"King Lane","Aberdeen","AB56 6KM",2,103500,106500);
INSERT INTO Property VALUES("ABDN-138","8472",26,"Castle Street","Aberdeen","AB84 0ZN",1,79100,78800);
INSERT INTO Property VALUES("DUN-101","3896",99,"George Avenue","Dundee","DD10 0QM",2,111000,105500);
INSERT INTO Property VALUES("DUN-110","4423",14,"Princess Lane","Dundee","DD2 2AE",2,148000,9400);
INSERT INTO Property VALUES("DUN-131","9186",6,"George Street","Dundee","DD2 0WB",5,295200,181500);
INSERT INTO Property VALUES("DUN-139","498",22,"Union Close","Dundee","DD9 8PN",3,145000,140000);
INSERT INTO Property VALUES("DUN-144","498",132,"Station Close","Dundee","DD11 7WH",4,265500,248000);
INSERT INTO Property VALUES("DUN-150","2136",1,"Victoria Street","Dundee","DD2 1MS",2,94000,100000);
INSERT INTO Property VALUES("DUN-163","6722",150,"Union Lane","Dundee","DD5 7SG",1,70100,70000);
INSERT INTO Property VALUES("EDI-108","6317",118,"Station Avenue","Edinburgh","EH24 4XP",1,57000,49800);
INSERT INTO Property VALUES("EDI-117","3870",5,"Church Close","Edinburgh","EH33 9WV",4,233000,231000);
INSERT INTO Property VALUES("EDI-173","4174",175,"High Lane","Edinburgh","EH48 8MH",3,109500,108000);
INSERT INTO Property VALUES("EDI-202","8511",9,"King Close","Edinburgh","EH15 8UY",2,191500,187500);
INSERT INTO Property VALUES("EDI-205","2129",23,"John Lane","Edinburgh","EH32 1TW",4,287000,265000);
INSERT INTO Property VALUES("GLA-103","6745",163,"King Road","Glasgow","G19 8IY",2,134500,140500);
INSERT INTO Property VALUES("GLA-104","1131",49,"Victoria Road","Glasgow","G56 4EM",2,170905,170000);
INSERT INTO Property VALUES("GLA-111","8511",97,"Castle Avenue","Glasgow","G33 4GF",3,165500,156500);
INSERT INTO Property VALUES("GLA-112","4026",5,"Bank Avenue","Glasgow","G9 2FH",2,136000,140000);
INSERT INTO Property VALUES("GLA-114","671",86,"Queen Avenue","Glasgow","G44 1ZS",4,205000,202000);
INSERT INTO Property VALUES("INV-029","5885",37,"North Avenue","Inverness","IV57 5DF",4,199700,183500);
INSERT INTO Property VALUES("INV-134","8162",155,"Union Road","Inverness","IV47 2YQ",3,135000,135500);
INSERT INTO Property VALUES("INV-138","9416",96,"South Close","Inverness","IV10 3RH",3,145000,142600);
INSERT INTO Property VALUES("INV-179","8239",195,"Station Road","Inverness","IV63 7DB",4,272900,261600);
INSERT INTO Property VALUES("INV-209","3356",46,"High Close","Inverness","IV39 4GJ",3,183000,188500);
INSERT INTO Property VALUES("INV-211","9416",2,"King Avenue","Inverness","IV10",4,235000,229000);
INSERT INTO Property VALUES("PER-101","2971",21,"Main Road","Perth","PH20 7PH",3,170000,165000);
INSERT INTO Property VALUES("PER-128","1524",5,"King Close","Perth","PH46 2RL",5,285000,264000);
INSERT INTO Property VALUES("PER-130","3930",23,"George Lane","Perth","PH38 9TJ",3,170000,168000);
INSERT INTO Property VALUES("PER-149","4558",137,"George Road","Perth","PH38 9TA",3,155000,149800);
INSERT INTO Property VALUES("PER-151","8727",45,"Castle Street","Perth","PH27 3QB",5,297000,294500);
INSERT INTO Property VALUES("PER-168","9341",107,"Main Avenue","Perth","PH2 0MA",4,245900,238000);
INSERT INTO Property VALUES("PER-173","3538",168,"Union Street","Perth","PH9 7GU",3,141000,139000);
INSERT INTO Property VALUES("PER-177","540",34,"High Avenue","Perth","PH23 0NC",4,167500,178000);
INSERT INTO Property VALUES("PER-196","5621",132,"Union Street","Perth","PH17 3CE",3,246000,239000);
INSERT INTO Property VALUES("STIR-133","2971",156,"Victoria Road","Stirling","FK20 2FV",4,243600,249500);
INSERT INTO Property VALUES("STIR-138","2032",12,"Shore Road","Stirling","FK11 4TA",3,125000,122000);
INSERT INTO Property VALUES("STIR-162","5685",156,"North Close","Stirling","FK17 2SN",4,174000,170000);
INSERT INTO Property VALUES("STIR-172","6475",195,"King Street","Stirling","FK16 5LJ",4,232000,215000);
INSERT INTO Property VALUES("STIR-176","4356",1,"Princess Close","Stirling","FK10 9MG",3,141000,135000);
INSERT INTO Property VALUES("STIR-201","7749",95,"King Lane","Stirling","FK9 3FQ",4,186500,185000);
INSERT INTO Property VALUES("STIR-203","7740",171,"Station Road","Stirling","FK12 7NN",4,234000,228000);
