Artifact
4a796e8e2b7c8b6893758a8f4af9fd8ec43a0251:
Wiki page
[CloneTable] by
sandro
2014-08-28 11:05:01.
0000: 44 20 32 30 31 34 2d 30 38 2d 32 38 54 31 31 3a D 2014-08-28T11:
0010: 30 35 3a 30 31 2e 33 31 39 0a 4c 20 43 6c 6f 6e 05:01.319.L Clon
0020: 65 54 61 62 6c 65 0a 50 20 30 64 33 30 38 32 65 eTable.P 0d3082e
0030: 33 34 32 63 38 64 31 36 37 63 32 36 31 35 63 35 342c8d167c2615c5
0040: 64 30 33 62 38 66 66 63 36 37 35 33 61 31 38 37 d03b8ffc6753a187
0050: 66 0a 55 20 73 61 6e 64 72 6f 0a 57 20 36 33 35 f.U sandro.W 635
0060: 38 0a 3c 68 32 3e 71 75 69 63 6b 20 68 6f 77 2d 8.<h2>quick how-
0070: 74 6f 20 67 75 69 64 65 3a 20 75 73 69 6e 67 20 to guide: using
0080: 43 6c 6f 6e 65 54 61 62 6c 65 28 29 3c 2f 68 32 CloneTable()</h2
0090: 3e 0d 0a 53 74 61 72 74 69 6e 67 20 73 69 6e 63 >..Starting sinc
00a0: 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 34 2e 32 e version <b>4.2
00b0: 2e 31 3c 2f 62 3e 20 61 20 6e 65 77 20 3c 62 3e .1</b> a new <b>
00c0: 43 6c 6f 6e 65 54 61 62 6c 65 28 29 3c 2f 62 3e CloneTable()</b>
00d0: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 69 73 SQL function is
00e0: 20 6e 6f 77 20 61 76 61 69 6c 61 62 6c 65 3b 20 now available;
00f0: 74 68 69 73 20 6e 65 77 20 66 75 6e 63 74 69 6f this new functio
0100: 6e 20 69 73 20 73 70 65 63 69 66 69 63 61 6c 6c n is specificall
0110: 79 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 69 y intended to si
0120: 6d 70 6c 69 66 79 20 63 6f 70 79 69 6e 67 20 64 mplify copying d
0130: 61 74 61 20 62 65 74 77 65 65 6e 20 64 69 66 66 ata between diff
0140: 65 72 65 6e 74 20 54 61 62 6c 65 73 20 61 6e 64 erent Tables and
0150: 20 28 6d 61 79 20 62 65 29 20 62 65 74 77 65 65 (may be) betwee
0160: 6e 20 64 69 66 66 65 72 65 6e 74 20 44 42 2d 66 n different DB-f
0170: 69 6c 65 73 2e 0d 0a 53 65 76 65 72 61 6c 20 61 iles...Several a
0180: 64 76 61 6e 63 65 64 20 6f 70 74 69 6f 6e 20 69 dvanced option i
0190: 6e 74 65 6e 64 65 64 20 74 6f 20 73 75 70 70 6f ntended to suppo
01a0: 72 74 20 66 6c 65 78 69 62 6c 65 20 62 65 68 61 rt flexible beha
01b0: 76 69 6f 72 73 20 61 72 65 20 73 75 70 70 6f 72 viors are suppor
01c0: 74 65 64 2c 20 73 6f 20 72 65 61 64 69 6e 67 20 ted, so reading
01d0: 74 68 69 73 20 71 75 69 63 6b 20 74 75 74 6f 72 this quick tutor
01e0: 69 61 6c 20 69 73 20 73 74 72 6f 6e 67 6c 79 20 ial is strongly
01f0: 73 75 67 67 65 73 74 65 64 20 69 6e 20 6f 72 64 suggested in ord
0200: 65 72 20 74 6f 20 63 6c 61 72 69 66 79 20 61 6e er to clarify an
0210: 79 20 70 6f 73 73 69 62 6c 65 20 64 6f 75 62 74 y possible doubt
0220: 20 61 62 6f 75 74 20 3c 62 3e 43 6c 6f 6e 65 54 about <b>CloneT
0230: 61 62 6c 65 28 29 3c 2f 62 3e 2e 0d 0a 3c 68 34 able()</b>...<h4
0240: 3e 64 6f 77 6e 6c 6f 61 64 69 6e 67 20 74 68 65 >downloading the
0250: 20 73 61 6d 70 6c 65 20 44 42 3c 2f 68 34 3e 0d sample DB</h4>.
0260: 0a 49 6e 20 74 68 69 73 20 74 75 74 6f 72 69 61 .In this tutoria
0270: 6c 20 77 65 27 6c 6c 20 75 73 65 20 61 20 73 61 l we'll use a sa
0280: 6d 70 6c 65 20 44 42 20 61 76 61 69 6c 61 62 6c mple DB availabl
0290: 65 20 66 6f 72 20 3c 61 20 68 72 65 66 3d 22 68 e for <a href="h
02a0: 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 ttp://www.gaia-g
02b0: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f is.it/gaia-sins/
02c0: 63 6c 6f 6e 65 5f 74 61 62 6c 65 2f 63 6c 6f 6e clone_table/clon
02d0: 65 5f 6f 72 69 67 69 6e 2e 7a 69 70 22 3e 64 6f e_origin.zip">do
02e0: 77 6e 6c 6f 61 64 3c 2f 61 3e 0d 0a 3c 68 34 3e wnload</a>..<h4>
02f0: 65 78 70 6c 6f 72 69 6e 67 20 74 68 65 20 73 61 exploring the sa
0300: 6d 70 6c 65 20 44 42 3c 2f 68 34 3e 0d 0a 41 73 mple DB</h4>..As
0310: 20 79 6f 75 20 63 61 6e 20 65 61 73 69 6c 79 20 you can easily
0320: 63 68 65 63 6b 20 74 68 65 20 73 61 6d 70 6c 65 check the sample
0330: 20 44 42 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 DB contains the
0340: 20 66 6f 6c 6c 6f 77 69 6e 67 20 54 61 62 6c 65 following Table
0350: 73 3a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 s:<br><br>..<tab
0360: 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 20 le width="100%"
0370: 63 65 6c 6c 73 70 61 63 69 6e 67 3d 22 32 22 20 cellspacing="2"
0380: 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 36 22 20 cellpadding="6"
0390: 62 6f 72 64 65 72 3d 22 31 22 20 62 67 63 6f 6c border="1" bgcol
03a0: 6f 72 3d 22 23 66 30 66 66 66 30 22 3e 0d 0a 3c or="#f0fff0">..<
03b0: 74 72 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 tr><th bgcolor="
03c0: 23 66 66 64 64 61 30 22 3e 54 61 62 6c 65 3c 2f #ffdda0">Table</
03d0: 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f 72 3d 22 th><th bgcolor="
03e0: 23 66 66 64 64 61 30 22 3e 43 72 65 61 74 65 20 #ffdda0">Create
03f0: 53 74 61 74 65 6d 65 6e 74 3c 2f 74 68 3e 3c 74 Statement</th><t
0400: 68 20 62 67 63 6f 6c 6f 72 3d 22 23 66 66 64 64 h bgcolor="#ffdd
0410: 61 30 22 3e 47 65 6f 6d 65 74 72 79 20 43 6f 6c a0">Geometry Col
0420: 75 6d 6e 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f umn</th><th bgco
0430: 6c 6f 72 3d 22 23 66 66 64 64 61 30 22 3e 49 6e lor="#ffdda0">In
0440: 64 65 78 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f dex</th><th bgco
0450: 6c 6f 72 3d 22 23 66 66 64 64 61 30 22 3e 54 72 lor="#ffdda0">Tr
0460: 69 67 67 65 72 3c 2f 74 68 3e 3c 2f 74 72 3e 0d igger</th></tr>.
0470: 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 72 65 67 69 .<tr><td><b>regi
0480: 6f 6e 73 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 ons</b></td>..<t
0490: 64 3e 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 43 52 d><verbatim>..CR
04a0: 45 41 54 45 20 54 41 42 4c 45 20 72 65 67 69 6f EATE TABLE regio
04b0: 6e 73 20 28 0d 0a 20 20 20 20 6d 61 63 72 6f 5f ns (.. macro_
04c0: 72 65 67 69 6f 6e 20 54 45 58 54 20 4e 4f 54 20 region TEXT NOT
04d0: 4e 55 4c 4c 2c 0d 0a 20 20 20 20 6e 75 74 73 5f NULL,.. nuts_
04e0: 31 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c 2c 1 TEXT NOT NULL,
04f0: 0d 0a 20 20 20 20 6e 75 74 73 5f 32 20 54 45 58 .. nuts_2 TEX
0500: 54 20 4e 4f 54 20 4e 55 4c 4c 20 50 52 49 4d 41 T NOT NULL PRIMA
0510: 52 59 20 4b 45 59 2c 0d 0a 20 20 20 20 72 65 67 RY KEY,.. reg
0520: 69 6f 6e 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c ion TEXT NOT NUL
0530: 4c 2c 20 0d 0a 20 20 20 20 70 6f 70 5f 32 30 31 L, .. pop_201
0540: 31 20 49 4e 54 45 47 45 52 20 4e 4f 54 20 4e 55 1 INTEGER NOT NU
0550: 4c 4c 2c 0d 0a 20 20 20 20 70 6f 70 5f 6d 5f 32 LL,.. pop_m_2
0560: 30 31 31 20 49 4e 54 45 47 45 52 20 4e 4f 54 20 011 INTEGER NOT
0570: 4e 55 4c 4c 2c 0d 0a 20 20 20 20 70 6f 70 5f 66 NULL,.. pop_f
0580: 5f 32 30 31 31 20 49 4e 54 45 47 45 52 20 4e 4f _2011 INTEGER NO
0590: 54 20 4e 55 4c 4c 0d 0a 29 3b 0d 0a 3c 2f 76 65 T NULL..);..</ve
05a0: 72 62 61 74 69 6d 3e 3c 2f 74 64 3e 3c 74 64 3e rbatim></td><td>
05b0: 3c 69 3e 6e 6f 6e 65 3c 2f 69 3e 3c 2f 74 64 3e <i>none</i></td>
05c0: 3c 74 64 3e 3c 69 3e 6e 6f 6e 65 3c 2f 69 3e 3c <td><i>none</i><
05d0: 2f 74 64 3e 3c 74 64 3e 3c 69 3e 6e 6f 6e 65 3c /td><td><i>none<
05e0: 2f 69 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c /i></td></tr>..<
05f0: 74 72 3e 3c 74 64 3e 3c 62 3e 70 72 6f 76 5f 69 tr><td><b>prov_i
0600: 74 63 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 tc</b></td>..<td
0610: 3e 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 43 52 45 ><verbatim>..CRE
0620: 41 54 45 20 54 41 42 4c 45 20 70 72 6f 76 5f 69 ATE TABLE prov_i
0630: 74 63 20 28 0d 0a 20 20 20 20 69 64 20 49 4e 54 tc (.. id INT
0640: 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 EGER PRIMARY KEY
0650: 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0d AUTOINCREMENT,.
0660: 0a 20 20 20 20 6e 75 74 73 5f 32 20 54 45 58 54 . nuts_2 TEXT
0670: 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 20 20 20 NOT NULL,..
0680: 6e 75 74 73 5f 33 20 54 45 58 54 20 4e 4f 54 20 nuts_3 TEXT NOT
0690: 4e 55 4c 4c 2c 0d 0a 20 20 20 20 70 72 6f 76 69 NULL,.. provi
06a0: 6e 63 65 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c nce TEXT NOT NUL
06b0: 4c 2c 0d 0a 20 20 20 20 63 6f 64 65 20 54 45 58 L,.. code TEX
06c0: 54 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 20 20 T NOT NULL,..
06d0: 20 70 6f 70 5f 32 30 31 31 20 49 4e 54 45 47 45 pop_2011 INTEGE
06e0: 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 20 20 R NOT NULL,..
06f0: 20 70 6f 70 5f 6d 5f 32 30 31 31 20 49 4e 54 45 pop_m_2011 INTE
0700: 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 GER NOT NULL,..
0710: 20 20 20 70 6f 70 5f 66 5f 32 30 31 31 20 49 4e pop_f_2011 IN
0720: 54 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 29 3b TEGER NOT NULL);
0730: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 3c 2f 74 ..</verbatim></t
0740: 64 3e 3c 74 64 3e 3c 62 3e 67 65 6f 6d 3c 2f 62 d><td><b>geom</b
0750: 3e 3c 62 72 3e 3c 62 72 3e 73 72 69 64 3d 3c 62 ><br><br>srid=<b
0760: 3e 33 32 36 33 32 3c 2f 62 3e 3c 62 72 3e 3c 62 >32632</b><br><b
0770: 3e 4d 55 4c 54 49 50 4f 4c 59 47 4f 4e 3c 2f 62 >MULTIPOLYGON</b
0780: 3e 3c 62 72 3e 3c 62 72 3e 3c 69 3e 6e 6f 20 53 ><br><br><i>no S
0790: 70 61 74 69 61 6c 20 49 6e 64 65 78 3c 2f 69 3e patial Index</i>
07a0: 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 3c 69 3e 6e 6f </td>..<td><i>no
07b0: 6e 65 3c 2f 69 3e 3c 2f 74 64 3e 3c 74 64 3e 3c ne</i></td><td><
07c0: 69 3e 6e 6f 6e 65 3c 2f 69 3e 3c 2f 74 64 3e 3c i>none</i></td><
07d0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 /tr>..<tr><td><b
07e0: 3e 70 72 6f 76 5f 69 74 66 3c 2f 62 3e 3c 2f 74 >prov_itf</b></t
07f0: 64 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 34 d><td colspan="4
0800: 22 20 72 6f 77 73 70 61 6e 3d 22 34 22 20 61 6c " rowspan="4" al
0810: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 69 3e ign="center"><i>
0820: 73 61 6d 65 20 61 73 20 3c 62 3e 70 72 6f 76 5f same as <b>prov_
0830: 69 74 63 3c 2f 62 3e 3c 2f 74 64 3e 3c 2f 74 72 itc</b></td></tr
0840: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 70 72 >..<tr><td><b>pr
0850: 6f 76 5f 69 74 67 3c 2f 62 3e 3c 2f 74 64 3e 3c ov_itg</b></td><
0860: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 /tr>..<tr><td><b
0870: 3e 70 72 6f 76 5f 69 74 68 3c 2f 62 3e 3c 2f 74 >prov_ith</b></t
0880: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
0890: 3e 3c 62 3e 70 72 6f 76 5f 69 74 69 3c 2f 62 3e ><b>prov_iti</b>
08a0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
08b0: 3c 74 64 3e 3c 62 3e 70 72 6f 76 69 6e 63 65 73 <td><b>provinces
08c0: 3c 2f 62 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 3c </b></td>..<td><
08d0: 76 65 72 62 61 74 69 6d 3e 0d 0a 43 52 45 41 54 verbatim>..CREAT
08e0: 45 20 54 41 42 4c 45 20 70 72 6f 76 69 6e 63 65 E TABLE province
08f0: 73 20 28 0d 0a 20 20 20 20 6e 75 74 73 5f 32 20 s (.. nuts_2
0900: 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a TEXT NOT NULL,..
0910: 20 20 20 20 6e 75 74 73 5f 33 20 54 45 58 54 20 nuts_3 TEXT
0920: 4e 4f 54 20 4e 55 4c 4c 20 50 52 49 4d 41 52 59 NOT NULL PRIMARY
0930: 20 4b 45 59 2c 0d 0a 20 20 20 20 70 72 6f 76 69 KEY,.. provi
0940: 6e 63 65 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c nce TEXT NOT NUL
0950: 4c 2c 0d 0a 20 20 20 20 63 6f 64 65 20 54 45 58 L,.. code TEX
0960: 54 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 20 20 T NOT NULL,..
0970: 20 70 6f 70 5f 32 30 31 31 20 49 4e 54 45 47 45 pop_2011 INTEGE
0980: 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 20 20 R NOT NULL,..
0990: 20 70 6f 70 5f 6d 5f 32 30 31 31 20 49 4e 54 45 pop_m_2011 INTE
09a0: 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0d 0a 20 GER NOT NULL,..
09b0: 20 20 20 70 6f 70 5f 66 5f 32 30 31 31 20 49 4e pop_f_2011 IN
09c0: 54 45 47 45 52 20 4e 4f 54 20 4e 55 4c 4c 2c 0d TEGER NOT NULL,.
09d0: 0a 20 20 20 20 43 4f 4e 53 54 52 41 49 4e 54 20 . CONSTRAINT
09e0: 66 6b 5f 70 72 6f 76 5f 72 65 67 20 0d 0a 20 20 fk_prov_reg ..
09f0: 20 20 20 20 20 20 46 4f 52 45 49 47 4e 20 4b 45 FOREIGN KE
0a00: 59 20 28 6e 75 74 73 5f 32 29 20 0d 0a 20 20 20 Y (nuts_2) ..
0a10: 20 20 20 20 20 52 45 46 45 52 45 4e 43 45 53 20 REFERENCES
0a20: 72 65 67 69 6f 6e 73 20 28 6e 75 74 73 5f 32 29 regions (nuts_2)
0a30: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 3c );..</verbatim><
0a40: 2f 74 64 3e 3c 74 64 3e 3c 62 3e 67 65 6f 6d 3c /td><td><b>geom<
0a50: 2f 62 3e 3c 62 72 3e 3c 62 72 3e 73 72 69 64 3d /b><br><br>srid=
0a60: 3c 62 3e 33 32 36 33 32 3c 2f 62 3e 3c 62 72 3e <b>32632</b><br>
0a70: 3c 62 3e 4d 55 4c 54 49 50 4f 4c 59 47 4f 4e 3c <b>MULTIPOLYGON<
0a80: 2f 62 3e 3c 62 72 3e 3c 62 72 3e 3c 62 3e 53 70 /b><br><br><b>Sp
0a90: 61 74 69 61 6c 20 49 6e 64 65 78 3c 2f 62 3e 3c atial Index</b><
0aa0: 2f 74 64 3e 0d 0a 3c 74 64 3e 3c 76 65 72 62 61 /td>..<td><verba
0ab0: 74 69 6d 3e 0d 0a 43 52 45 41 54 45 20 49 4e 44 tim>..CREATE IND
0ac0: 45 58 20 69 64 78 5f 70 72 6f 76 5f 63 6f 64 65 EX idx_prov_code
0ad0: 20 0d 0a 20 20 20 20 4f 4e 20 70 72 6f 76 69 6e .. ON provin
0ae0: 63 65 73 20 28 63 6f 64 65 29 3b 0d 0a 43 52 45 ces (code);..CRE
0af0: 41 54 45 20 49 4e 44 45 58 20 69 64 78 5f 70 72 ATE INDEX idx_pr
0b00: 6f 76 5f 6e 61 6d 65 20 0d 0a 20 20 20 20 4f 4e ov_name .. ON
0b10: 20 70 72 6f 76 69 6e 63 65 73 20 28 6e 61 6d 65 provinces (name
0b20: 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 3c );..</verbatim><
0b30: 2f 74 64 3e 3c 74 64 3e 3c 76 65 72 62 61 74 69 /td><td><verbati
0b40: 6d 3e 0d 0a 43 52 45 41 54 45 20 54 52 49 47 47 m>..CREATE TRIGG
0b50: 45 52 20 69 6e 73 5f 70 72 6f 76 20 0d 0a 20 20 ER ins_prov ..
0b60: 20 20 41 46 54 45 52 20 49 4e 53 45 52 54 20 4f AFTER INSERT O
0b70: 4e 20 70 72 6f 76 69 6e 63 65 73 0d 0a 42 45 47 N provinces..BEG
0b80: 49 4e 0d 0a 20 20 55 50 44 41 54 45 20 72 65 67 IN.. UPDATE reg
0b90: 69 6f 6e 73 20 0d 0a 20 20 53 45 54 20 70 6f 70 ions .. SET pop
0ba0: 5f 32 30 31 31 20 3d 20 70 6f 70 5f 32 30 31 31 _2011 = pop_2011
0bb0: 20 2b 20 4e 45 57 2e 70 6f 70 5f 32 30 31 31 2c + NEW.pop_2011,
0bc0: 0d 0a 20 20 20 20 70 6f 70 5f 6d 5f 32 30 31 31 .. pop_m_2011
0bd0: 20 3d 20 70 6f 70 5f 6d 5f 32 30 31 31 20 2b 20 = pop_m_2011 +
0be0: 4e 45 57 2e 70 6f 70 5f 6d 5f 32 30 31 31 2c 0d NEW.pop_m_2011,.
0bf0: 0a 20 20 20 20 70 6f 70 5f 66 5f 32 30 31 31 20 . pop_f_2011
0c00: 3d 20 70 6f 70 5f 66 5f 32 30 31 31 20 2b 20 4e = pop_f_2011 + N
0c10: 45 57 2e 70 6f 70 5f 66 5f 32 30 31 31 0d 0a 20 EW.pop_f_2011..
0c20: 20 57 48 45 52 45 20 6e 75 74 73 5f 32 20 3d 20 WHERE nuts_2 =
0c30: 4e 45 57 2e 6e 75 74 73 5f 32 3b 0d 0a 45 4e 44 NEW.nuts_2;..END
0c40: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 3c 2f ;..</verbatim></
0c50: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c td></tr>..</tabl
0c60: 65 3e 3c 62 72 3e 0d 0a 54 68 65 20 73 61 6d 70 e><br>..The samp
0c70: 6c 65 20 44 42 20 69 73 20 66 75 6c 6c 79 20 62 le DB is fully b
0c80: 61 73 65 64 20 6f 6e 20 74 68 65 20 32 30 31 31 ased on the 2011
0c90: 20 49 74 61 6c 69 61 6e 20 43 65 6e 73 75 73 20 Italian Census
0ca0: 6b 69 6e 64 6c 79 20 72 65 6c 65 61 73 65 64 20 kindly released
0cb0: 62 79 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 by <a href="http
0cc0: 3a 2f 2f 77 77 77 2e 69 73 74 61 74 2e 69 74 2f ://www.istat.it/
0cd0: 69 74 2f 61 72 63 68 69 76 69 6f 2f 31 30 34 33 it/archivio/1043
0ce0: 31 37 22 3e 49 53 54 41 54 3c 2f 61 3e 20 75 6e 17">ISTAT</a> un
0cf0: 64 65 72 20 3c 61 20 68 72 65 66 3d 22 68 74 74 der <a href="htt
0d00: 70 73 3a 2f 2f 63 72 65 61 74 69 76 65 63 6f 6d ps://creativecom
0d10: 6d 6f 6e 73 2e 6f 72 67 2f 6c 69 63 65 6e 73 65 mons.org/license
0d20: 73 2f 62 79 2f 33 2e 30 2f 22 3e 43 43 2d 42 59 s/by/3.0/">CC-BY
0d30: 20 6c 69 63 65 6e 73 65 3c 2f 61 3e 2e 3c 62 72 license</a>.<br
0d40: 3e 3c 62 72 3e 0d 0a 4a 75 73 74 20 66 65 77 20 ><br>..Just few
0d50: 6b 65 79 70 6f 69 6e 74 73 20 77 6f 72 74 68 20 keypoints worth
0d60: 74 6f 20 62 65 20 68 69 67 68 6c 69 67 68 74 65 to be highlighte
0d70: 64 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 42 6f d:..<ul>..<li>Bo
0d80: 74 68 20 52 65 67 69 6f 6e 73 20 61 6e 64 20 50 th Regions and P
0d90: 72 6f 76 69 6e 63 65 73 20 61 72 65 20 63 6f 64 rovinces are cod
0da0: 65 64 20 61 63 63 6f 72 64 69 6e 67 6c 79 20 74 ed accordingly t
0db0: 6f 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a o <a href="http:
0dc0: 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f //en.wikipedia.o
0dd0: 72 67 2f 77 69 6b 69 2f 4e 6f 6d 65 6e 63 6c 61 rg/wiki/Nomencla
0de0: 74 75 72 65 5f 6f 66 5f 54 65 72 72 69 74 6f 72 ture_of_Territor
0df0: 69 61 6c 5f 55 6e 69 74 73 5f 66 6f 72 5f 53 74 ial_Units_for_St
0e00: 61 74 69 73 74 69 63 73 22 3e 4e 55 54 53 3c 2f atistics">NUTS</
0e10: 61 3e 3c 62 72 3e 0d 0a 3c 62 3e 4e 55 54 53 20 a><br>..<b>NUTS
0e20: 6c 65 76 65 6c 2d 32 3c 2f 62 3e 20 61 6e 64 20 level-2</b> and
0e30: 3c 62 3e 4e 55 54 53 20 6c 65 76 65 6c 2d 33 3c <b>NUTS level-3<
0e40: 2f 62 3e 20 63 6f 64 65 73 20 63 6f 72 72 65 73 /b> codes corres
0e50: 70 6f 6e 64 20 74 6f 20 61 20 72 65 6c 61 74 69 pond to a relati
0e60: 6f 6e 61 6c 20 68 69 65 72 61 72 63 68 79 20 72 onal hierarchy r
0e70: 65 66 6c 65 63 74 65 64 20 62 79 20 74 68 65 20 eflected by the
0e80: 3c 62 3e 50 72 69 6d 61 72 79 3c 2f 62 3e 20 2f <b>Primary</b> /
0e90: 20 3c 62 3e 46 6f 72 65 69 67 6e 20 4b 65 79 3c <b>Foreign Key<
0ea0: 2f 62 3e 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 /b> relationship
0eb0: 73 20 6a 6f 69 6e 69 6e 67 20 74 68 65 20 3c 62 s joining the <b
0ec0: 3e 72 65 67 69 6f 6e 73 3c 2f 62 3e 20 61 6e 64 >regions</b> and
0ed0: 20 3c 62 3e 70 72 6f 76 69 6e 63 65 73 3c 2f 62 <b>provinces</b
0ee0: 3e 20 54 61 62 6c 65 73 2e 3c 2f 6c 69 3e 0d 0a > Tables.</li>..
0ef0: 3c 6c 69 3e 41 6c 6c 20 49 74 61 6c 69 61 6e 20 <li>All Italian
0f00: 50 72 6f 76 69 6e 63 65 73 20 61 72 65 20 63 6f Provinces are co
0f10: 6e 74 61 69 6e 65 64 20 77 69 74 68 69 6e 20 74 ntained within t
0f20: 68 65 20 74 61 62 6c 65 73 20 3c 62 3e 70 72 6f he tables <b>pro
0f30: 76 5f 69 74 63 3c 2f 62 3e 2c 20 3c 62 3e 70 72 v_itc</b>, <b>pr
0f40: 6f 76 5f 69 74 66 3c 2f 62 3e 2c 20 3c 62 3e 70 ov_itf</b>, <b>p
0f50: 72 6f 76 5f 69 74 67 3c 2f 62 3e 2c 20 3c 62 3e rov_itg</b>, <b>
0f60: 70 72 6f 76 5f 69 74 68 3c 2f 62 3e 20 61 6e 64 prov_ith</b> and
0f70: 20 3c 62 3e 70 72 6f 76 5f 69 74 69 3c 2f 62 3e <b>prov_iti</b>
0f80: 2e 3c 62 72 3e 0d 0a 45 61 63 68 20 73 69 6e 67 .<br>..Each sing
0f90: 6c 65 20 54 61 62 6c 65 20 64 69 72 65 63 74 6c le Table directl
0fa0: 79 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f y corresponds to
0fb0: 20 61 20 3c 62 3e 4e 55 54 53 20 6c 65 76 65 6c a <b>NUTS level
0fc0: 2d 31 3c 2f 62 3e 20 63 6f 64 65 2e 3c 2f 6c 69 -1</b> code.</li
0fd0: 3e 0d 0a 3c 6c 69 3e 54 61 62 6c 65 20 3c 62 3e >..<li>Table <b>
0fe0: 70 72 6f 76 69 6e 63 65 73 3c 2f 62 3e 20 28 77 provinces</b> (w
0ff0: 68 6f 6c 65 20 49 74 61 6c 79 29 20 69 73 20 69 hole Italy) is i
1000: 6e 73 74 65 61 64 20 63 6f 6d 70 6c 65 74 65 6c nstead completel
1010: 79 20 65 6d 70 74 79 20 28 3c 69 3e 77 65 27 6c y empty (<i>we'l
1020: 6c 20 73 65 65 20 6c 61 74 65 72 20 74 68 65 20 l see later the
1030: 69 6e 74 65 6e 64 65 64 20 73 63 6f 70 65 20 6f intended scope o
1040: 66 20 74 68 69 73 20 54 61 62 6c 65 3c 2f 69 3e f this Table</i>
1050: 29 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 ):..<ul>..<li>th
1060: 69 73 20 74 61 62 6c 65 20 69 73 20 73 75 70 70 is table is supp
1070: 6f 72 74 65 64 20 62 79 20 74 77 6f 20 6f 72 64 orted by two ord
1080: 69 6e 61 72 79 20 49 6e 64 69 63 65 73 2e 3c 2f inary Indices.</
1090: 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 72 65 20 69 li>..<li>there i
10a0: 73 20 61 20 54 72 69 67 67 65 72 20 66 69 72 69 s a Trigger firi
10b0: 6e 67 20 65 61 63 68 20 74 69 6d 65 20 74 68 61 ng each time tha
10c0: 74 20 61 20 6e 65 77 20 72 6f 77 20 77 69 6c 6c t a new row will
10d0: 20 62 65 20 69 6e 74 65 72 74 65 64 20 69 6e 74 be interted int
10e0: 6f 20 74 68 69 73 20 54 61 62 6c 65 2e 3c 62 72 o this Table.<br
10f0: 3e 0d 0a 54 68 65 20 69 6e 74 65 6e 64 65 64 20 >..The intended
1100: 73 63 6f 70 65 20 6f 66 20 74 68 69 73 20 54 72 scope of this Tr
1110: 69 67 67 65 72 20 69 73 20 74 6f 20 69 6d 6d 65 igger is to imme
1120: 64 69 61 74 65 6c 79 20 75 70 64 61 74 65 20 74 diately update t
1130: 68 65 20 50 6f 70 75 6c 61 74 69 6f 6e 20 32 30 he Population 20
1140: 31 31 20 76 61 6c 75 65 73 20 73 74 6f 72 65 64 11 values stored
1150: 20 69 6e 74 6f 20 74 68 65 20 3c 62 3e 72 65 67 into the <b>reg
1160: 69 6f 6e 73 3c 2f 62 3e 20 54 61 62 6c 65 2e 3c ions</b> Table.<
1170: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e /li>..</ul></li>
1180: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68 72 ..</ul><br>..<hr
1190: 3e 0d 0a 3c 68 33 3e 54 75 74 6f 72 69 61 6c 20 >..<h3>Tutorial
11a0: 73 74 65 70 20 23 31 20 28 3c 69 3e 62 61 73 69 step #1 (<i>basi
11b0: 63 20 6c 65 76 65 6c 3c 2f 69 3e 29 3c 2f 68 33 c level</i>)</h3
11c0: 3e 0d 0a 57 65 27 6c 6c 20 75 73 65 20 74 68 65 >..We'll use the
11d0: 20 3c 62 3e 73 71 6c 69 74 65 33 3c 2f 62 3e 20 <b>sqlite3</b>
11e0: 43 4c 49 20 66 72 6f 6e 74 2d 65 6e 64 20 74 6f CLI front-end to
11f0: 6f 6c 20 69 6e 20 74 68 65 20 66 6f 6c 6c 6f 77 ol in the follow
1200: 69 6e 67 20 65 78 61 6d 70 6c 65 73 2c 20 62 75 ing examples, bu
1210: 74 20 79 6f 75 20 63 6f 75 6c 64 20 65 76 65 6e t you could even
1220: 74 75 61 6c 6c 79 20 75 73 65 20 65 69 74 68 65 tually use eithe
1230: 72 20 3c 62 3e 73 70 61 74 69 61 6c 69 74 65 3c r <b>spatialite<
1240: 2f 62 3e 20 6f 72 20 3c 62 3e 73 70 61 74 69 61 /b> or <b>spatia
1250: 6c 69 74 65 5f 67 75 69 3c 2f 62 3e 2e 0d 0a 3c lite_gui</b>...<
1260: 76 65 72 62 61 74 69 6d 3e 0d 0a 24 20 73 71 6c verbatim>..$ sql
1270: 69 74 65 33 20 74 65 73 74 31 2e 73 71 6c 69 74 ite3 test1.sqlit
1280: 65 0d 0a 53 51 4c 69 74 65 20 76 65 72 73 69 6f e..SQLite versio
1290: 6e 20 33 2e 38 2e 36 20 32 30 31 34 2d 30 38 2d n 3.8.6 2014-08-
12a0: 31 35 20 31 31 3a 34 36 3a 33 33 0d 0a 45 6e 74 15 11:46:33..Ent
12b0: 65 72 20 22 2e 68 65 6c 70 22 20 66 6f 72 20 75 er ".help" for u
12c0: 73 61 67 65 20 68 69 6e 74 73 2e 0d 0a 73 71 6c sage hints...sql
12d0: 69 74 65 3e 20 53 45 4c 45 43 54 20 6c 6f 61 64 ite> SELECT load
12e0: 5f 65 78 74 65 6e 73 69 6f 6e 28 27 6d 6f 64 5f _extension('mod_
12f0: 73 70 61 74 69 61 6c 69 74 65 27 29 3b 0d 0a 73 spatialite');..s
1300: 71 6c 69 74 65 3e 0d 0a 3c 2f 76 65 72 62 61 74 qlite>..</verbat
1310: 69 6d 3e 0d 0a 77 65 27 6c 6c 20 73 74 61 72 74 im>..we'll start
1320: 20 62 79 20 63 72 65 61 74 69 6e 67 20 61 20 6e by creating a n
1330: 65 77 20 44 42 20 6e 61 6d 65 64 20 3c 62 3e 74 ew DB named <b>t
1340: 65 73 74 31 2e 73 71 6c 69 74 65 3c 2f 62 3e 20 est1.sqlite</b>
1350: 61 6e 64 20 62 79 20 6c 6f 61 64 69 6e 67 20 74 and by loading t
1360: 68 65 20 3c 62 3e 6d 6f 64 5f 73 70 61 74 69 61 he <b>mod_spatia
1370: 6c 69 74 65 3c 2f 62 3e 20 64 79 6e 61 6d 69 63 lite</b> dynamic
1380: 20 65 78 74 65 6e 73 69 6f 6e 2e 3c 62 72 3e 0d extension.<br>.
1390: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 73 71 6c .<verbatim>..sql
13a0: 69 74 65 3e 20 53 45 4c 45 43 54 20 49 6e 69 74 ite> SELECT Init
13b0: 53 70 61 74 69 61 6c 4d 65 74 61 64 61 74 61 28 SpatialMetadata(
13c0: 31 29 3b 0d 0a 31 0d 0a 73 71 6c 69 74 65 3e 0d 1);..1..sqlite>.
13d0: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 6e 6f .</verbatim>..no
13e0: 77 20 77 65 27 6c 6c 20 70 72 6f 70 65 72 6c 79 w we'll properly
13f0: 20 69 6e 69 74 69 61 6c 69 7a 65 20 74 68 65 20 initialize the
1400: 6e 65 77 20 44 42 20 62 79 20 63 72 65 61 74 69 new DB by creati
1410: 6e 67 20 61 6e 79 20 72 65 71 75 69 72 65 64 20 ng any required
1420: 6d 61 74 61 74 61 62 6c 65 2e 0d 0a 3c 76 65 72 matatable...<ver
1430: 62 61 74 69 6d 3e 0d 0a 73 71 6c 69 74 65 3e 20 batim>..sqlite>
1440: 41 54 54 41 43 48 20 44 41 54 41 42 41 53 45 20 ATTACH DATABASE
1450: 22 2e 2f 63 6c 6f 6e 65 5f 6f 72 69 67 69 6e 2e "./clone_origin.
1460: 73 71 6c 69 74 65 22 20 41 53 20 6f 72 69 67 69 sqlite" AS origi
1470: 6e 3b 0d 0a 73 71 6c 69 74 65 3e 0d 0a 3c 2f 76 n;..sqlite>..</v
1480: 65 72 62 61 74 69 6d 3e 0d 0a 61 6e 64 20 66 69 erbatim>..and fi
1490: 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 61 74 74 61 nally we'll atta
14a0: 63 68 20 74 68 65 20 3c 62 3e 63 6c 6f 6e 65 5f ch the <b>clone_
14b0: 6f 72 69 67 69 6e 2e 73 71 6c 69 74 65 3c 2f 62 origin.sqlite</b
14c0: 3e 20 73 61 6d 70 6c 65 20 44 42 3a 20 77 65 20 > sample DB: we
14d0: 61 72 65 20 6e 6f 77 20 72 65 61 64 79 20 66 6f are now ready fo
14e0: 72 20 63 6f 70 79 69 6e 67 20 64 61 74 61 20 62 r copying data b
14f0: 65 74 77 65 65 6e 20 74 68 65 20 74 77 6f 20 44 etween the two D
1500: 42 2d 66 69 6c 65 73 2e 0d 0a 3c 76 65 72 62 61 B-files...<verba
1510: 74 69 6d 3e 0d 0a 73 71 6c 69 74 65 3e 20 53 45 tim>..sqlite> SE
1520: 4c 45 43 54 20 43 6c 6f 6e 65 54 61 62 6c 65 28 LECT CloneTable(
1530: 27 6f 72 69 67 69 6e 27 2c 20 27 72 65 67 69 6f 'origin', 'regio
1540: 6e 73 27 2c 20 27 72 65 67 69 6f 6e 73 27 2c 20 ns', 'regions',
1550: 31 29 3b 0d 0a 31 0d 0a 73 71 6c 69 74 65 3e 0d 1);..1..sqlite>.
1560: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 .</verbatim>..<u
1570: 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 66 69 72 73 l>..<li>the firs
1580: 74 20 61 72 67 75 6d 65 6e 74 20 3c 62 3e 27 6f t argument <b>'o
1590: 72 69 67 69 6e 27 3c 2f 62 3e 20 69 64 65 6e 74 rigin'</b> ident
15a0: 69 66 69 65 73 20 74 68 65 20 3c 62 3e 3c 69 3e ifies the <b><i>
15b0: 44 42 2d 70 72 65 66 69 78 3c 2f 69 3e 3c 2f 62 DB-prefix</i></b
15c0: 3e 20 6f 66 20 74 68 65 20 69 6e 70 75 74 20 54 > of the input T
15d0: 61 62 6c 65 2e 3c 62 72 3e 0d 0a 49 66 20 74 68 able.<br>..If th
15e0: 65 20 69 6e 70 75 74 20 54 61 62 6c 65 20 69 73 e input Table is
15f0: 20 6c 6f 63 61 74 65 64 20 6f 6e 20 74 68 65 20 located on the
1600: 70 72 69 6d 61 72 79 20 44 42 20 79 6f 75 20 73 primary DB you s
1610: 69 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 73 70 imply have to sp
1620: 65 63 69 66 69 63 79 20 74 68 65 20 3c 62 3e 27 ecificy the <b>'
1630: 6d 61 69 6e 27 3c 2f 62 3e 20 63 6f 6e 76 65 6e main'</b> conven
1640: 74 69 6f 6e 61 6c 20 44 42 2d 70 72 65 66 69 78 tional DB-prefix
1650: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 .</li>..<li>the
1660: 73 65 63 6f 6e 64 20 61 72 67 75 6d 65 6e 74 20 second argument
1670: 3c 62 3e 27 72 65 67 69 6f 6e 73 27 3c 2f 62 3e <b>'regions'</b>
1680: 20 69 64 65 6e 74 69 66 69 65 73 20 74 68 65 20 identifies the
1690: 3c 62 3e 3c 69 3e 69 6e 70 75 74 20 54 61 62 6c <b><i>input Tabl
16a0: 65 3c 2f 69 3e 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d e</i></b>.</li>.
16b0: 0a 3c 6c 69 3e 74 68 65 20 74 68 69 72 64 20 61 .<li>the third a
16c0: 72 67 75 6d 65 6e 74 20 3c 62 3e 27 72 65 67 69 rgument <b>'regi
16d0: 6f 6e 73 27 3c 2f 62 3e 20 69 64 65 6e 74 69 66 ons'</b> identif
16e0: 69 65 73 20 74 68 65 20 3c 62 3e 3c 69 3e 6f 75 ies the <b><i>ou
16f0: 74 70 75 74 20 54 61 62 6c 65 3c 2f 69 3e 3c 2f tput Table</i></
1700: 62 3e 2e 3c 62 72 3e 0d 0a 3c 75 3e 50 6c 65 61 b>.<br>..<u>Plea
1710: 73 65 20 6e 6f 74 65 3c 2f 75 3e 3a 20 74 68 65 se note</u>: the
1720: 20 6f 75 74 70 75 74 20 54 61 62 6c 65 20 69 73 output Table is
1730: 20 61 6c 77 61 79 73 20 69 6e 74 65 6e 64 65 64 always intended
1740: 20 74 6f 20 62 65 20 6c 6f 63 61 74 65 64 20 6f to be located o
1750: 6e 20 74 68 65 20 3c 62 3e 6d 61 69 6e 3c 2f 62 n the <b>main</b
1760: 3e 20 44 42 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e > DB.</li>..<li>
1770: 74 68 65 20 66 6f 75 72 74 68 20 61 72 67 75 6d the fourth argum
1780: 65 6e 74 20 3c 62 3e 31 3c 2f 62 3e 20 73 69 6d ent <b>1</b> sim
1790: 70 6c 79 20 64 65 63 6c 61 72 65 73 20 74 68 61 ply declares tha
17a0: 74 20 74 68 65 20 77 68 6f 6c 65 20 3c 75 3e 63 t the whole <u>c
17b0: 72 65 61 74 65 20 2f 20 63 6f 70 79 3c 2f 75 3e reate / copy</u>
17c0: 20 28 3c 69 3e 61 6b 61 3c 2f 69 3e 20 3c 75 3e (<i>aka</i> <u>
17d0: 63 6c 6f 6e 69 6e 67 3c 2f 75 3e 29 20 6f 70 65 cloning</u>) ope
17e0: 72 61 74 69 6f 6e 20 68 61 73 20 74 6f 20 62 65 ration has to be
17f0: 20 61 74 6f 6d 69 63 61 6c 6c 79 20 63 6f 6e 66 atomically conf
1800: 69 6e 65 64 20 77 69 74 68 69 6e 20 61 20 6d 6f ined within a mo
1810: 6e 6f 6c 69 74 68 69 63 20 53 51 4c 20 54 72 61 nolithic SQL Tra
1820: 6e 73 61 63 74 69 6f 6e 2e 3c 2f 6c 69 3e 20 0d nsaction.</li> .
1830: 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69 .</ul>..<verbati
1840: 6d 3e 0d 0a 73 71 6c 69 74 65 3e 20 53 45 4c 45 m>..sqlite> SELE
1850: 43 54 20 2a 20 46 52 4f 4d 20 72 65 67 69 6f 6e CT * FROM region
1860: 73 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d s;..</verbatim>.
1870: 0a 61 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 .as you can easi
1880: 6c 79 20 63 68 65 63 6b 20 61 20 6e 65 77 20 3c ly check a new <
1890: 62 3e 72 65 67 69 6f 6e 73 3c 2f 62 3e 20 74 61 b>regions</b> ta
18a0: 62 6c 65 20 68 61 73 20 62 65 65 6e 20 63 72 65 ble has been cre
18b0: 61 74 65 64 20 28 65 78 61 63 74 6c 79 20 63 6f ated (exactly co
18c0: 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 69 rresponding to i
18d0: 6e 70 75 74 20 64 65 66 69 6e 69 74 69 6f 6e 73 nput definitions
18e0: 29 2c 20 61 6e 64 20 61 6c 6c 20 72 6f 77 73 20 ), and all rows
18f0: 68 61 76 65 20 62 65 65 6e 20 63 6f 70 69 65 64 have been copied
1900: 2e 0d 0a 0d 0a 0d 0a 3c 68 33 3e 54 75 74 6f 72 .......<h3>Tutor
1910: 69 61 6c 20 73 74 65 70 20 23 32 20 28 3c 69 3e ial step #2 (<i>
1920: 61 64 76 61 6e 63 65 64 20 6c 65 76 65 6c 3c 2f advanced level</
1930: 69 3e 29 3c 2f 68 33 3e 0a 5a 20 65 39 64 64 32 i>)</h3>.Z e9dd2
1940: 36 39 64 66 36 33 36 36 62 63 38 66 32 64 66 30 69df6366bc8f2df0
1950: 66 38 32 31 33 33 61 39 32 62 39 0a f82133a92b9.