AI ์ด์ „์‹œ๋Œ€ (↓์„๊ธฐ์‹œ๋Œ€ IT)/03. SQL

[๊ณต์œ ] exErd ํ…Œ์ด๋ธ”/์ธ๋ฑ์Šค/๊ด€๊ณ„์ •์˜์„œ ๋™์‹œ์ถœ๋ ฅ ๋ฐฉ๋ฒ•

๐Ÿ“ฆ DonzBox 2016. 3. 10. 17:20



exErd ํ…Œ์ด๋ธ” ์ •์˜์„œ ํ…œํ”Œ๋ฆฟ ํŒŒ์ผ๊ณต์œ 

\ํ…Œ์ด๋ธ”์ •์˜์„œ\์ธ๋ฑ์Šค์ •์˜์„œ\๊ด€๊ณ„์ •์˜์„œ ๋™์‹œ ์ถœ๋ ฅ


๊ด€๋ จํŒŒ์ผ์„ ์ฐพ๋‹ค์ฐพ๋‹ค ์—†์–ด์„œ ๋งŒ๋“ค์–ด๋ณด์•˜์Šต๋‹ˆ๋‹ค(by Donz) ์‹œ๊ฐ„๋‚ญ๋น„ํ–ˆ์Œ


์‚ฌ์šฉ๋ฐฉ๋ฒ•

eclipse exErdํ”Œ๋Ÿฌ๊ทธ์ธ ์„ค์น˜ -> eXERD ๋ฉ”๋‰ด -> ๋‚ด๋ณด๋‚ด๊ธฐ -> ํ…œํ”Œ๋ฆฟ -> ์ขŒ์ƒ๋‹จ ํด๋”๋ชจ์–‘ -> ํŒŒ์ผ์„ ํƒ -> ํ™•์ธ -> ์ดํ›„์‹คํ–‰



์ถœ๋ ฅ์˜ˆ์ œ)


1717. ๊ฒŒ์‹œํŒ๋Œ“๊ธ€ (TB_BOARD_CMMNT)โ€ป ๊ฒŒ์‹œํŒ๋Œ“๊ธ€ ๊ด€๋ จ ํ…Œ์ด๋ธ”
๋ฒˆํ˜ธ์ปฌ๋Ÿผ๋ช…์†์„ฑ๋ช…๋„๋ฉ”์ธ๋ฐ์ดํ„ฐํƒ€์ž…NULL์—ฌ๋ถ€๊ธฐ๋ณธ๊ฐ’KEY
1SEQ๊ธ€๋ฒˆํ˜ธN/ANUMBER(11)Not NullPFK
2CMMNT_SEQ๋Œ“๊ธ€์ˆœ์„œN/ANUMBER(5)Not NullPK
3PTNR_ID(CO)ํŒŒํŠธ๋„ˆIDN/AVARCHAR(20)Not NullPFK
4CMMNT_CONT๋Œ“๊ธ€๋‚ด์šฉN/AVARCHAR2(4000)
5USR_ID์‚ฌ์šฉ์ž์•„์ด๋””N/AVARCHAR2(20)
6USR_IP์‚ฌ์šฉ์ž์•„์ดํ”ผN/AVARCHAR2(50)
7USR_PWD์‚ฌ์šฉ์ž๋น„๋ฐ€๋ฒˆํ˜ธN/AVARCHAR(255)
8DEL_YN์‚ญ์ œ์—ฌ๋ถ€N/ACHAR(1)
9CRE_DTIME์ƒ์„ฑ์ผ์žN/ADATE
10UPD_DTIME์ˆ˜์ •์ผ์žN/ADATE
11CRE_ID์ƒ์„ฑ์•„์ด๋””N/AVARCHAR2(20)
12UPD_ID์ˆ˜์ •์•„์ด๋””N/AVARCHAR2(20)
์ธ๋ฑ์Šค๋ช…UIX_TB_BOARD_CMMNT์œ ํ˜•UNIQUE๊ตฌ๋ถ„INDEX
์†์„ฑ๋ช…์ปฌ๋Ÿผ๋ช…๋ฐ์ดํ„ฐ ํƒ€์ž…์ •๋ ฌ
๋Œ“๊ธ€์ˆœ์„œCMMNT_SEQNUMBER(5)ASC
์ธ๋ฑ์Šค๋ช…PK_TB_BOARD_CMMNT์œ ํ˜•UNIQUE๊ตฌ๋ถ„PK
์†์„ฑ๋ช…์ปฌ๋Ÿผ๋ช…๋ฐ์ดํ„ฐ ํƒ€์ž…์ •๋ ฌ
๊ธ€๋ฒˆํ˜ธSEQNUMBER(11)ASC
๋Œ“๊ธ€์ˆœ์„œCMMNT_SEQNUMBER(5)ASC
(CO)ํŒŒํŠธ๋„ˆIDPTNR_IDVARCHAR(20)ASC
๊ด€๊ณ„๋ช…FK_TB_BOARD_TO_TB_BOARD_CMMNT๋ถ€๋ชจ ํ…Œ์ด๋ธ”TB_BOARD์ž์‹ ํ…Œ์ด๋ธ”TB_BOARD_CMMNT
์‹๋ณ„ ์œ ํ˜•์‹๋ณ„๋ถ€๋ชจ ์ฐจ์ˆ˜EXACTLY_ONE์ž์‹ ์ฐจ์ˆ˜ZERO_OR_MORE
๋ถ€๋ชจ ์ปฌ๋Ÿผ์ž์‹ ์ปฌ๋Ÿผ๋ฐ์ดํ„ฐ ํƒ€์ž…
SEQSEQNUMBER(11)
PTNR_IDPTNR_IDVARCHAR(20)



