DataBase.sql 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. create database if not exists ShoppingWebsite;
  2. use ShoppingWebsite;
  3. /* node stuctor
  4. userAccount
  5. + user_cart
  6. + user_collect
  7. */
  8. create table if not exists userAccount
  9. (
  10. userId bigint not null,
  11. email varchar(50) not null,
  12. password varchar(16) not null,
  13. permission int not null default 0,
  14. primary key(email,userId)
  15. );
  16. create table if not exists user_cart
  17. (
  18. user_Cart_Id bigint not null primary key,
  19. password varchar(16) not null,
  20. permission int not null default 0
  21. );
  22. create table if not exists user_collect
  23. (
  24. user_collect_Id bigint not null primary key,
  25. password varchar(16) not null,
  26. permission int not null default 0
  27. );
  28. /* node stuctor
  29. store
  30. + goods
  31. + selectionGroup
  32. + selection
  33. + comment
  34. */
  35. create table if not exists store
  36. (
  37. store_Id bigint not null primary key,
  38. postion varchar(100) not null,
  39. name varchar(50) not null,
  40. star int
  41. );
  42. create table if not exists goods
  43. (
  44. goods_id bigint not null primary key,
  45. postion varchar(100) not null,
  46. name varchar(50) not null,
  47. star int
  48. );
  49. create table if not exists selectionGroup
  50. (
  51. selection_group_id bigint not null primary key,
  52. name varchar(50) not null
  53. );
  54. create table if not exists selection
  55. (
  56. selection_id bigint not null primary key,
  57. name varchar(50) not null,
  58. price float(13,2)
  59. );
  60. /* node*/
  61. create table if not exists nodeinfo
  62. (
  63. id bigint not null primary key,
  64. prev_id bigint null,
  65. next_id bigint null,
  66. parent_id bigint null,
  67. child_id bigint null,
  68. obj_type varchar(100) default 'group04.BasicNode'
  69. );