DataBase.sql 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. */
  34. create table if not exists store
  35. (
  36. store_Id bigint not null primary key,
  37. postion varchar(100) not null,
  38. name varchar(50) not null,
  39. star int
  40. );
  41. create table if not exists goods
  42. (
  43. goods_id bigint not null primary key,
  44. postion varchar(100) not null,
  45. name varchar(50) not null,
  46. star int
  47. );
  48. create table if not exists selectionGroup
  49. (
  50. selection_group_id bigint not null primary key,
  51. name varchar(50) not null
  52. );
  53. create table if not exists selection
  54. (
  55. selection_id bigint not null primary key,
  56. name varchar(50) not null,
  57. price float(13,2)
  58. );
  59. /* node*/
  60. create table if not exists nodeinfo
  61. (
  62. id bigint not null primary key,
  63. prev_id bigint null,
  64. next_id bigint null,
  65. parent_id bigint null,
  66. child_id bigint null,
  67. obj_type varchar(100) default 'group04.BasicNode'
  68. );