ํ…œํ”Œ๋ฆฟ ์ฝ”๋“œ

@begin-doc

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>ํ…Œ์ด๋ธ” ์ •์˜์„œ(HTML)</title>

<style type="text/css">

<!--

.border0{

width: 1024px;

page-break-before: always;

border: solid 0px white;

}


.entity{

width: 1024px;

margin-bottom: 10px;

page-break-before: always;

}


.entity-header tr td, .entity-header tr th{

text-align: left;

padding-left: 5px;

padding-right: 5px;

vertical-align: top;

}


.entity-header{

border-spacing: 0px;

border-top: solid 2px black;

border-bottom: solid 2px black;

margin:0px;

}


.column-list{

width: 100%;

border-spacing: 0px;

margin: 0px;

border-bottom: solid 2px black;

}


.column-list th{

border-bottom: solid 2px black;

border-top: solid 2px black;

text-align: left;

}


.column-list th, .column-list td{

padding-left: 5px;

padding-right: 5px;

vertical-align: top;

}


.under-line{

border-bottom: solid 1px gray;

}


.right-line{

border-right: solid 1px gray;

}


.left-line{

border-left: solid 1px gray;

}


th{

background-color: #eee;

}




.root {

border-spacing: 0px;

width: 1024px;

}


.under-line {

border-bottom: solid 1px gray;

}


.right-line {

border-right: solid 1px gray;

}


.left-line {

border-left: solid 1px gray;

}


th {

background-color: #eee;

}


.header {

margin-bottom: 0px;

}


.footter {

margin-top: 0px;

margin-bottom: 10px;

border-bottom:solid 2px black;

}


tr.only-first-row td,tr.only-first-row th {

border-top: solid 2px black;

}


tr.first-row td,tr.first-row th {

border-top: solid 2px black;

border-bottom: solid 2px black;

}

tr.last-row td,tr.last-row th {

border-bottom: solid 2px black;

}

-->

</style>

<script type="text/javascript">

var cnt = 1;

</script>

</head>

<body>

<table class="entity" cellpadding="0" cellspacing="0">

<tr>

<td>

<table width="100%" class="entity-header">

<tr>

<th class="under-line right-line" width="70px">์ž‘์„ฑ์ผ</th>

<td class="under-line">2016/03/10</td>

</tr>

<tr>

<th class="under-line right-line">์ž‘์„ฑ์ž</th>

<td class="under-line">Donz</td>

</tr>

</table>

</td>

</tr>

</table>

<p>

${loop:schema}

</body>

</html>

@end-doc



@begin-schema

${loop:table(index)}

@end-schema


@begin-table

<table class="border0" cellpadding="0" cellspacing="0">

<tr>

