Advertisement
murp

Sample SQL

Apr 2nd, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.48 KB | None | 0 0
  1. CREATE TABLE PROPERTIES
  2. (
  3. [ID] [INT] IDENTITY(1,1) NOT NULL,
  4. TITLE VARCHAR(MAX),
  5. POPULATION VARCHAR(MAX)
  6. )
  7.  
  8. INSERT INTO PROPERTIES
  9. (TITLE, POPULATION)
  10. VALUES
  11. ('Design By George', '234000'),
  12. ('Network Depot', '546000'),
  13. ('Renaud Consulting', '898000');
  14.  
  15. CREATE TABLE AVGPOPULATION
  16. (
  17. [ID] [INT] IDENTITY(1,1) NOT NULL,
  18. popradius INT,
  19. popamount INT,
  20. propertyfk INT
  21. )
  22.  
  23. INSERT INTO AVGPOPULATION
  24. (popradius, popamount, propertyfk)
  25. SELECT '1', POPULATION, ID
  26. FROM PROPERTIES;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement