Debian Codegraph @

www/syntax/table-constraint.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta name="viewport" content="width=device-width, initial-scale=1.0">
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 <link href="../sqlite.css" rel="stylesheet">
6 <title>SQLite Syntax: table-constraint</title>
7 <!-- path=../ -->
8 </head>
9 <body>
10 <div class=nosearch>
11 <a href="../index.html">
12 <img class="logo" src="../images/sqlite370_banner.gif" alt="SQLite" border="0">
13 </a>
14 <div><!-- IE hack to prevent disappearing logo --></div>
15 <div class="tagline desktoponly">
16 Small. Fast. Reliable.<br>Choose any three.
17 </div>
18 <div class="menu mainmenu">
19 <ul>
20 <li><a href="../index.html">Home</a>
21 <li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a>
22 <li class='wideonly'><a href='../about.html'>About</a>
23 <li class='desktoponly'><a href="../docs.html">Documentation</a>
24 <li class='desktoponly'><a href="../download.html">Download</a>
25 <li class='wideonly'><a href='../copyright.html'>License</a>
26 <li class='desktoponly'><a href="../support.html">Support</a>
27 <li class='desktoponly'><a href="../prosupport.html">Purchase</a>
28 <li class='search' id='search_menubutton'>
29 <a href="javascript:void(0)" onclick='toggle_search()'>Search</a>
30 </ul>
31 </div>
32 <div class="menu submenu" id="submenu">
33 <ul>
34 <li><a href='../about.html'>About</a>
35 <li><a href='../docs.html'>Documentation</a>
36 <li><a href='../download.html'>Download</a>
37 <li><a href='../support.html'>Support</a>
38 <li><a href='../prosupport.html'>Purchase</a>
39 </ul>
40 </div>
41 <div class="searchmenu" id="searchmenu">
42 <form method="GET" action="../search">
43 <select name="s" id="searchtype">
44 <option value="d">Search Documentation</option>
45 <option value="c">Search Changelog</option>
46 </select>
47 <input type="text" name="q" id="searchbox" value="">
48 <input type="submit" value="Go">
49 </form>
50 </div>
51 </div>
52 <script>
53 function toggle_div(nm) {
54 var w = document.getElementById(nm);
55 if( w.style.display=="block" ){
56 w.style.display = "none";
57 }else{
58 w.style.display = "block";
59 }
60 }
61 function toggle_search() {
62 var w = document.getElementById("searchmenu");
63 if( w.style.display=="block" ){
64 w.style.display = "none";
65 } else {
66 w.style.display = "block";
67 setTimeout(function(){
68 document.getElementById("searchbox").focus()
69 }, 30);
70 }
71 }
72 function div_off(nm){document.getElementById(nm).style.display="none";}
73 window.onbeforeunload = function(e){div_off("submenu");}
74 /* Disable the Search feature if we are not operating from CGI, since */
75 /* Search is accomplished using CGI and will not work without it. */
76 if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){
77 document.getElementById("search_menubutton").style.display = "none";
78 }
79 /* Used by the Hide/Show button beside syntax diagrams, to toggle the */
80 function hideorshow(btn,obj){
81 var x = document.getElementById(obj);
82 var b = document.getElementById(btn);
83 if( x.style.display!='none' ){
84 x.style.display = 'none';
85 b.innerHTML='show';
86 }else{
87 x.style.display = '';
88 b.innerHTML='hide';
89 }
90 return false;
91 }
92 var antiRobot = 0;
93 function antiRobotGo(){
94 if( antiRobot!=3 ) return;
95 antiRobot = 7;
96 var j = document.getElementById("mtimelink");
97 if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
98 }
99 function antiRobotDefense(){
100 document.body.onmousedown=function(){
101 antiRobot |= 2;
102 antiRobotGo();
103 document.body.onmousedown=null;
104 }
105 document.body.onmousemove=function(){
106 antiRobot |= 2;
107 antiRobotGo();
108 document.body.onmousemove=null;
109 }
110 setTimeout(function(){
111 antiRobot |= 1;
112 antiRobotGo();
113 }, 100)
114 antiRobotGo();
115 }
116 antiRobotDefense();
117 </script>
118 <h1 align='center'>table-constraint</h1>
119 <div class='imgcontainer'>
120 <div style="max-width:751px"><svg xmlns='http://www.w3.org/2000/svg' class="pikchr" viewBox="0 0 751.325 261.36">
121 <circle cx="5" cy="17" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
122 <polygon points="45,17 33,21 33,12" style="fill:rgb(0,0,0)"/>
123 <path d="M9,17L39,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
124 <path d="M60,32L160,32A15 15 0 0 0 175 17A15 15 0 0 0 160 2L60,2A15 15 0 0 0 45 17A15 15 0 0 0 60 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
125 <text x="110" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">CONSTRAINT</text>
126 <polygon points="198,17 187,21 187,12" style="fill:rgb(0,0,0)"/>
127 <path d="M175,17L192,17" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
128 <path d="M213,32L240,32A15 15 0 0 0 256 17A15 15 0 0 0 240 2L213,2A15 15 0 0 0 198 17A15 15 0 0 0 213 32Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
129 <text x="227" y="17" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">name</text>
130 <path d="M60,108L123,108A15 15 0 0 0 138 92A15 15 0 0 0 123 77L60,77A15 15 0 0 0 45 92A15 15 0 0 0 60 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
131 <text x="91" y="92" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">PRIMARY</text>
132 <polygon points="161,92 149,97 149,88" style="fill:rgb(0,0,0)"/>
133 <path d="M138,92L155,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
134 <path d="M176,108L192,108A15 15 0 0 0 208 92A15 15 0 0 0 192 77L176,77A15 15 0 0 0 161 92A15 15 0 0 0 176 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
135 <text x="184" y="92" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">KEY</text>
136 <polygon points="244,92 232,97 232,88" style="fill:rgb(0,0,0)"/>
137 <path d="M208,92L238,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
138 <path d="M259,108A15 15 0 0 0 274 92A15 15 0 0 0 259 77A15 15 0 0 0 244 92A15 15 0 0 0 259 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
139 <text x="259" y="92" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text>
140 <polygon points="310,92 298,97 298,88" style="fill:rgb(0,0,0)"/>
141 <path d="M274,92L304,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
142 <path d="M310,108L454,108L454,77L310,77Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
143 <text x="382" y="92" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">indexed-column</text>
144 <polygon points="490,92 479,97 479,88" style="fill:rgb(0,0,0)"/>
145 <path d="M454,92L485,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
146 <path d="M505,108A15 15 0 0 0 521 92A15 15 0 0 0 505 77A15 15 0 0 0 490 92A15 15 0 0 0 505 108Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
147 <text x="505" y="92" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text>
148 <polygon points="544,92 532,97 532,88" style="fill:rgb(0,0,0)"/>
149 <path d="M521,92L538,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
150 <path d="M544,108L677,108L677,77L544,77Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
151 <text x="610" y="92" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">conflict-clause</text>
152 <polygon points="700,92 688,97 688,88" style="fill:rgb(0,0,0)"/>
153 <path d="M677,92L694,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
154 <polygon points="741,92 730,97 730,88" style="fill:rgb(0,0,0)"/>
155 <path d="M700,92L736,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
156 <circle cx="745" cy="92" r="3.6" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
157 <polygon points="45,92 33,97 33,88" style="fill:rgb(0,0,0)"/>
158 <path d="M9,17 L 16,17 Q 24,17 24,32 L 24,77 Q 24,92 31,92 L 39,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
159 <polygon points="110,55 122,50 122,59" style="fill:rgb(0,0,0)"/>
160 <path d="M256,17 L 263,17 Q 271,17 271,32 L 271,40 Q 271,55 256,55 L 131,55 L 116,55" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
161 <path d="M110,55 L 39,55 Q 24,55 24,62 L 24,70" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
162 <path d="M382,145A15 15 0 0 0 397 130A15 15 0 0 0 382 115A15 15 0 0 0 367 130A15 15 0 0 0 382 145Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
163 <text x="382" y="130" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
164 <polygon points="397,130 409,126 409,135" style="fill:rgb(0,0,0)"/>
165 <path d="M454,92 L 462,92 Q 469,92 469,107 L 469,115 Q 469,130 454,130 L 418,130 L 403,130" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
166 <path d="M367,130 L 298,130 Q 283,130 283,115 L 283,107 Q 283,92 291,92 L 298,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
167 <path d="M60,145L115,145A15 15 0 0 0 130 130A15 15 0 0 0 115 115L60,115A15 15 0 0 0 45 130A15 15 0 0 0 60 145Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
168 <text x="87" y="130" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">UNIQUE</text>
169 <path d="M130,130 L 208,130 Q 223,130 223,115 L 223,107 Q 223,92 230,92 L 238,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
170 <polygon points="45,130 33,135 33,126" style="fill:rgb(0,0,0)"/>
171 <path d="M24,77 L 24,115 Q 24,130 31,130 L 39,130" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
172 <path d="M60,183L105,183A15 15 0 0 0 121 168A15 15 0 0 0 105 153L60,153A15 15 0 0 0 45 168A15 15 0 0 0 60 183Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
173 <text x="83" y="168" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">CHECK</text>
174 <polygon points="144,168 132,172 132,164" style="fill:rgb(0,0,0)"/>
175 <path d="M121,168L138,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
176 <path d="M159,183A15 15 0 0 0 174 168A15 15 0 0 0 159 153A15 15 0 0 0 144 168A15 15 0 0 0 159 183Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
177 <text x="159" y="168" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text>
178 <polygon points="197,168 185,172 185,164" style="fill:rgb(0,0,0)"/>
179 <path d="M174,168L191,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
180 <path d="M197,183L246,183L246,153L197,153Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
181 <text x="221" y="168" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">expr</text>
182 <polygon points="269,168 258,172 258,164" style="fill:rgb(0,0,0)"/>
183 <path d="M246,168L263,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
184 <path d="M284,183L284,183A15 15 0 0 0 299 168A15 15 0 0 0 284 153L284,153A15 15 0 0 0 269 168A15 15 0 0 0 284 183Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
185 <text x="284" y="168" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text>
186 <polygon points="700,168 688,172 688,164" style="fill:rgb(0,0,0)"/>
187 <path d="M299,168L694,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
188 <path d="M700,168 L 707,168 Q 715,168 715,153 L 715,107 Q 715,92 722,92 L 730,92" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
189 <polygon points="45,168 33,172 33,164" style="fill:rgb(0,0,0)"/>
190 <path d="M24,115 L 24,153 Q 24,168 31,168 L 39,168" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
191 <path d="M60,221L123,221A15 15 0 0 0 139 206A15 15 0 0 0 123 191L60,191A15 15 0 0 0 45 206A15 15 0 0 0 60 221Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
192 <text x="92" y="206" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">FOREIGN</text>
193 <polygon points="162,206 150,210 150,201" style="fill:rgb(0,0,0)"/>
194 <path d="M139,206L156,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
195 <path d="M177,221L193,221A15 15 0 0 0 208 206A15 15 0 0 0 193 191L177,191A15 15 0 0 0 162 206A15 15 0 0 0 177 221Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
196 <text x="185" y="206" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">KEY</text>
197 <polygon points="231,206 220,210 220,201" style="fill:rgb(0,0,0)"/>
198 <path d="M208,206L225,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
199 <path d="M246,221A15 15 0 0 0 261 206A15 15 0 0 0 246 191A15 15 0 0 0 231 206A15 15 0 0 0 246 221Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
200 <text x="246" y="206" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">(</text>
201 <polygon points="297,206 286,210 286,201" style="fill:rgb(0,0,0)"/>
202 <path d="M261,206L292,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
203 <path d="M313,221L407,221A15 15 0 0 0 422 206A15 15 0 0 0 407 191L313,191A15 15 0 0 0 297 206A15 15 0 0 0 313 221Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
204 <text x="360" y="206" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">column-name</text>
205 <polygon points="458,206 446,210 446,201" style="fill:rgb(0,0,0)"/>
206 <path d="M422,206L452,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
207 <path d="M473,221A15 15 0 0 0 488 206A15 15 0 0 0 473 191A15 15 0 0 0 458 206A15 15 0 0 0 473 221Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
208 <text x="473" y="206" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">)</text>
209 <polygon points="511,206 500,210 500,201" style="fill:rgb(0,0,0)"/>
210 <path d="M488,206L505,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
211 <path d="M511,221L677,221L677,191L511,191Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
212 <text x="594" y="206" text-anchor="middle" fill="rgb(0,0,0)" dominant-baseline="central">foreign-key-clause</text>
213 <polygon points="700,206 688,210 688,201" style="fill:rgb(0,0,0)"/>
214 <path d="M677,206L694,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
215 <path d="M700,206 L 707,206 Q 715,206 715,191 L 715,168 L 715,153" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
216 <polygon points="45,206 33,210 33,201" style="fill:rgb(0,0,0)"/>
217 <path d="M24,153 L 24,191 Q 24,206 31,206 L 39,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
218 <path d="M360,259A15 15 0 0 0 375 244A15 15 0 0 0 360 228A15 15 0 0 0 345 244A15 15 0 0 0 360 259Z" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
219 <text x="360" y="244" text-anchor="middle" font-weight="bold" fill="rgb(0,0,0)" dominant-baseline="central">,</text>
220 <polygon points="375,244 386,239 386,248" style="fill:rgb(0,0,0)"/>
221 <path d="M422,206 L 429,206 Q 437,206 437,221 L 437,229 Q 437,244 422,244 L 396,244 L 381,244" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
222 <path d="M345,244 L 286,244 Q 271,244 271,229 L 271,221 Q 271,206 278,206 L 286,206" style="fill:none;stroke-width:2.16;stroke:rgb(0,0,0);" />
223 </svg>
224 </div><br>
225
226 Used by:&nbsp;&nbsp; <a href='./create-table-stmt.html'>create-table-stmt</a><br></br>
227 References:&nbsp;&nbsp; <a href='./conflict-clause.html'>conflict-clause</a>&nbsp;&nbsp; <a href='./expr.html'>expr</a>&nbsp;&nbsp; <a href='./foreign-key-clause.html'>foreign-key-clause</a>&nbsp;&nbsp; <a href='./indexed-column.html'>indexed-column</a><br></br>
228 See also:&nbsp;&nbsp; <a href='../lang_createtable.html'>lang_createtable.html</a>
229 </div>
230
231
232