create_table_2.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. -- todo 优化
  2. DROP TABLE IF EXISTS person_call_stat;
  3. CREATE TABLE person_call_stat
  4. (
  5. personName VARCHAR primary key,
  6. personPhoneCount INTEGER,
  7. firstCallDateTime TIMESTAMP,
  8. lastCallDateTime TIMESTAMP,
  9. totalCallCount INTEGER,
  10. totalCallDuration INTEGER,
  11. outCallCount INTEGER,
  12. inCallCount INTEGER
  13. );
  14. DROP TABLE IF EXISTS person_deal_stat;
  15. CREATE TABLE person_deal_stat
  16. (
  17. personName VARCHAR primary key,
  18. cardNoCount INTEGER,
  19. otherCount INTEGER,
  20. totalTransAmount DECIMAL(18, 2),
  21. totalTransCount INTEGER,
  22. totalInAmount DECIMAL(18, 2),
  23. totalInCount INTEGER,
  24. totalOutAmount DECIMAL(18, 2),
  25. totalOutCount INTEGER,
  26. netSettlementAmount DECIMAL(18, 2),
  27. firstTransDateTime TIMESTAMP,
  28. lastTransDateTime TIMESTAMP
  29. );
  30. DROP TABLE IF EXISTS phone_call_stat;
  31. CREATE TABLe phone_call_stat
  32. (
  33. personPhone VARCHAR primary key,
  34. personName VARCHAR,
  35. personCertNo VARCHAR,
  36. operator VARCHAR,
  37. firstCallDateTime TIMESTAMP,
  38. lastCallDateTime TIMESTAMP,
  39. callContactCount INTEGER,
  40. totalCallDuration INTEGER,
  41. totalCallCount INTEGER,
  42. outCallDuration INTEGER,
  43. outCallCount INTEGER,
  44. inCallDuration INTEGER,
  45. inCallCount INTEGER
  46. );
  47. DROP TABLE IF EXISTS card_deal_stat;
  48. CREATE TABLE card_deal_stat
  49. (
  50. personCardNo VARCHAR primary key,
  51. personName VARCHAR,
  52. personCertNo VARCHAR,
  53. bankCardName VARCHAR,
  54. otherCount INTEGER,
  55. totalTransAmount DECIMAL(18, 2),
  56. totalTransCount INTEGER,
  57. totalInAmount DECIMAL(18, 2),
  58. totalInCount INTEGER,
  59. totalOutAmount DECIMAL(18, 2),
  60. totalOutCount INTEGER,
  61. netSettlementAmount DECIMAL(18, 2),
  62. firstTransDateTime TIMESTAMP,
  63. lastTransDateTime TIMESTAMP,
  64. lastTransAmount DECIMAL(18, 3)
  65. );