Database Reference
In-Depth Information
&5($7( 7$%/( 75$16
7UDQVDFWLRQ,'
,QW
127 18// ,'(17,7<
'DWH$FTXLUHG
'DWH
127 18//
$FTXLVLWLRQ3ULFH
1XPHULF
127 18//
$VNLQJ3ULFH
1XPHULF
18//
'DWH6ROG
'DWH
18//
6DOHV3ULFH
1XPHULF
18//
&XVWRPHU,'
,QW
18//
:RUN,'
,QW
127 18//
&21675$,17
7UDQV3.
35,0$5< .(< 7UDQVDFWLRQ,'
&21675$,17
7UDQV:RUN). )25(,*1 .(< :RUN,'
5()(5(1&(6 :25. :RUN,'
2183'$7( 12 $&7,21
21 '(/(7(12 $&7,21
&21675$,17
7UDQV&XVWRPHU). )25(,*1 .(< &XVWRPHU,'
5()(5(1&(6 &86720(5 &XVWRPHU,'
2183'$7(12 $&7,21
21 '(/(7(12 $&7,21
&21675$,17
6DOHV3ULFH5DQJH &+(&.
6DOHV3ULFH ! $1' 6DOHV3ULFH
&21675$,17
9DOLG7UDQV'DWH
&+(&. 'DWH$FTXLUHG 'DWH6ROG
&5($7( 7$%/( &86720(5B$57,67B,17
$UWLVW,'
,QW
127 18//
&XVWRPHU,'
,QW
127 18//
&21675$,17
&$,QW3.
35,0$5< .(< $UWLVW,' &XVWRPHU,'
&21675$,17
&$,QWB$UWLVW). )25(,*1 .(< $UWLVW,'
5()(5(1&(6 $57,67 $UWLVW,'
2183'$7( 12 $&7,21
21 '(/(7( &$6&$'(
&21675$,17
&$,QWB&XVWRPHU). )25(,*1 .(< &XVWRPHU,'
5()(5(1&(6 &86720(5 &XVWRPHU,'
2183'$7( 12 $&7,21
21 '(/(7( &$6&$'(
Figure 7-14
Continued
You can find a list of reserved words in the documentation for the DBMS product that you
use, and we deal with some specific cases in the chapters dedicated to Microsoft SQL Server
2012, Oracle Database 11 g Release 2, and MySQL 5.6. Be assured that if you use any keyword
from the SQL syntax, such as SELECT, FROM, WHERE, LIKE, ORDER, ASC, or DESC, for table
or column names, you will have problems. Enclose such words in square brackets. And, of
course, your life will be easier if you can avoid using such terms for tables or columns altogether.
By ThE WAy Every now and then, the DBMS might generate bizarre syntax-error mes-
sages. For example, suppose you define a table with the name ORDER.
When you submit the statement SELECT * FROM ORDER;, you will get very strange
messages back from the DBMS because ORDER is an SQL reserved word.
If you do receive odd messages back from statements that you know are coded
correctly, think about reserved words. If a term might be reserved, enclose it in brackets
and see what happens when you submit it to the DBMS. No harm is done by enclosing
SQL terms in brackets.
If you want to torture your DBMS, you can submit queries like SELECT [SELECT]
FROM [FROM] WHERE [WHERE] < [NOT FIVE];. Most likely, you have better ways to
spend your time, however. Without a doubt, the DBMS has better ways to spend its time!
Search WWH ::




Custom Search