<!DOCTYPE html>
    <html lang="vi" xmlns="https://www.w3.org/1999/xhtml" prefix="og: https://ogp.me/ns#">
    <head>
<title>Bài 1. CSDL Tour du lịch</title>
<meta name="description" content="Bài 1. CSDL Tour du lịch - Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;365.io.vn&#x002F;savefile&#x002F;co-so-du-lieu&#x002F;bai-1-csdl-tour-du-lich-410.html">
<meta name="author" content="DATAONLINE.IO.VN">
<meta name="copyright" content="DATAONLINE.IO.VN [support@dataonline.io.vn]">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Bài 1. CSDL Tour du lịch">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;365.io.vn&#x002F;savefile&#x002F;co-so-du-lieu&#x002F;bai-1-csdl-tour-du-lich-410.html">
<meta property="og:site_name" content="DATAONLINE.IO.VN">
<meta property="og:url" content="https://365.io.vn/savefile/co-so-du-lieu/bai-1-csdl-tour-du-lich-410.html">
<link rel="shortcut icon" href="https://dataonline.io.vn/favicon.ico">
<link rel="canonical" href="https://365.io.vn/savefile/co-so-du-lieu/bai-1-csdl-tour-du-lich-410.html">
<link rel="alternate" href="https://dataonline.io.vn/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tong-hop/" title="Tin Tức - Tổng hợp" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/gdpt/" title="Tin Tức - GDPT" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/cac-van-ban/" title="Tin Tức - Các văn bản" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tieu-hoc/" title="Tin Tức - Tiểu học" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-3/" title="Tin Tức - Lớp 3" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-4/" title="Tin Tức - Lớp 4" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-5/" title="Tin Tức - Lớp 5" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/sgk-tieu-hoc/" title="Tin Tức - SGK Tiểu học" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-3/" title="Tin Tức - Tin học 3" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-4/" title="Tin Tức - Tin học 4" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-5/" title="Tin Tức - Tin học 5" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/thcs/" title="Tin Tức - THCS" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-6-75/" title="Tin Tức - Lớp 6" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-7-75/" title="Tin Tức - Lớp 7" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-8-75/" title="Tin Tức - Lớp 8" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-9-75/" title="Tin Tức - Lớp 9" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/sgk-thcs/" title="Tin Tức - SGK THCS" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-6/" title="Tin Tức - Tin học 6" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-7/" title="Tin Tức - Tin học 7" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-8/" title="Tin Tức - Tin học 8" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-9/" title="Tin Tức - Tin học 9" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/thpt/" title="Tin Tức - THPT" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-10/" title="Tin Tức - Lớp 10" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-11/" title="Tin Tức - Lớp 11" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lop-12/" title="Tin Tức - Lớp 12" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/sgk-thpt/" title="Tin Tức - SGK THPT" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-10/" title="Tin Tức - Tin học 10" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-11/" title="Tin Tức - Tin học 11" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tin-hoc-12/" title="Tin Tức - Tin học 12" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/cntt/" title="Tin Tức - CNTT" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/phan-mem-quan-li-va-dieu-hanh/" title="Tin Tức - Phần mềm quản lí và điều hành" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/phan-mem-ung-dung/" title="Tin Tức - Phần mềm ứng dụng" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/ung-dung-ai/" title="Tin Tức - Ứng dụng AI" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/mang-may-tinh/" title="Tin Tức - Mạng máy tính" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lap-trinh/" title="Tin Tức - Lập trình" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/cau-truc-thi-hsg-va-ts-vao-10/" title="Tin Tức - Cấu trúc thi HSG và TS vào 10" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/tai-lieu-hoc-lap-trinh/" title="Tin Tức - Tài liệu học lập trình" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/phan-mem-lap-trinh/" title="Tin Tức - Phần mềm lập trình" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lap-trinh-truc-quan/" title="Tin Tức - Lập trình trực quan" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lap-trinh-huong-thu-tuc-pop/" title="Tin Tức - Lập trình hướng thủ tục &#40;POP&#41;" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/de-hsg-tin-hoc-thcs/" title="Tin Tức - Đề HSG Tin học THCS" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/de-tin-hoc-ts-vao-10-thpt-chuyen/" title="Tin Tức - Đề Tin học TS vào 10 THPT chuyên" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/de-tin-hoc-hsg-thpt/" title="Tin Tức - Đề Tin học HSG THPT" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/cham-thi/" title="Tin Tức - Chấm thi" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/themis/" title="Tin Tức - Themis" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/vnoi/" title="Tin Tức - VNOI" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/danh-sach-hoc-sinh/" title="Tin Tức - Danh sách học sinh" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/lap-trinh-huong-doi-tuong-oop/" title="Tin Tức - Lập trình hướng đối tượng &#40;OOP&#41;" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/web-nguon-mo/" title="Tin Tức - Web nguồn mở" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/he-dieu-hanh/" title="Tin Tức - Hệ điều hành" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/microsoft-windows/" title="Tin Tức - Microsoft Windows" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/ho-linux/" title="Tin Tức - Họ Linux" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/may-chu/" title="Tin Tức - Máy chủ" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/co-so-du-lieu/" title="Tin Tức - Cơ sở dữ liệu" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/web-server/" title="Tin Tức - Web Server" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/hosting-domain-vps/" title="Tin Tức - Hosting-domain-VPS" type="application/rss+xml">
<link rel="alternate" href="https://dataonline.io.vn/rss/ban-tin/" title="Tin Tức - Bản tin" type="application/rss+xml">
<link rel="preload" as="style" href="https://dataonline.io.vn/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://dataonline.io.vn/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://dataonline.io.vn/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://dataonline.io.vn/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://dataonline.io.vn/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://dataonline.io.vn/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://dataonline.io.vn/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://dataonline.io.vn/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://dataonline.io.vn/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://dataonline.io.vn/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://dataonline.io.vn/themes/default/css/style.css">
<link rel="stylesheet" href="https://dataonline.io.vn/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://dataonline.io.vn/themes/default/css/news.css">
<link rel="stylesheet" href="https://dataonline.io.vn/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">DATAONLINE.IO.VN</h2>
		<p class="pull-right"><a title="DATAONLINE.IO.VN" href="https://dataonline.io.vn/">https://dataonline.io.vn</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Bài 1. CSDL Tour du lịch</h1>
		<ul class="list-inline">
			<li>Thứ sáu - 08/03/2024 10:39</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
			<p>Bài 1. CSDL Tour du lịch</p>
		</div>
				<div class="imghome">
			<img alt="Bài 1. CSDL Tour du lịch" src="https://dataonline.io.vn/uploads/news/db.png" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<p><strong>Bài 1. CSDL Tour du lịch.</strong><br />Một công ty X chuyên tổ chức các Tour du lịch (Hà Nội, Huế, Nha Trang,...). Để quản lí dữ liệu trong cơ sở dữ liệu của công ty X có ba bảng như sau:<br />Bảng KHACHHANG (Khách hàng)</p><figure class="table"><table style=";"><tbody><tr><td style="border:1px solid black;height:37px;padding:0cm 7px;width:113px;">MA_KH</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:189px;">HO_TEN</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:151px;">DIA_CHI</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:151px;">SO_DT</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:113px;">MS001</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:189px;">Lý Anh Du</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:151px;">Mỹ Xuyên</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:151px;">076845777</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:113px;">MS002</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:189px;">Hoàng Nam Lịch</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:151px;">My Long</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:151px;">076845888</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:113px;">MS003</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:189px;">Lê Đức An</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:151px;">My Long</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:151px;">076845999</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:113px;">MS004</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:189px;">Tử Văn Giang</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:151px;">Mỹ Bình</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:151px;">076845000</td></tr></tbody></table></figure><p><br />Bảng TOUR DU LICH (Tour du lịch)</p><figure class="table"><table style=";"><tbody><tr><td style="border:1px solid black;height:44px;padding:0cm 7px;width:113px;">MA_TOUR</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:44px;padding:0cm 7px;width:189px;">TOUR</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:44px;padding:0cm 7px;width:151px;">DON_GIA</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:113px;">T01</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:189px;">Hà Nội</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:151px;">700000</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:113px;">T02</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:189px;">Huế</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:151px;">500000</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:113px;">T03</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:189px;">Nha Trang</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:151px;">350000</td></tr></tbody></table></figure><p>Bảng DATHANG (Đặt hàng)</p><figure class="table"><table style=";"><tbody><tr><td style="border:1px solid black;height:37px;padding:0cm 7px;width:100px;">MA_KH</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:149px;">MA_TOUR</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:127px;">SO_LUONG</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top:1px solid black;height:37px;padding:0cm 7px;width:130px;">NGAY_DI</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:100px;">MS001</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:149px;">T03</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:127px;">20</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:130px;">20/11/2008</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:100px;">MS002</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:149px;">T02</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:127px;">30</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:34px;padding:0cm 7px;width:130px;">15/12/2008</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:100px;">MS003</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:149px;">T01</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:127px;">25</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;height:30px;padding:0cm 7px;width:130px;">20/12/2008</td></tr><tr><td style="border-bottom:1px solid black;border-left:1px solid black;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:100px;">MS004</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:149px;">T01</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:127px;">30</td><td style="border-bottom:1px solid black;border-left-style:none;border-right:1px solid black;border-top-style:none;padding:0cm 7px;width:130px;">08/12/2008</td></tr></tbody></table></figure><p><strong>Câu 1:</strong> Em hãy chọn khóa chính cho mỗi bảng trong cơ sở dữ liệu trên và giải thích lí do lựa chọn đó.<br /><strong>Câu2:</strong> Em hãy chỉ ra mối liên kết cần thiết giữa ba bảng<br /><strong>Câu3:</strong> Hãy làm các việc sau:<br />+ Tạo lập cơ sở dữ liệu nói trên và lưu lưu với tên <strong>TOURDULICH</strong> trong thư mục KIEM TRA trong ổ đĩa D:<br />+ Tạo mẫu hỏi với tên: CHIPHIDULICH gồm các trưởng sau: HO_TEN; DIA_CHI; TOUR; DON_GIA<br />SO_LUONG; THANH_TIEN (THANH TIEN – SO LUONG * DON GIA) và dữ liệu được sắp xếp trên trường DON_GIA theo chiều từ cao đến thấp.<br />+ Tạo báo cáo với tiêu đề BANGTHANHTOANCHIPHIDULICH gồm các trường trong mẫu hỏi.<br /><strong>Bài làm:</strong><br /><strong>Câu 1:</strong> Bảng KHACHHANG: Khóa chính là trường MA_KH vì nó định danh duy nhất mỗi khách hàng trong hệ thống.<br />Bảng TOUR DU LỊCH: Khóa chính là trường MA_TOUR vì nó định danh duy nhất mỗi tour du lịch trong hệ thống.<br />Bảng ĐẶT HÀNG: Khóa chính là sự kết hợp giữa MA_KH và MA_TOUR vì mỗi đặt hàng cần phải liên kết với một khách hàng cụ thể và một tour du lịch cụ thể.<br /><strong>Câu 2:</strong> Bảng ĐẶT HÀNG có mối liên kết với bảng KHACHHANG thông qua trường MA_KH.<br />Bảng ĐẶT HÀNG cũng có mối liên kết với bảng TOUR DU LỊCH thông qua trường MA_TOUR.<br /><strong>Câu 3: </strong>Sử dụng câu lệnh SQL<br /><i><strong>Bước 1.</strong></i> <i><strong>Tạo cơ sở dữ liệu và các bảng</strong></i><br />CREATE DATABASE DBDULICH;<br />USE DBDULICH;<br />CREATE TABLE KHACHHANG (<br />&nbsp;&nbsp;&nbsp; MA_KH CHAR(5) PRIMARY KEY,<br />&nbsp;&nbsp;&nbsp; HO_TEN VARCHAR(50),<br />&nbsp;&nbsp;&nbsp; DIA_CHI VARCHAR(100),<br />&nbsp;&nbsp;&nbsp; SO_DT VARCHAR(20));<br />CREATE TABLE TOUR_DU_LICH (<br />&nbsp;&nbsp;&nbsp; MA_TOUR CHAR(3) PRIMARY KEY,<br />&nbsp;&nbsp;&nbsp; TOUR VARCHAR(50),<br />&nbsp;&nbsp;&nbsp; DON_GIA INT);<br />CREATE TABLE DAT_HANG (<br />&nbsp;&nbsp;&nbsp; MA_KH CHAR(5),<br />&nbsp;&nbsp;&nbsp; MA_TOUR CHAR(3),<br />&nbsp;&nbsp;&nbsp; SO_LUONG INT,<br />&nbsp;&nbsp;&nbsp; NGAY_DI DATE,<br />&nbsp;&nbsp;&nbsp; PRIMARY KEY (MA_KH, MA_TOUR),<br />&nbsp;&nbsp;&nbsp; FOREIGN KEY (MA_KH) REFERENCES KHACHHANG(MA_KH),<br />&nbsp;&nbsp;&nbsp; FOREIGN KEY (MA_TOUR) REFERENCES TOUR_DU_LICH(MA_TOUR));<br /><i><strong>2. Đưa dữ liệu vào các bảng</strong></i><br />INSERT INTO KHACHHANG (MA_KH, HO_TEN, DIA_CHI, SO_DT) VALUES<br />(&#039;MS001&#039;, &#039;Lý Anh Du&#039;, &#039;Mỹ Xuyên&#039;, &#039;076845777&#039;),<br />(&#039;MS002&#039;, &#039;Hoàng Nam Lịch&#039;, &#039;My Long&#039;, &#039;076845888&#039;),<br />(&#039;MS003&#039;, &#039;Lê Đức An&#039;, &#039;My Long&#039;, &#039;076845999&#039;),<br />(&#039;MS004&#039;, &#039;Tử Văn Giang&#039;, &#039;Mỹ Bình&#039;, &#039;076845000&#039;);<br />INSERT INTO TOUR_DU_LICH (MA_TOUR, TOUR, DON_GIA) VALUES<br />(&#039;T01&#039;, &#039;Hà Nội&#039;, 700000),<br />(&#039;T02&#039;, &#039;Huế&#039;, 500000),<br />(&#039;T03&#039;, &#039;Nha Trang&#039;, 350000);<br />INSERT INTO DAT_HANG (MA_KH, MA_TOUR, SO_LUONG, NGAY_DI) VALUES<br />(&#039;MS001&#039;, &#039;T03&#039;, 20, &#039;2008-11-20&#039;),<br />(&#039;MS002&#039;, &#039;T02&#039;, 30, &#039;2008-12-15&#039;),<br />(&#039;MS003&#039;, &#039;T01&#039;, 25, &#039;2008-12-20&#039;),<br />(&#039;MS004&#039;, &#039;T01&#039;, 30, &#039;2008-12-08&#039;);<br /><i><strong>Bước 3. Tạo view CHIPHIDULICH</strong></i><br />Lệnh SQL:<br />SELECT KHACHHANG.HO_TEN, KHACHHANG.DIA_CHI, TOURDULICH.TOUR, TOURDULICH.DON_GIA, DATHANG.SO_LUONG, &#91;DON_GIA&#93;*&#91;SO_LUONG&#93; AS THANHTIEN<br />FROM TOURDULICH INNER JOIN (KHACHHANG INNER JOIN DATHANG ON KHACHHANG.MA_KH = DATHANG.MA_KH) ON TOURDULICH.MA_TOUR = DATHANG.MA_TOUR ORDER BY TOURDULICH.DON_GIA DESC;<br />Sơ đồ thiết kế:<br /><img src="https://i.imgur.com/28Xl2ou.png" alt="" /><br />Kết quả:&nbsp;<br /><img src="https://i.imgur.com/7658CpZ.png" alt="" /><br />Bước 4. Report Bảng thanh toán chi phí du lịch.<br />- Thiết kế:<br /><img src="https://i.imgur.com/cVHluOI.png" alt="" /><br />+ Cột TT chọn Data Control Source =1<br /><img src="https://i.imgur.com/Bm8Jh03.png" alt="" /><br />- Kết quả:<br /><img src="https://i.imgur.com/bpsbGPh.png" alt="" /><br />Cần file Cơ sở dữ liệu&nbsp;Access (liên hệ với tác giả)</p>
		</div>
				<div id="author">
						<p>
				<strong>Tác giả:</strong>
				<a href="https://dataonline.io.vn/author/Vang-Van-Quyn-4/">Vàng Văn Quyn</a>
			</p>
		</div>
				<div class="copyright">
			Chú ý: Việc đăng lại bài viết trên ở website hoặc các phương tiện truyền thông khác mà không ghi rõ nguồn<strong> <a href="https://365.info.vn" target="_blank">https://365.io.vn</a>&nbsp;</strong>là vi phạm bản quyền
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://365.io.vn/savefile/co-so-du-lieu/bai-1-csdl-tour-du-lich-410.html" title="Bài 1. CSDL Tour du lịch">https://365.io.vn/savefile/co-so-du-lieu/bai-1-csdl-tour-du-lich-410.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; DATAONLINE.IO.VN
		</div>
		<div id="contact">
			<a href="mailto:support@dataonline.io.vn">support@dataonline.io.vn</a>
		</div>
	</div>
