????6????? NOT (A IN (X?? Y)) ?? IN (X?? Y) ????????
????????NULLs??????????????????????????????? A IN (X?? Y) ??????????
????A IN (X?? Y)
????is the same as    A = ANY (X?? Y)
????is the same as    A = X OR A = Y
????When at the same time?? NOT (A IN (X?? Y)) really means:
??????????NOT (A IN (X?? Y))???????????
????NOT (A IN (X?? Y))
????is the same as    A NOT IN (X?? Y)
????is the same as    A != ANY (X?? Y)
????is the same as    A != X AND A != Y
???????????????????????????????????????X??Y???κ?????NULL??NOT IN ????????????????UNKNOWN??????IN?????????????????????????
?????????????????? A IN (X?? Y) ????TRUE??FALSE???NOT(A IN (X?? Y)) ???????UNKNOWN??????FALSE??TRUE???????????IN??????????????????????????ɡ?
????????????????SQL Fiddle ???????????2?????????????
????SELECT 1
????WHERE    1 IN (NULL)
????UNION ALL
????SELECT 2
????WHERE NOT(1 IN (NULL))
??????????????ο?????????????????д??????????????????ЩSQL?????
?????????????
???????漰?????NULL??????????NOT IN??????
????7?????NOT (A IS NULL)??A IS NOT NULL???????
?????????????????NULL??????SQL?????????????????????????NULL?????????NULL???????????????
????????NULL??????????????????????????????????????????????????????row value expressions???1??????????
????NOT (A IS NULL)
????is not the same as A IS NOT NULL
???????A?????????1???????????row value expressions??????????????????·???????
???????A????????NUll??A IS NULL?TRUE
???????A????????NUll??NOT(A IS NULL) ?FALSE
???????A?????????????NUll??A IS NOT NULL ?TRUE
???????A?????????????NUll??NOT(A IS NOT NULL)  ?FALSE
???????????????????????????????
?????????????
??????????????????row value expressions?????????NULL????????????????Ч????
????8?????????????
?????????????SQL????????????SQL??????????????????????????????????????????????????????????????б?????????????????????????????????????????ж???????????????????????????????????
????SELECT c.address
????FROM  customer c??
????WHERE (c.first_name?? c.last_name) = (??? ?)
?????????????????е?ν????????????????????????????????????????????????????????????????????AND?????????????Ч????????????????????????????????????????????JOIN??????????????????
????SELECT c.first_name?? c.last_name?? a.street
????FROM  customer c
????JOIN  address a
????ON  (c.id?? c.tenant_id) = (a.id?? a.tenant_id)
?????????????????????????????????????????SQL????????1992?????????????????壬???????????????Oracle??Postgres??Щ???????????????????????????????м??????Use The Index?? Luke?????????н?????
?????????????
???????????????????????????????????????SQL?????????Ч??
????9??????????????????????constraints??
????????????????Tom Kyte ?? Use The Index?? Luke ??????????????????????????????????????????????????????????????????????????á???????????????????????????????????????????SQL?????????????????????
??????Щ??????
??????Щ??????????
??????Щ???????Ч??????磬???????????
??????Щ???????????????????????£?????????????????????????????????????????????????????????????????????????????????????????“?????”????????????????????????С?
?????????????
????????????????????????????constraints?????????????????????????????
????10?????50ms?????????????
????NoSQL????????????????????????????Twitter??Facebook?????????????????????????????????ACID?????????????????Щ?????????????Twitter??Facebook????????????????????????
??????????Щ?????????????ù???????? ????????????????????????“????????????????????????????????????????ū???”?????????????????????20Kb???????????? 2000????м?????????????У????????С??1ms??????????????????DBA???????????????????????????????С?
????????????????????????????????????????е?ORM??????ORM???????????????????????SQL???????????????????????????? JDBC??jOOQ ??MyBatis???????????SQL?????????????????SQL????API??
????????????????????50ms????????????????????????????????????????????????????????м???????????Σ????????????и??????????????????б?????
???????
????SQL?????????????????????????????????????10?????????????????????????????SQL????????????????????????м?????????????????????????????????д???????SQL???