TMUL@2009 健康科學核心資料庫與網站 Core Databases & Websites 邱子恆 2010.04.20.
資料庫設計與教學
description
Transcript of 資料庫設計與教學
-
*2015/10/15
John
Enterprise Logisticsand E-Business Center
SQL
*
-
*
Enterprise Logisticsand E-Business Center
Data RowData Table
*
Enterprise Logisticsand E-Business Center
(primary key), *
A1234567TinaFemaleNTHUF1234567TomMaleNCTUA1122334JaneFemaleNTU
Enterprise Logisticsand E-Business Center
-
(Cardinality)3 1 2 3
*
Enterprise Logisticsand E-Business Center
Example-(,,)
(,,)
*!
Enterprise Logisticsand E-Business Center
(,,,)
(,,)
*
Enterprise Logisticsand E-Business Center
(,,)
(,,,,)
*
Enterprise Logisticsand E-Business Center
(,,)
(,,,,) *
-
*
Enterprise Logisticsand E-Business Center
(Normalization)
*
Enterprise Logisticsand E-Business Center
*
0001A01P01150001A01P02120002B01P01150002B01P03150003C01P04100003C01P05200004B02P02120005A02P03150005A02P0410
Enterprise Logisticsand E-Business Center
(null)
*
0001A01P01150001A01P02120002B01P01150002B01P03150003C01P04100003C01P05200004B02P02120005A02P03150005A02P04100006B02nullnullnull
Enterprise Logisticsand E-Business Center
*
0001A01P01150001A01P02120002B01P01150002B01P03150003C01P04100003C01P05200004B02P02120005A02P03150005A02P0410
Enterprise Logisticsand E-Business Center
*
0001A01P01150001A01P02120002B01P01150002B01P03150003C01P04100003C01P05200004B02P02120005A02P03150005A02P0410
Enterprise Logisticsand E-Business Center
(Normalization)
:
*
Enterprise Logisticsand E-Business Center
:
*
11234FirstTomJohn25678SecondMaryJane
Enterprise Logisticsand E-Business Center
*
11234FirstJohn
11234FirstTom25678SecondMary
25678SecondJane
Enterprise Logisticsand E-Business Center
:key(primary key) key(primary key)table22(primary key)table(primary key)1
*
Enterprise Logisticsand E-Business Center
*(){} {}(){} {}(){} {}key{} a non-key column is dependent on a component of the primary key
Enterprise Logisticsand E-Business Center
*{} {}{} {}{} {}
Enterprise Logisticsand E-Business Center
:(primary key)
(primary key)
(,,)
(,,)
*
Enterprise Logisticsand E-Business Center
(,,)
(,)
(,)
*
-
*SQL
Enterprise Logisticsand E-Business Center
SQLSQL: Structured Query LanguageSQL SQL SELECT SQL(Microsoft Visual Basic / Microsoft Access Jet database engine)
*
Enterprise Logisticsand E-Business Center
SQL
(DDLData Definition Language) (DMLData Manipulation Language) (DQLData Query Language) (DCLData Control Language)
*
Enterprise Logisticsand E-Business Center
SQL Server with ToolsWindows XPSQL Server 2008 R2 1Microsoft .Net Framework 3.5 SP1 2Windows Installer 4.5 3Windows PowerShell 1.0Express
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*SQL Express
Enterprise Logisticsand E-Business Center
*SQLNT_AUTHORITY\SYSTEM
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
ClientSQL Server 2008 R2SQL Server
*
Enterprise Logisticsand E-Business Center
SQL ServerSQLEXPRESSTCP/IPTCP/IP
*
Enterprise Logisticsand E-Business Center
IPIPAllTCP1433 *
Enterprise Logisticsand E-Business Center
SQL ServerSQL Server (SQLEXPRESS)SQL Server *
-
Enterprise Logisticsand E-Business Center
SQL
Enterprise Logisticsand E-Business Center
Enterprise Logisticsand E-Business Center
SQL
Enterprise Logisticsand E-Business Center
* ()Nullnvarchar(MAX)keynvarchar(50)
Enterprise Logisticsand E-Business Center
(Numeric Data) SQL integer, float, moneySUM()() (Character & Strings Data) / (Date Data) / date, time, timestamp
*
Enterprise Logisticsand E-Business Center
(Boolean Data) true/false, Yes/No, 1/0 (NULL Data) *
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
*
Enterprise Logisticsand E-Business Center
ER Model *
-
Q&A Time
**Data Table
Data RowDataTable***
***
*** [] *tablekey=?? key=key=table2keykey=()
() ()
() keykey*non-key column is dependent on a component of the primary keykeykey*(Transitivity) AB BC AC
(Partial Functional Dependence): XY H X ( H X ) HY Y X Y X**True False1 01 True0 False*