mirror of
https://github.com/treffynnon/sqlstyle.guide.git
synced 2025-03-09 12:49:51 -05:00
Beging fleshing content out
This commit is contained in:
parent
fff356547f
commit
fb5c8e7d8e
7 changed files with 1116 additions and 0 deletions
825
_includes/sql/appendices_reserved_keywords.sql
Normal file
825
_includes/sql/appendices_reserved_keywords.sql
Normal file
|
@ -0,0 +1,825 @@
|
||||||
|
A
|
||||||
|
ABORT
|
||||||
|
ABS
|
||||||
|
ABSOLUTE
|
||||||
|
ACCESS
|
||||||
|
ACTION
|
||||||
|
ADA
|
||||||
|
ADD
|
||||||
|
ADMIN
|
||||||
|
AFTER
|
||||||
|
AGGREGATE
|
||||||
|
ALIAS
|
||||||
|
ALL
|
||||||
|
ALLOCATE
|
||||||
|
ALSO
|
||||||
|
ALTER
|
||||||
|
ALWAYS
|
||||||
|
ANALYSE
|
||||||
|
ANALYZE
|
||||||
|
AND
|
||||||
|
ANY
|
||||||
|
ARE
|
||||||
|
ARRAY
|
||||||
|
AS
|
||||||
|
ASC
|
||||||
|
ASENSITIVE
|
||||||
|
ASSERTION
|
||||||
|
ASSIGNMENT
|
||||||
|
ASYMMETRIC
|
||||||
|
AT
|
||||||
|
ATOMIC
|
||||||
|
ATTRIBUTE
|
||||||
|
ATTRIBUTES
|
||||||
|
AUDIT
|
||||||
|
AUTHORIZATION
|
||||||
|
AUTO_INCREMENT
|
||||||
|
AVG
|
||||||
|
AVG_ROW_LENGTH
|
||||||
|
BACKUP
|
||||||
|
BACKWARD
|
||||||
|
BEFORE
|
||||||
|
BEGIN
|
||||||
|
BERNOULLI
|
||||||
|
BETWEEN
|
||||||
|
BIGINT
|
||||||
|
BINARY
|
||||||
|
BIT
|
||||||
|
BIT_LENGTH
|
||||||
|
BITVAR
|
||||||
|
BLOB
|
||||||
|
BOOL
|
||||||
|
BOOLEAN
|
||||||
|
BOTH
|
||||||
|
BREADTH
|
||||||
|
BREAK
|
||||||
|
BROWSE
|
||||||
|
BULK
|
||||||
|
BY
|
||||||
|
C
|
||||||
|
CACHE
|
||||||
|
CALL
|
||||||
|
CALLED
|
||||||
|
CARDINALITY
|
||||||
|
CASCADE
|
||||||
|
CASCADED
|
||||||
|
CASE
|
||||||
|
CAST
|
||||||
|
CATALOG
|
||||||
|
CATALOG_NAME
|
||||||
|
CEIL
|
||||||
|
CEILING
|
||||||
|
CHAIN
|
||||||
|
CHANGE
|
||||||
|
CHAR
|
||||||
|
CHAR_LENGTH
|
||||||
|
CHARACTER
|
||||||
|
CHARACTER_LENGTH
|
||||||
|
CHARACTER_SET_CATALOG
|
||||||
|
CHARACTER_SET_NAME
|
||||||
|
CHARACTER_SET_SCHEMA
|
||||||
|
CHARACTERISTICS
|
||||||
|
CHARACTERS
|
||||||
|
CHECK
|
||||||
|
CHECKED
|
||||||
|
CHECKPOINT
|
||||||
|
CHECKSUM
|
||||||
|
CLASS
|
||||||
|
CLASS_ORIGIN
|
||||||
|
CLOB
|
||||||
|
CLOSE
|
||||||
|
CLUSTER
|
||||||
|
CLUSTERED
|
||||||
|
COALESCE
|
||||||
|
COBOL
|
||||||
|
COLLATE
|
||||||
|
COLLATION
|
||||||
|
COLLATION_CATALOG
|
||||||
|
COLLATION_NAME
|
||||||
|
COLLATION_SCHEMA
|
||||||
|
COLLECT
|
||||||
|
COLUMN
|
||||||
|
COLUMN_NAME
|
||||||
|
COLUMNS
|
||||||
|
COMMAND_FUNCTION
|
||||||
|
COMMAND_FUNCTION_CODE
|
||||||
|
COMMENT
|
||||||
|
COMMIT
|
||||||
|
COMMITTED
|
||||||
|
COMPLETION
|
||||||
|
COMPRESS
|
||||||
|
COMPUTE
|
||||||
|
CONDITION
|
||||||
|
CONDITION_NUMBER
|
||||||
|
CONNECT
|
||||||
|
CONNECTION
|
||||||
|
CONNECTION_NAME
|
||||||
|
CONSTRAINT
|
||||||
|
CONSTRAINT_CATALOG
|
||||||
|
CONSTRAINT_NAME
|
||||||
|
CONSTRAINT_SCHEMA
|
||||||
|
CONSTRAINTS
|
||||||
|
CONSTRUCTOR
|
||||||
|
CONTAINS
|
||||||
|
CONTAINSTABLE
|
||||||
|
CONTINUE
|
||||||
|
CONVERSION
|
||||||
|
CONVERT
|
||||||
|
COPY
|
||||||
|
CORR
|
||||||
|
CORRESPONDING
|
||||||
|
COUNT
|
||||||
|
COVAR_POP
|
||||||
|
COVAR_SAMP
|
||||||
|
CREATE
|
||||||
|
CREATEDB
|
||||||
|
CREATEROLE
|
||||||
|
CREATEUSER
|
||||||
|
CROSS
|
||||||
|
CSV
|
||||||
|
CUBE
|
||||||
|
CUME_DIST
|
||||||
|
CURRENT
|
||||||
|
CURRENT_DATE
|
||||||
|
CURRENT_DEFAULT_TRANSFORM_GROUP
|
||||||
|
CURRENT_PATH
|
||||||
|
CURRENT_ROLE
|
||||||
|
CURRENT_TIME
|
||||||
|
CURRENT_TIMESTAMP
|
||||||
|
CURRENT_TRANSFORM_GROUP_FOR_TYPE
|
||||||
|
CURRENT_USER
|
||||||
|
CURSOR
|
||||||
|
CURSOR_NAME
|
||||||
|
CYCLE
|
||||||
|
DATA
|
||||||
|
DATABASE
|
||||||
|
DATABASES
|
||||||
|
DATE
|
||||||
|
DATETIME
|
||||||
|
DATETIME_INTERVAL_CODE
|
||||||
|
DATETIME_INTERVAL_PRECISION
|
||||||
|
DAY
|
||||||
|
DAY_HOUR
|
||||||
|
DAY_MICROSECOND
|
||||||
|
DAY_MINUTE
|
||||||
|
DAY_SECOND
|
||||||
|
DAYOFMONTH
|
||||||
|
DAYOFWEEK
|
||||||
|
DAYOFYEAR
|
||||||
|
DBCC
|
||||||
|
DEALLOCATE
|
||||||
|
DEC
|
||||||
|
DECIMAL
|
||||||
|
DECLARE
|
||||||
|
DEFAULT
|
||||||
|
DEFAULTS
|
||||||
|
DEFERRABLE
|
||||||
|
DEFERRED
|
||||||
|
DEFINED
|
||||||
|
DEFINER
|
||||||
|
DEGREE
|
||||||
|
DELAY_KEY_WRITE
|
||||||
|
DELAYED
|
||||||
|
DELETE
|
||||||
|
DELIMITER
|
||||||
|
DELIMITERS
|
||||||
|
DENSE_RANK
|
||||||
|
DENY
|
||||||
|
DEPTH
|
||||||
|
DEREF
|
||||||
|
DERIVED
|
||||||
|
DESC
|
||||||
|
DESCRIBE
|
||||||
|
DESCRIPTOR
|
||||||
|
DESTROY
|
||||||
|
DESTRUCTOR
|
||||||
|
DETERMINISTIC
|
||||||
|
DIAGNOSTICS
|
||||||
|
DICTIONARY
|
||||||
|
DISABLE
|
||||||
|
DISCONNECT
|
||||||
|
DISK
|
||||||
|
DISPATCH
|
||||||
|
DISTINCT
|
||||||
|
DISTINCTROW
|
||||||
|
DISTRIBUTED
|
||||||
|
DIV
|
||||||
|
DO
|
||||||
|
DOMAIN
|
||||||
|
DOUBLE
|
||||||
|
DROP
|
||||||
|
DUAL
|
||||||
|
DUMMY
|
||||||
|
DUMP
|
||||||
|
DYNAMIC
|
||||||
|
DYNAMIC_FUNCTION
|
||||||
|
DYNAMIC_FUNCTION_CODE
|
||||||
|
EACH
|
||||||
|
ELEMENT
|
||||||
|
ELSE
|
||||||
|
ELSEIF
|
||||||
|
ENABLE
|
||||||
|
ENCLOSED
|
||||||
|
ENCODING
|
||||||
|
ENCRYPTED
|
||||||
|
END
|
||||||
|
END-EXEC
|
||||||
|
ENUM
|
||||||
|
EQUALS
|
||||||
|
ERRLVL
|
||||||
|
ESCAPE
|
||||||
|
ESCAPED
|
||||||
|
EVERY
|
||||||
|
EXCEPT
|
||||||
|
EXCEPTION
|
||||||
|
EXCLUDE
|
||||||
|
EXCLUDING
|
||||||
|
EXCLUSIVE
|
||||||
|
EXEC
|
||||||
|
EXECUTE
|
||||||
|
EXISTING
|
||||||
|
EXISTS
|
||||||
|
EXIT
|
||||||
|
EXP
|
||||||
|
EXPLAIN
|
||||||
|
EXTERNAL
|
||||||
|
EXTRACT
|
||||||
|
FALSE
|
||||||
|
FETCH
|
||||||
|
FIELDS
|
||||||
|
FILE
|
||||||
|
FILLFACTOR
|
||||||
|
FILTER
|
||||||
|
FINAL
|
||||||
|
FIRST
|
||||||
|
FLOAT
|
||||||
|
FLOAT4
|
||||||
|
FLOAT8
|
||||||
|
FLOOR
|
||||||
|
FLUSH
|
||||||
|
FOLLOWING
|
||||||
|
FOR
|
||||||
|
FORCE
|
||||||
|
FOREIGN
|
||||||
|
FORTRAN
|
||||||
|
FORWARD
|
||||||
|
FOUND
|
||||||
|
FREE
|
||||||
|
FREETEXT
|
||||||
|
FREETEXTTABLE
|
||||||
|
FREEZE
|
||||||
|
FROM
|
||||||
|
FULL
|
||||||
|
FULLTEXT
|
||||||
|
FUNCTION
|
||||||
|
FUSION
|
||||||
|
G
|
||||||
|
GENERAL
|
||||||
|
GENERATED
|
||||||
|
GET
|
||||||
|
GLOBAL
|
||||||
|
GO
|
||||||
|
GOTO
|
||||||
|
GRANT
|
||||||
|
GRANTED
|
||||||
|
GRANTS
|
||||||
|
GREATEST
|
||||||
|
GROUP
|
||||||
|
GROUPING
|
||||||
|
HANDLER
|
||||||
|
HAVING
|
||||||
|
HEADER
|
||||||
|
HEAP
|
||||||
|
HIERARCHY
|
||||||
|
HIGH_PRIORITY
|
||||||
|
HOLD
|
||||||
|
HOLDLOCK
|
||||||
|
HOST
|
||||||
|
HOSTS
|
||||||
|
HOUR
|
||||||
|
HOUR_MICROSECOND
|
||||||
|
HOUR_MINUTE
|
||||||
|
HOUR_SECOND
|
||||||
|
IDENTIFIED
|
||||||
|
IDENTITY
|
||||||
|
IDENTITY_INSERT
|
||||||
|
IDENTITYCOL
|
||||||
|
IF
|
||||||
|
IGNORE
|
||||||
|
ILIKE
|
||||||
|
IMMEDIATE
|
||||||
|
IMMUTABLE
|
||||||
|
IMPLEMENTATION
|
||||||
|
IMPLICIT
|
||||||
|
IN
|
||||||
|
INCLUDE
|
||||||
|
INCLUDING
|
||||||
|
INCREMENT
|
||||||
|
INDEX
|
||||||
|
INDICATOR
|
||||||
|
INFILE
|
||||||
|
INFIX
|
||||||
|
INHERIT
|
||||||
|
INHERITS
|
||||||
|
INITIAL
|
||||||
|
INITIALIZE
|
||||||
|
INITIALLY
|
||||||
|
INNER
|
||||||
|
INOUT
|
||||||
|
INPUT
|
||||||
|
INSENSITIVE
|
||||||
|
INSERT
|
||||||
|
INSERT_ID
|
||||||
|
INSTANCE
|
||||||
|
INSTANTIABLE
|
||||||
|
INSTEAD
|
||||||
|
INT
|
||||||
|
INT1
|
||||||
|
INT2
|
||||||
|
INT3
|
||||||
|
INT4
|
||||||
|
INT8
|
||||||
|
INTEGER
|
||||||
|
INTERSECT
|
||||||
|
INTERSECTION
|
||||||
|
INTERVAL
|
||||||
|
INTO
|
||||||
|
INVOKER
|
||||||
|
IS
|
||||||
|
ISAM
|
||||||
|
ISNULL
|
||||||
|
ISOLATION
|
||||||
|
ITERATE
|
||||||
|
JOIN
|
||||||
|
K
|
||||||
|
KEY
|
||||||
|
KEY_MEMBER
|
||||||
|
KEY_TYPE
|
||||||
|
KEYS
|
||||||
|
KILL
|
||||||
|
LANCOMPILER
|
||||||
|
LANGUAGE
|
||||||
|
LARGE
|
||||||
|
LAST
|
||||||
|
LAST_INSERT_ID
|
||||||
|
LATERAL
|
||||||
|
LEADING
|
||||||
|
LEAST
|
||||||
|
LEAVE
|
||||||
|
LEFT
|
||||||
|
LENGTH
|
||||||
|
LESS
|
||||||
|
LEVEL
|
||||||
|
LIKE
|
||||||
|
LIMIT
|
||||||
|
LINENO
|
||||||
|
LINES
|
||||||
|
LISTEN
|
||||||
|
LN
|
||||||
|
LOAD
|
||||||
|
LOCAL
|
||||||
|
LOCALTIME
|
||||||
|
LOCALTIMESTAMP
|
||||||
|
LOCATION
|
||||||
|
LOCATOR
|
||||||
|
LOCK
|
||||||
|
LOGIN
|
||||||
|
LOGS
|
||||||
|
LONG
|
||||||
|
LONGBLOB
|
||||||
|
LONGTEXT
|
||||||
|
LOOP
|
||||||
|
LOW_PRIORITY
|
||||||
|
LOWER
|
||||||
|
M
|
||||||
|
MAP
|
||||||
|
MATCH
|
||||||
|
MATCHED
|
||||||
|
MAX
|
||||||
|
MAX_ROWS
|
||||||
|
MAXEXTENTS
|
||||||
|
MAXVALUE
|
||||||
|
MEDIUMBLOB
|
||||||
|
MEDIUMINT
|
||||||
|
MEDIUMTEXT
|
||||||
|
MEMBER
|
||||||
|
MERGE
|
||||||
|
MESSAGE_LENGTH
|
||||||
|
MESSAGE_OCTET_LENGTH
|
||||||
|
MESSAGE_TEXT
|
||||||
|
METHOD
|
||||||
|
MIDDLEINT
|
||||||
|
MIN
|
||||||
|
MIN_ROWS
|
||||||
|
MINUS
|
||||||
|
MINUTE
|
||||||
|
MINUTE_MICROSECOND
|
||||||
|
MINUTE_SECOND
|
||||||
|
MINVALUE
|
||||||
|
MLSLABEL
|
||||||
|
MOD
|
||||||
|
MODE
|
||||||
|
MODIFIES
|
||||||
|
MODIFY
|
||||||
|
MODULE
|
||||||
|
MONTH
|
||||||
|
MONTHNAME
|
||||||
|
MORE
|
||||||
|
MOVE
|
||||||
|
MULTISET
|
||||||
|
MUMPS
|
||||||
|
MYISAM
|
||||||
|
NAME
|
||||||
|
NAMES
|
||||||
|
NATIONAL
|
||||||
|
NATURAL
|
||||||
|
NCHAR
|
||||||
|
NCLOB
|
||||||
|
NESTING
|
||||||
|
NEW
|
||||||
|
NEXT
|
||||||
|
NO
|
||||||
|
NO_WRITE_TO_BINLOG
|
||||||
|
NOAUDIT
|
||||||
|
NOCHECK
|
||||||
|
NOCOMPRESS
|
||||||
|
NOCREATEDB
|
||||||
|
NOCREATEROLE
|
||||||
|
NOCREATEUSER
|
||||||
|
NOINHERIT
|
||||||
|
NOLOGIN
|
||||||
|
NONCLUSTERED
|
||||||
|
NONE
|
||||||
|
NORMALIZE
|
||||||
|
NORMALIZED
|
||||||
|
NOSUPERUSER
|
||||||
|
NOT
|
||||||
|
NOTHING
|
||||||
|
NOTIFY
|
||||||
|
NOTNULL
|
||||||
|
NOWAIT
|
||||||
|
NULL
|
||||||
|
NULLABLE
|
||||||
|
NULLIF
|
||||||
|
NULLS
|
||||||
|
NUMBER
|
||||||
|
NUMERIC
|
||||||
|
OBJECT
|
||||||
|
OCTET_LENGTH
|
||||||
|
OCTETS
|
||||||
|
OF
|
||||||
|
OFF
|
||||||
|
OFFLINE
|
||||||
|
OFFSET
|
||||||
|
OFFSETS
|
||||||
|
OIDS
|
||||||
|
OLD
|
||||||
|
ON
|
||||||
|
ONLINE
|
||||||
|
ONLY
|
||||||
|
OPEN
|
||||||
|
OPENDATASOURCE
|
||||||
|
OPENQUERY
|
||||||
|
OPENROWSET
|
||||||
|
OPENXML
|
||||||
|
OPERATION
|
||||||
|
OPERATOR
|
||||||
|
OPTIMIZE
|
||||||
|
OPTION
|
||||||
|
OPTIONALLY
|
||||||
|
OPTIONS
|
||||||
|
OR
|
||||||
|
ORDER
|
||||||
|
ORDERING
|
||||||
|
ORDINALITY
|
||||||
|
OTHERS
|
||||||
|
OUT
|
||||||
|
OUTER
|
||||||
|
OUTFILE
|
||||||
|
OUTPUT
|
||||||
|
OVER
|
||||||
|
OVERLAPS
|
||||||
|
OVERLAY
|
||||||
|
OVERRIDING
|
||||||
|
OWNER
|
||||||
|
PACK_KEYS
|
||||||
|
PAD
|
||||||
|
PARAMETER
|
||||||
|
PARAMETER_MODE
|
||||||
|
PARAMETER_NAME
|
||||||
|
PARAMETER_ORDINAL_POSITION
|
||||||
|
PARAMETER_SPECIFIC_CATALOG
|
||||||
|
PARAMETER_SPECIFIC_NAME
|
||||||
|
PARAMETER_SPECIFIC_SCHEMA
|
||||||
|
PARAMETERS
|
||||||
|
PARTIAL
|
||||||
|
PARTITION
|
||||||
|
PASCAL
|
||||||
|
PASSWORD
|
||||||
|
PATH
|
||||||
|
PCTFREE
|
||||||
|
PERCENT
|
||||||
|
PERCENT_RANK
|
||||||
|
PERCENTILE_CONT
|
||||||
|
PERCENTILE_DISC
|
||||||
|
PLACING
|
||||||
|
PLAN
|
||||||
|
PLI
|
||||||
|
POSITION
|
||||||
|
POSTFIX
|
||||||
|
POWER
|
||||||
|
PRECEDING
|
||||||
|
PRECISION
|
||||||
|
PREFIX
|
||||||
|
PREORDER
|
||||||
|
PREPARE
|
||||||
|
PREPARED
|
||||||
|
PRESERVE
|
||||||
|
PRIMARY
|
||||||
|
PRINT
|
||||||
|
PRIOR
|
||||||
|
PRIVILEGES
|
||||||
|
PROC
|
||||||
|
PROCEDURAL
|
||||||
|
PROCEDURE
|
||||||
|
PROCESS
|
||||||
|
PROCESSLIST
|
||||||
|
PUBLIC
|
||||||
|
PURGE
|
||||||
|
QUOTE
|
||||||
|
RAID0
|
||||||
|
RAISERROR
|
||||||
|
RANGE
|
||||||
|
RANK
|
||||||
|
RAW
|
||||||
|
READ
|
||||||
|
READS
|
||||||
|
READTEXT
|
||||||
|
REAL
|
||||||
|
RECHECK
|
||||||
|
RECONFIGURE
|
||||||
|
RECURSIVE
|
||||||
|
REF
|
||||||
|
REFERENCES
|
||||||
|
REFERENCING
|
||||||
|
REGEXP
|
||||||
|
REGR_AVGX
|
||||||
|
REGR_AVGY
|
||||||
|
REGR_COUNT
|
||||||
|
REGR_INTERCEPT
|
||||||
|
REGR_R2
|
||||||
|
REGR_SLOPE
|
||||||
|
REGR_SXX
|
||||||
|
REGR_SXY
|
||||||
|
REGR_SYY
|
||||||
|
REINDEX
|
||||||
|
RELATIVE
|
||||||
|
RELEASE
|
||||||
|
RELOAD
|
||||||
|
RENAME
|
||||||
|
REPEAT
|
||||||
|
REPEATABLE
|
||||||
|
REPLACE
|
||||||
|
REPLICATION
|
||||||
|
REQUIRE
|
||||||
|
RESET
|
||||||
|
RESIGNAL
|
||||||
|
RESOURCE
|
||||||
|
RESTART
|
||||||
|
RESTORE
|
||||||
|
RESTRICT
|
||||||
|
RESULT
|
||||||
|
RETURN
|
||||||
|
RETURNED_CARDINALITY
|
||||||
|
RETURNED_LENGTH
|
||||||
|
RETURNED_OCTET_LENGTH
|
||||||
|
RETURNED_SQLSTATE
|
||||||
|
RETURNS
|
||||||
|
REVOKE
|
||||||
|
RIGHT
|
||||||
|
RLIKE
|
||||||
|
ROLE
|
||||||
|
ROLLBACK
|
||||||
|
ROLLUP
|
||||||
|
ROUTINE
|
||||||
|
ROUTINE_CATALOG
|
||||||
|
ROUTINE_NAME
|
||||||
|
ROUTINE_SCHEMA
|
||||||
|
ROW
|
||||||
|
ROW_COUNT
|
||||||
|
ROW_NUMBER
|
||||||
|
ROWCOUNT
|
||||||
|
ROWGUIDCOL
|
||||||
|
ROWID
|
||||||
|
ROWNUM
|
||||||
|
ROWS
|
||||||
|
RULE
|
||||||
|
SAVE
|
||||||
|
SAVEPOINT
|
||||||
|
SCALE
|
||||||
|
SCHEMA
|
||||||
|
SCHEMA_NAME
|
||||||
|
SCHEMAS
|
||||||
|
SCOPE
|
||||||
|
SCOPE_CATALOG
|
||||||
|
SCOPE_NAME
|
||||||
|
SCOPE_SCHEMA
|
||||||
|
SCROLL
|
||||||
|
SEARCH
|
||||||
|
SECOND
|
||||||
|
SECOND_MICROSECOND
|
||||||
|
SECTION
|
||||||
|
SECURITY
|
||||||
|
SELECT
|
||||||
|
SELF
|
||||||
|
SENSITIVE
|
||||||
|
SEPARATOR
|
||||||
|
SEQUENCE
|
||||||
|
SERIALIZABLE
|
||||||
|
SERVER_NAME
|
||||||
|
SESSION
|
||||||
|
SESSION_USER
|
||||||
|
SET
|
||||||
|
SETOF
|
||||||
|
SETS
|
||||||
|
SETUSER
|
||||||
|
SHARE
|
||||||
|
SHOW
|
||||||
|
SHUTDOWN
|
||||||
|
SIGNAL
|
||||||
|
SIMILAR
|
||||||
|
SIMPLE
|
||||||
|
SIZE
|
||||||
|
SMALLINT
|
||||||
|
SOME
|
||||||
|
SONAME
|
||||||
|
SOURCE
|
||||||
|
SPACE
|
||||||
|
SPATIAL
|
||||||
|
SPECIFIC
|
||||||
|
SPECIFIC_NAME
|
||||||
|
SPECIFICTYPE
|
||||||
|
SQL
|
||||||
|
SQL_BIG_RESULT
|
||||||
|
SQL_BIG_SELECTS
|
||||||
|
SQL_BIG_TABLES
|
||||||
|
SQL_CALC_FOUND_ROWS
|
||||||
|
SQL_LOG_OFF
|
||||||
|
SQL_LOG_UPDATE
|
||||||
|
SQL_LOW_PRIORITY_UPDATES
|
||||||
|
SQL_SELECT_LIMIT
|
||||||
|
SQL_SMALL_RESULT
|
||||||
|
SQL_WARNINGS
|
||||||
|
SQLCA
|
||||||
|
SQLCODE
|
||||||
|
SQLERROR
|
||||||
|
SQLEXCEPTION
|
||||||
|
SQLSTATE
|
||||||
|
SQLWARNING
|
||||||
|
SQRT
|
||||||
|
SSL
|
||||||
|
STABLE
|
||||||
|
START
|
||||||
|
STARTING
|
||||||
|
STATE
|
||||||
|
STATEMENT
|
||||||
|
STATIC
|
||||||
|
STATISTICS
|
||||||
|
STATUS
|
||||||
|
STDDEV_POP
|
||||||
|
STDDEV_SAMP
|
||||||
|
STDIN
|
||||||
|
STDOUT
|
||||||
|
STORAGE
|
||||||
|
STRAIGHT_JOIN
|
||||||
|
STRICT
|
||||||
|
STRING
|
||||||
|
STRUCTURE
|
||||||
|
STYLE
|
||||||
|
SUBCLASS_ORIGIN
|
||||||
|
SUBLIST
|
||||||
|
SUBMULTISET
|
||||||
|
SUBSTRING
|
||||||
|
SUCCESSFUL
|
||||||
|
SUM
|
||||||
|
SUPERUSER
|
||||||
|
SYMMETRIC
|
||||||
|
SYNONYM
|
||||||
|
SYSDATE
|
||||||
|
SYSID
|
||||||
|
SYSTEM
|
||||||
|
SYSTEM_USER
|
||||||
|
TABLE
|
||||||
|
TABLE_NAME
|
||||||
|
TABLES
|
||||||
|
TABLESAMPLE
|
||||||
|
TABLESPACE
|
||||||
|
TEMP
|
||||||
|
TEMPLATE
|
||||||
|
TEMPORARY
|
||||||
|
TERMINATE
|
||||||
|
TERMINATED
|
||||||
|
TEXT
|
||||||
|
TEXTSIZE
|
||||||
|
THAN
|
||||||
|
THEN
|
||||||
|
TIES
|
||||||
|
TIME
|
||||||
|
TIMESTAMP
|
||||||
|
TIMEZONE_HOUR
|
||||||
|
TIMEZONE_MINUTE
|
||||||
|
TINYBLOB
|
||||||
|
TINYINT
|
||||||
|
TINYTEXT
|
||||||
|
TO
|
||||||
|
TOAST
|
||||||
|
TOP
|
||||||
|
TOP_LEVEL_COUNT
|
||||||
|
TRAILING
|
||||||
|
TRAN
|
||||||
|
TRANSACTION
|
||||||
|
TRANSACTION_ACTIVE
|
||||||
|
TRANSACTIONS_COMMITTED
|
||||||
|
TRANSACTIONS_ROLLED_BACK
|
||||||
|
TRANSFORM
|
||||||
|
TRANSFORMS
|
||||||
|
TRANSLATE
|
||||||
|
TRANSLATION
|
||||||
|
TREAT
|
||||||
|
TRIGGER
|
||||||
|
TRIGGER_CATALOG
|
||||||
|
TRIGGER_NAME
|
||||||
|
TRIGGER_SCHEMA
|
||||||
|
TRIM
|
||||||
|
TRUE
|
||||||
|
TRUNCATE
|
||||||
|
TRUSTED
|
||||||
|
TSEQUAL
|
||||||
|
TYPE
|
||||||
|
UESCAPE
|
||||||
|
UID
|
||||||
|
UNBOUNDED
|
||||||
|
UNCOMMITTED
|
||||||
|
UNDER
|
||||||
|
UNDO
|
||||||
|
UNENCRYPTED
|
||||||
|
UNION
|
||||||
|
UNIQUE
|
||||||
|
UNKNOWN
|
||||||
|
UNLISTEN
|
||||||
|
UNLOCK
|
||||||
|
UNNAMED
|
||||||
|
UNNEST
|
||||||
|
UNSIGNED
|
||||||
|
UNTIL
|
||||||
|
UPDATE
|
||||||
|
UPDATETEXT
|
||||||
|
UPPER
|
||||||
|
USAGE
|
||||||
|
USE
|
||||||
|
USER
|
||||||
|
USER_DEFINED_TYPE_CATALOG
|
||||||
|
USER_DEFINED_TYPE_CODE
|
||||||
|
USER_DEFINED_TYPE_NAME
|
||||||
|
USER_DEFINED_TYPE_SCHEMA
|
||||||
|
USING
|
||||||
|
UTC_DATE
|
||||||
|
UTC_TIME
|
||||||
|
UTC_TIMESTAMP
|
||||||
|
VACUUM
|
||||||
|
VALID
|
||||||
|
VALIDATE
|
||||||
|
VALIDATOR
|
||||||
|
VALUE
|
||||||
|
VALUES
|
||||||
|
VAR_POP
|
||||||
|
VAR_SAMP
|
||||||
|
VARBINARY
|
||||||
|
VARCHAR
|
||||||
|
VARCHAR2
|
||||||
|
VARCHARACTER
|
||||||
|
VARIABLE
|
||||||
|
VARIABLES
|
||||||
|
VARYING
|
||||||
|
VERBOSE
|
||||||
|
VIEW
|
||||||
|
VOLATILE
|
||||||
|
WAITFOR
|
||||||
|
WHEN
|
||||||
|
WHENEVER
|
||||||
|
WHERE
|
||||||
|
WHILE
|
||||||
|
WIDTH_BUCKET
|
||||||
|
WINDOW
|
||||||
|
WITH
|
||||||
|
WITHIN
|
||||||
|
WITHOUT
|
||||||
|
WORK
|
||||||
|
WRITE
|
||||||
|
WRITETEXT
|
||||||
|
X509
|
||||||
|
XOR
|
||||||
|
YEAR
|
||||||
|
YEAR_MONTH
|
||||||
|
ZEROFILL
|
||||||
|
ZONE
|
2
_includes/sql/naming_conventions.sql
Normal file
2
_includes/sql/naming_conventions.sql
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
SELECT first_name
|
||||||
|
FROM staff;
|
7
_includes/sql/naming_correlations.sql
Normal file
7
_includes/sql/naming_correlations.sql
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
SELECT first_name AS fn
|
||||||
|
FROM staff AS s1
|
||||||
|
JOIN students AS s2
|
||||||
|
ON s2.mentor_id = s1.staff_num;
|
||||||
|
|
||||||
|
SELECT SUM(s.monitor_tally) AS monitor_total
|
||||||
|
FROM staff AS s;
|
3
_includes/sql/syntax_reserved_keywords.sql
Normal file
3
_includes/sql/syntax_reserved_keywords.sql
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
SELECT model_num
|
||||||
|
FROM phones AS p
|
||||||
|
WHERE p.release_date > '2014-09-30';
|
13
_includes/sql/syntax_spacing.sql
Normal file
13
_includes/sql/syntax_spacing.sql
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
-- No
|
||||||
|
SELECT a.release_date,a.title
|
||||||
|
FROM albums AS a
|
||||||
|
WHERE a.title='Charcoal Lane'OR
|
||||||
|
a.title='The New Danger';
|
||||||
|
|
||||||
|
|
||||||
|
-- Yes
|
||||||
|
SELECT a.release_date,
|
||||||
|
a.title
|
||||||
|
FROM albums AS a
|
||||||
|
WHERE a.title = 'Charcoal Lane'
|
||||||
|
OR a.title = 'The New Danger';
|
198
index.html
198
index.html
|
@ -2,6 +2,204 @@
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<section class="row overview">
|
||||||
|
<div class="col">
|
||||||
|
<h2>Overview</h2>
|
||||||
|
<p>
|
||||||
|
You can use this set of guidelines, <a href="">fork 'em</a> or make your own - the
|
||||||
|
key here is that you pick a style and stick to it. To suggest changes
|
||||||
|
or fix bugs please open an <a href="">issue</a> or <a href="">pull request</a> on Git Hub.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="heading" id="general">
|
||||||
|
<h2>General</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Avoid the use of</h3>
|
||||||
|
<ul>
|
||||||
|
<li>CamelCase—it is difficult to scan quickly</li>
|
||||||
|
<li>Descriptive prefixes or Hungarian notation such as <code>sp_</code> or <code>tbl</code></li>
|
||||||
|
<li>Plurals—use the more natural collective term instead</li>
|
||||||
|
<li>Quoted identifiers—if you must use them then stick to SQL92 double quotes for portability</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="heading" id="general">
|
||||||
|
<h2>Syntax</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Reserved words</h3>
|
||||||
|
<p>Always use uppercase for the <a href="#keyword-reference">reserved keywords</a> like <code>SELECT</code> and <code>WHERE</code>.</p>
|
||||||
|
<p>It is best to avoid the abbreviated keywords and use the full length ones where available (prefer <code>ABSOLUTE</code> to <code>ABS</code>).</p>
|
||||||
|
<p>Do not use database server specific keywords where an ANSI SQL keyword already exists performing the same function. This helps to make code more portable.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/syntax_reserved_keywords.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Indentation</h3>
|
||||||
|
<p>Use four (4) spaces all the way through all the time. This makes the most sense where there is a sub query.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/syntax_indentation.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>White space</h3>
|
||||||
|
<p>To make the code easier to read it is important that the correct compliment of spaces is used. Do not crowd code or remove natural spaces.</p>
|
||||||
|
<p>Always include spaces (this is not an exhaustive list):</p>
|
||||||
|
<ul>
|
||||||
|
<li>before and after equals (<code>=</code>)</li>
|
||||||
|
<li>after commas (<code>,</code>)</li>
|
||||||
|
<li>surrounding apostrophes (<code>'</code>) where not within parentheses or with a trailing comma or semicolon</li>
|
||||||
|
</ul>
|
||||||
|
<p>Always include newlines/vertical space:</p>
|
||||||
|
<ul>
|
||||||
|
<li>after semicolons to separate queries for easier reading</li>
|
||||||
|
<li>after each keyword definition</li>
|
||||||
|
<li>after the comma of each column in the list</li>
|
||||||
|
<li>before <code>AND</code> or <code>OR</code>
|
||||||
|
</ul>
|
||||||
|
<p>Keeping all the keywords aligned to the righthand side and the values left aligned creates a uniform gap down the middle of query. It makes it much easier to scan the query definition over quickly too.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/syntax_spacing.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="heading" id="naming-conventions">
|
||||||
|
<h2>Naming conventions</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>General</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Ensure the name is unique and does not exist as a <a href="#keyword-reference">reserved keyword</a></li>
|
||||||
|
<li>Keep the length to a maximum of 30 bytes—in practice this is 30 characters unless you are using multibyte charset</li>
|
||||||
|
<li>Names must begin with a letter and may not end with an underscore</li>
|
||||||
|
<li>Only use letters, numbers and underscores in names</li>
|
||||||
|
<li>Avoid the use of multiple consecutive underscores—these can be hard to read</li>
|
||||||
|
<li>Use underscores where you would naturally include a space in name (first name becomes <code>first_name</code>)<li>
|
||||||
|
<li>Avoid abbreviations and if you have to use them make sure they are commonly understood</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Tables</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Use a collective name or, less ideally, a plural form. For example (in order of preference) staff and employees.</li>
|
||||||
|
<li>Do not prefix with <code>tbl</code> or any other such descriptive prefix or Hungarian notation</li>
|
||||||
|
<li>Never give a table the same name as one of its columns</li>
|
||||||
|
<li>Avoid, where possible, concatenating two table names together to create the name of a relationship table. Rather than <code>car_mechanic</code> prefer <code>service</code></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Columns</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Always use the singular name</li>
|
||||||
|
<li>Avoid simply using <code>id</code> as the primary identifier for the table</li>
|
||||||
|
<li>Do not add a column with the same name as its table</li>
|
||||||
|
<li>Always use lowercase except where it may make sense not to such as proper nouns</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Aliasing or correlations</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Should relate in some way to the object or expression they are aliasing</li>
|
||||||
|
<li>As rule of thumb the correlation name should be the first letter of each word in the object's name</li>
|
||||||
|
<li>If there is already a correlation with same name then append a number</li>
|
||||||
|
<li>Always include the <code>AS</code> keyword—makes it easier to read as it is explicit</li>
|
||||||
|
<li>For computed data (<code>SUM()</code> or <code>AVG()</code>) use the name you would give it were it a column defined in the schema</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_correlations.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Stored procedures</h3>
|
||||||
|
<ul>
|
||||||
|
<li>The name must contain a verb</li>
|
||||||
|
<li>Do not prefix with <code>sp_</code> or any other such descriptive prefix or Hungarian notation</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="row">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Uniform postfixes</h3>
|
||||||
|
<ul>
|
||||||
|
<li><code>_id</code>—a unique identifier such as a column that is a primary key</li>
|
||||||
|
<li><code>_status</code>—flag value or some other status of any type such as <code>publication_status</code>
|
||||||
|
<li><code>_total</code>—the total or sum of a collection of values</li>
|
||||||
|
<li><code>_name</code>—signifies a name such as <code>first_name</code></li>
|
||||||
|
<li><code>_seq</code>—contains a contiguous sequence of values</li>
|
||||||
|
<li><code>_date</code>—denotes a column that contains the date of something</li>
|
||||||
|
<li><code>_tally</code>—a count</li>
|
||||||
|
<li><code>_size</code>—the size of something such as a file size or clothing</li>
|
||||||
|
<li><code>_addr</code>—an address for the record could be physical or intangible such as <code>ip_addr</code></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight sql %}{% include sql/naming_conventions.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="heading" id="appendices">
|
||||||
|
<h2>Appendices</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section class="row" id="keyword-reference">
|
||||||
|
<div class="col">
|
||||||
|
<h3>Reserved keyword reference</h3>
|
||||||
|
<p>A list of ANSI SQL 92, ANSI SQL 99, ANSI SQL 2003, MySQL 3.23.x, MySQL 4.x, MySQL 5.x, PostGreSQL 8.1, MS SQL Server 2000, MS ODBC, Oracle 10.2 reserved keywords.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
{% highlight SQL %}{% include sql/appendices_reserved_keywords.sql %}{% endhighlight %}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<p>body of the site is here</p>
|
<p>body of the site is here</p>
|
||||||
|
|
||||||
{% highlight sql %}{% include sql/test.sql %}{% endhighlight %}
|
{% highlight sql %}{% include sql/test.sql %}{% endhighlight %}
|
||||||
|
|
68
style.css
68
style.css
|
@ -2,4 +2,72 @@
|
||||||
layout: nil
|
layout: nil
|
||||||
---
|
---
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Begin styles from codeguide.co by @mdo
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
@media (min-width: 48em) {
|
||||||
|
html {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
font: 1rem/1.5 "PT Sans", sans-serif;
|
||||||
|
color: #5a5a5a;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The Grid
|
||||||
|
*/
|
||||||
|
|
||||||
|
.col {
|
||||||
|
padding: 2rem 1rem;
|
||||||
|
}
|
||||||
|
.col p {
|
||||||
|
max-width: 40rem;
|
||||||
|
}
|
||||||
|
.col + .col {
|
||||||
|
border-top: 1px solid #dfe1e8;
|
||||||
|
background-color: #f7f7f9;
|
||||||
|
}
|
||||||
|
@media (min-width: 38em) {
|
||||||
|
.col {
|
||||||
|
padding: 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (min-width: 48em) {
|
||||||
|
.row {
|
||||||
|
display: table;
|
||||||
|
width: 100%;
|
||||||
|
table-layout: fixed;
|
||||||
|
}
|
||||||
|
.col {
|
||||||
|
display: table-cell;
|
||||||
|
padding: 3rem;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
.col + .col {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
border-bottom: 1px solid #dfe1e8;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
End styles from codeguide.co by @mdo
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
{% include syntax.css %}
|
{% include syntax.css %}
|
||||||
|
|
Loading…
Reference in a new issue