Altair Real Estate

-- =============================================
-- Author:   Yevol
-- Database: RealEstate1
-- =============================================
IF EXISTS (
  SELECT * 
    FROM sys.databases 
   WHERE name = N'RealEstate1'
)
  DROP DATABASE RealEstate1
GO
CREATE DATABASE RealEstate1;
GO

-- =============================================
-- Author:   Yevol
-- Database: RealEstate1
-- Table:    PropertyTypes
-- =============================================
USE RealEstate1;
GO
CREATE TABLE PropertyTypes
(
  PropertyTypeID int identity(1,1) NOT NULL,
  PropertyType varchar(20)
);
GO
INSERT INTO PropertyTypes(PropertyType)
VALUES('Condominium');
GO
INSERT INTO PropertyTypes(PropertyType)
VALUES('Single Family');
GO
INSERT INTO PropertyTypes(PropertyType)
VALUES('Townhouse');
GO
INSERT INTO PropertyTypes(PropertyType)
VALUES('Unknown');
GO

-- =============================================
-- Author:   Yevol
-- Database: RealEstate1
-- Table:    Conditions
-- =============================================
USE RealEstate1;
GO
CREATE TABLE Conditions
(
  ConditionID int identity(1,1) NOT NULL,
  Condition varchar(20)
);
GO
INSERT INTO Conditions(Condition)
VALUES('Excellent');
GO
INSERT INTO Conditions(Condition)
VALUES('Good');
GO
INSERT INTO Conditions(Condition)
VALUES('Bad Shape');
GO
INSERT INTO Conditions(Condition)
VALUES('Mostly Damaged');
GO

-- =============================================
-- Author:   Yevol
-- Database: RealEstate1
-- Table:    Properties
-- =============================================
CREATE TABLE Properties
(
  PropertyID int identity(1,1) NOT NULL,
  PropertyNumber char(6),
  Address varchar(100),
  City varchar(50),
  State char(2),
  ZIPCode varchar(12),
  PropertyTypeID int,
  ConditionID int,
  Bedrooms smallint,
  Bathrooms float,
  FinishedBasement bit,
  IndoorGarage bit,
  Stories smallint,
  YearBuilt smallint,
  MarketValue money
);
GO

INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('524880', '1640 Lombardo Ave', 'Silver Spring', 'MD',
  '20904', 2, 2, 4, 2.5, 3, 1, 3, 1995, 495880.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('688364', '10315 North Hacht Rd', 'College Park', 'MD',
       '20747', 2, 1, 4, 3.5, 3,
       1, 2, 2000, 620724.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, FinishedBasement,
  Stories, MarketValue)
VALUES('611464', '6366 Lolita Drive', 'Laurel', 'MD',
       '20707', 2, 2, 1, 2, 422625.00);
GO
INSERT INTO Properties(Address, City, PropertyTypeID,
  Bedrooms, MarketValue)
VALUES('9002 Palasko Hwy', 'Tysons Corner',
       1, 2, 422895.00);
GO
INSERT INTO Properties(PropertyNumber, State,
  ZIPCode, Bedrooms, YearBuilt, MarketValue)
VALUES('420115', 'DC',
       '20011', 2, 1982, 312555);
GO     
INSERT INTO Properties(PropertyNumber, City, ZIPCode,
 PropertyTypeID, Bedrooms, YearBuilt, MarketValue)
VALUES('917203', 'Alexandria', '22024',
       2, 3, 1965, 345660.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  PropertyTypeID, ConditionID, Bedrooms, Bathrooms, MarketValue)
VALUES('200417', '4140 Holisto Crt', 'Germantown', 'MD',
       1, 1, 2, 1, 215495.00);
GO
INSERT INTO Properties(City, State, PropertyTypeID, ConditionID,
  Bedrooms, Bathrooms,  YearBuilt, MarketValue)
VALUES('Rockville', 'MD', 1, 2, 2, 2, 1996, 436885.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('927474', '9522 Lockwood Rd', 'Chevy Chase', 'MD',
       '20852', 3, 3, 3, 2.5, 3, 0, 3,
       1992, 415665.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('207850', '14250 Parkdoll Rd', 'Rockville', 'MD',
       '20854', 3, 2, 3, 2.5, 2, 1, 2,
       1988, 325995.00);
GO    
INSERT INTO Properties(City, PropertyTypeID, Bedrooms,
  YearBuilt, MarketValue)
VALUES('Washington', 3, 4, 1975, 366775.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  YearBuilt, MarketValue)
VALUES('288540', '10340 Helmes Street #408', 'Silver Spring', 'MD',
       '20906', 1, 2, 1, 1, 2000, 242775.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('247472', '1008 Coppen Street', 'Silver Spring', 'MD',
       '20906', 2, 1,
       3, 3, 3, 1, 3, 1996, 625450.00);
GO
INSERT INTO Properties(City, ZIPCode, PropertyTypeID, 
   Stories, YearBuilt, MarketValue)
VALUES('Chevy Chase', '20956', 2, 
       3, 2001, 525450.00);
GO
INSERT INTO Properties(Address, City, State,
  PropertyTypeID, ConditionID, Bedrooms, MarketValue)
VALUES('686 Herod Ave #D04', 'Takoma Park', 'MD',
       1, 1, 2, 360885.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('297446', '14005 Sniders Blvd', 'Laurel', 'MD',
       '20707', 3, 4,
       4, 1.5, 3, 1, 2, 2002, 412885.00);
GO
INSERT INTO Properties(City, ZIPCode, ConditionID, Bedrooms,
  Stories, YearBuilt)
VALUES('Silver Spring', '20905', 2,
       4, 2, 1965);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('924792', '680 Prushia Rd', 'Washington', 'DC',
       '20008', 2, 2,
       5, 3.5, 3, 0, 3, 2000, 555885.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('294796', '14688 Parrison Street', 'College Park', 'MD',
       '20742', 2, 1,
       5, 2.5, 2, 1, 2, 1995, 485995.00);
GO
INSERT INTO Properties(City, State, PropertyTypeID, ConditionID,
  Bedrooms, Bathrooms,  YearBuilt, MarketValue)
VALUES('Rockville', 'MD', 1, 2, 1, 1, 1996, 418885.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  YearBuilt, MarketValue)
VALUES('811155', '10340 Helmes Street #1012', 'Silver Spring',
       'MD', '20906', 1, 2,
       1, 1, 2000, 252775.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('447597', '4201 Vilamar Ave', 'Hyattsville', 'MD',
       '20782', 3, 1,
       3, 2, 2, 1, 3, 1992, 365880.00);
GO
INSERT INTO Properties(Address, ZIPCode, Bathrooms)
VALUES('1622 Rombard Str', 20904, 2.5);
GO
INSERT INTO Properties(City, State, PropertyTypeID, ConditionID,
  Bedrooms, Bathrooms,  YearBuilt, MarketValue)
VALUES('Rockville', 'MD', 1, 2, 1, 1, 1996, 420555.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('297415', '980 Phorwick Street', 'Washington', 'DC',
       '20004', 2, 2,
       4, 3.5, 3, 3, 1, 2004, 735475.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('475974', '9015 Marvin Crow Ave', 'Gaithersburg', 'MD',
       '20872', 2, 4,
       4, 2.5, 3, 1, 1, 1965, 615775.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('836642', '3016 Feldman Court', 'Rockville', 'MD',
       '20954', 2, 3,
       5, 3, 3, 1, 3, 1960, 528555.00);
GO
INSERT INTO Properties(Address, City, ZIPCode, PropertyTypeID,
  Bedrooms, Bathrooms, MarketValue)
VALUES('2444 Arielson Rd', 'Rockville', '20854', 1, 2, 1, 1996, 475555.00);
GO

INSERT INTO Properties(City, State, PropertyTypeID, Stories)
VALUES('Rockville', 'MD',
       3, 1);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('208304', '7307 Everett Hwy', 'Washington', 'DC',
       '20012', 3, 1,
       2, 2.5, 2, 0, 4, 2006, 420550.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms,
  Bathrooms, YearBuilt, MarketValue)
VALUES('644114', '10340 Helmes Street#1006', 'Silver Spring',
       'MD', '20906', 1, 2,
       2, 2, 2000, 258445.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('937966', '7303 Warfield Court', 'Tysons Corner', 'VA',
       '22131', 2, 2,
       3, 2.5, 3, 1, 4, 2006, 825775.00);
GO
INSERT INTO Properties(City, ZIPCode, ConditionID, Bedrooms, 
  Stories, YearBuilt)
VALUES('Fairfax', '22232', 2, 3, 3, 1985);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('297497', '12401 Conniard Ave', 'Takoma Park', 'MD',
       '20910', 3, 2,
       3, 2.5, 3, 1, 3, 2004, 280775.00);
GO
INSERT INTO Properties(PropertyNumber, City, ZIPCode,
  PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  YearBuilt, Stories, MarketValue)
VALUES('855255', 'Laurel', '20707', 2,
       4, 3, 2, 1962, 2, 342805.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('469750', '6124 Falk Rd', 'Arlington', 'VA',
       '22031', 2, 4,
       4, 3.5, 3, 1, 1, 1982, 635995.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('826927', '5121 Riehl Ace', 'Fairfax', 'VA',
       '22232', 3, 1,
       3, 1.5, 2, 0, 1, 2002, 325620.00);
GO
INSERT INTO Properties(City, ZIPCode, PropertyTypeID, Bedrooms, 
  Bathrooms, MarketValue)
VALUES('Silver Spring', '20906', 1, 2, 2, 335655.00);
GO

INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('287064 ', '9533 Pensulian Rd', 'Silver Spring', 'MD',
       '20904', 2, 3,
       3, 1.5, 3, 1, 2, 1992, 485775.00);
GO
INSERT INTO Properties(PropertyNumber, City, ZIPCode,
  PropertyTypeID, ConditionID, Bedrooms, YearBuilt, Stories)
VALUES('724001 ', '705 Helios Ave', '20004',
       3, 3, 3, 1974, 4);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('209275', '944 Fryer Ave', 'Chevy Chase', 'MD',
       '20852', 2, 1,
       5, 2.5, 3, 0, 2, 2002, 625665.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('204759', '1950 Galego Street', 'Germantown', 'MD',
       '20874', 2, 1,
       4, 3.5, 2, 1, 4, 2007, 428665.00);
GO
INSERT INTO Properties(PropertyNumber, Address, City, State,
  ZIPCode, PropertyTypeID, ConditionID, Bedrooms, Bathrooms,
  FinishedBasement, IndoorGarage, Stories, YearBuilt, MarketValue)
VALUES('937259', '12366 Fowler Ave', 'Alexandria', 'VA',
       '22031', 3, 2,
       3, 1.5, 3, 1, 3, 2007, 402815.00);
GO

Home