</div>
        <div class="cookie-notice"><div><button onclick="cookie_notice_hide();">&times;</button>Chúng tôi đang sử dụng cookie để cung cấp cho bạn những trải nghiệm tốt nhất trên trang web này. Bằng cách tiếp tục truy cập, bạn đồng ý với <a href="https://dataonline.io.vn/siteterms/privacy.html">Chính sách thu thập và sử dụng cookie</a> của chúng tôi.</div></div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://dataonline.io.vn/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
<div id="run_cronjobs" style="visibility:hidden;display:none;"><img alt="cron" src="/index.php?second=cronjobs&amp;p=n1ABdio3" width="1" height="1" /></div>
<script src="https://dataonline.io.vn/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://dataonline.io.vn/assets/js/language/vi.js"></script>
<script src="https://dataonline.io.vn/assets/js/DOMPurify/purify3.js"></script>
<script src="https://dataonline.io.vn/assets/js/global.js"></script>
<script src="https://dataonline.io.vn/assets/js/site.js"></script>
<script src="https://dataonline.io.vn/themes/default/js/news.js"></script>
<script src="https://dataonline.io.vn/themes/default/js/main.js"></script>
<script src="https://dataonline.io.vn/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://dataonline.io.vn",
            "logo": "https://dataonline.io.vn/assets/images/logo.svg"
        }
        </script>
<script src="https://dataonline.io.vn/themes/default/js/bootstrap.min.js">
        </script>
<script>
    var LIMIT = 600000; // 10 phút

    var startTime = sessionStorage.getItem("redirect_timer");
    if (!startTime) {
        startTime = Date.now();
        sessionStorage.setItem("redirect_timer", startTime);
    } else {
        startTime = parseInt(startTime, 10);
    }

    var elapsed = Date.now() - startTime;
    var remain = LIMIT - elapsed;

    if (remain > 0) {
        setTimeout(function () {
            alert("Hệ thống sẽ chuyển sang trang chấm bài.");
            window.location.replace("https://vnoj.io.vn");
        }, remain);
    } else {
        window.location.replace("https://vnoj.io.vn");
    }
</script>
</body>
</html>