SHARE
TWEET

Untitled

a guest Dec 11th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create database Tourdulich
  2. go
  3.  
  4. create table hdv
  5. (
  6. mahdv nvarchar(50) not NULL,
  7. tenhsv nvarchar(50),
  8. ngaysinh date,
  9. diachi nvarchar(50),
  10. gioitinh nvarchar(50),
  11. sdt nvarchar(50),
  12. matour nvarchar(50),
  13. primary key (mahdv)
  14. )
  15. create table diadiem
  16. (
  17. madd nvarchar(50) not NULL,
  18. tendd nvarchar(50),
  19. matour nvarchar(50) not NULL,
  20. mota nvarchar(50),
  21. primary key (madd)
  22. )
  23. create table dichvu
  24. (
  25. madv nvarchar (50) not NULL,
  26. tendv nvarchar (50),
  27. matour nvarchar (50),
  28. giadv money,
  29. mota nvarchar (50),
  30. primary key (madv)
  31. )
  32. create table tour
  33. (
  34. matour nvarchar (50) not NULL,
  35. tentour nvarchar (50),
  36. mahdv nvarchar (50) not NULL,
  37. ngaybd date,
  38. ngaykt date,
  39. trangthai nvarchar (50),
  40. thoigian int,
  41. giatour money,
  42.  
  43. primary key (matour),
  44. )
  45. create table hoadon
  46. (
  47. mahdon nvarchar (50) not NULL,
  48. mahd nvarchar (50) unique not NULL,
  49. tenkh nvarchar (50),
  50. sotien money,
  51. ngaythanhtoan date,
  52.  
  53. primary key (mahdon)
  54. )
  55. create table hopdong
  56. (
  57. mahd nvarchar (50) not NULL,
  58. matour nvarchar (50) not NULL,
  59. makh nvarchar (50) not NULL,
  60. ngaylap date,
  61. nguoilap nvarchar (50),
  62. ngayhuy date,
  63. phihuy money,
  64. thanhtien money,
  65.  
  66. primary key (mahd)
  67. )
  68. create table khachhang
  69. (
  70. makh nvarchar (50) not NULL,
  71. tenkh nvarchar (50),
  72. quoctich nvarchar (50),
  73. ngaysinh date,
  74. hochieu nvarchar (50),
  75. diachi nvarchar (50),
  76.  
  77. primary key (makh)
  78. )
  79. create table phieudanhgia
  80. (
  81. maphieu nvarchar (50)not NULL,
  82. makh nvarchar (50),
  83. mahd nvarchar (50),
  84. danhgia nvarchar (50),
  85.  
  86. primary key (maphieu)
  87. )
  88. insert into hdv
  89. values
  90. ('hdv01','cuong','2000/08/12','hanoi','nam','0123456','matour1'),
  91. ('hdv02','hung','1998/01/11','thaibinh','nam','0123567','matour2'),
  92. ('hdv03','quang','2000/04/03','haiduong','nam','0123678','matour3'),
  93. ('hdv04','hieu','2000/04/04','hanoi','nam','0123685','matour4'),
  94. ('hdv05','binh','2000/06/18','hanoi','nu','0123968','matour5')
  95.  
  96. insert into tour
  97. values
  98. ('matour1','tour1','hdv01','2019/01/14','2019/02/04','hoanthanh','21','5000000'),
  99. ('matour2','tour2','hdv02','2019/05/07','2019/05/17','hoanthanh','7','7500000'),
  100. ('matour3','tour3','hdv03','2020/06/10','2020/06/25','chuahoanthanh','15','10000000'),
  101. ('matour4','tour4','hdv04','2019/011/02','2019/12/02','hoanthanh','30','20000000'),
  102. ('matour5','tour5','hdv05','2018/03/14','2018/03/15','hoanthanh','01','3000000')
  103.  
  104. insert into diadiem
  105. values
  106. ('dd01','vinhhalong','matour1',''),
  107. ('dd02','hoian','matour2',''),
  108. ('dd03','hue','matour3',''),
  109. ('dd04','danang','matour4',''),
  110. ('dd05','cualo','matour5','')
  111.  
  112. insert into dichvu
  113. values
  114. ('mdv01', 'Cafeom','matour1', '5000000',''),
  115. ('mdv02', 'leonui','matour2', '6000000',''),
  116. ('mdv03', 'duthuyen','matour3', '7000000',''),
  117. ('mdv04', 'nhaydu','matour4', '8000000',''),
  118. ('mdv05', 'luotvan','matour5', '9000000','')
  119.  
  120. insert into phieudanhgia
  121. values
  122. ('maph01','makh01','mahd01',''),
  123. ('maph02','makh02','mahd02',''),
  124. ('maph03','makh03','mahd03',''),
  125. ('maph04','makh04','mahd04',''),
  126. ('maph05','makh05','mahd05','')
  127.  
  128. insert into khachhang
  129. values
  130. ('makh01','kh01','vietnam','1960/02/21','hochieu01','hanoi'),
  131. ('makh02','kh02','vietnam','1973/06/11','hochieu02','bavi'),
  132. ('makh03','kh03','vietnam','1988/09/25','hochieu03','thaibinh'),
  133. ('makh04','kh04','campuchia','1999/03/16','hochieu04','phrompenh'),
  134. ('makh05','kh05','america','1996/06/13','hochieu05','newyork')
  135.  
  136. insert into hopdong
  137. values
  138. ('mahd01','matour1','
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top