<td><font size="5"><b><script type="text/javascript">document.write(cnt++);</script>. ${logicalName} (${physicalName})</b></font></td>

<td align="right"><font size="3">โ€ป ${comment} ๊ด€๋ จ ํ…Œ์ด๋ธ”</font></td>

</tr>

</table>

<br>

<table class="entity" cellpadding="0" cellspacing="0">

<tr>

<td>

<table class="column-list">

<tr>

<th class="right-line" width="40px">๋ฒˆํ˜ธ</th>

<th class="right-line">์ปฌ๋Ÿผ๋ช…</th>

<th class="right-line">์†์„ฑ๋ช…</th>

<th class="right-line">๋„๋ฉ”์ธ</th>

<th class="right-line">๋ฐ์ดํ„ฐํƒ€์ž…</th>

<th class="right-line">NULL์—ฌ๋ถ€</th>

<th class="right-line">๊ธฐ๋ณธ๊ฐ’</th>

<th>KEY</th>

</tr>

${loop:column}

</table>

</td>

</tr>

</table>

${loop:index}

${loop:foreignkey}

<br><br><br><br>

@end-table



@begin-column

<tr>

<td class="right-line" style="text-align:right;">${columnOrder}</td>

<td class="right-line">${physicalName}</td>

<td class="right-line">${logicalName}</td>

<td class="right-line">${domain}</td>

<td class="right-line">${dataType}</td>

<td class="right-line">${notNull}</td>

<td class="right-line">${defaultValue}</td>

<td>${pfk}</td>

</tr>

@end-column






@begin-index

<table class="root header">

<tr class="first-row">

<th class="right-line">์ธ๋ฑ์Šค๋ช…</th>

<td class="right-line">${physicalName}</td>

<th class="right-line">์œ ํ˜•</th>

<td class="right-line">${uniqueness}</td>

<th class="right-line">๊ตฌ๋ถ„</th>

<td>${kind}</td>

</tr>

</table>

<table class="root footter">

<tr>

<th class="right-line under-line">์†์„ฑ๋ช…</th>

<th class="right-line under-line">์ปฌ๋Ÿผ๋ช…</th>

<th class="right-line under-line">๋ฐ์ดํ„ฐ ํƒ€์ž…</th>

<th class="under-line">์ •๋ ฌ</th>

</tr>

${loop:index-column}

</table>

@end-index



@begin-index-column

<tr>

<td class="right-line">${logicalName}</td>

<td class="right-line">${physicalName}</td>

<td class="right-line">${dataType}</td>

<td>${sortDirection}</td>

</tr>

@end-index-column






@begin-foreignkey

<table class="root header">

<tr class="only-first-row">

<th class="right-line under-line">๊ด€๊ณ„๋ช…</th>

<td class="right-line under-line"">${physicalName}</td>

<th class="right-line under-line"" >๋ถ€๋ชจ ํ…Œ์ด๋ธ”</th>

<td class="under-line right-line">${parentTable.physicalName}</td>

<th class="right-line under-line"" >์ž์‹ ํ…Œ์ด๋ธ”</th>

<td class="under-line">${parent.physicalName}</td>

</tr

<tr class="last-row">

<th class="right-line">์‹๋ณ„ ์œ ํ˜•</th>

<td class="right-line">${identifyKind}</td>

<th class="right-line">๋ถ€๋ชจ ์ฐจ์ˆ˜</th>

<td class="right-line">${parentTable.cardinality}</td>

<th class="right-line">์ž์‹ ์ฐจ์ˆ˜</th>

<td>${childTable.cardinality}</td>

</tr>

</table>


<table class="root footter">

<tr>

<th class="right-line under-line">๋ถ€๋ชจ ์ปฌ๋Ÿผ</th>

<th class="right-line under-line">์ž์‹ ์ปฌ๋Ÿผ</th>

<th class="under-line">๋ฐ์ดํ„ฐ ํƒ€์ž…</th>

</tr>

${loop:foreignkey-column}

</table>

@end-foreignkey


@begin-foreignkey-column

<tr>

<td class="right-line">${parentColumn.physicalName}</td>

<td class="right-line">${physicalName}</td>

<td>${dataType}</td>

</tr>

@end-foreignkey-column