Mysql formatter3/12/2023 It is best to avoid the abbreviated keywords and use the full length ones whereĭo not use database server specific keywords where an ANSI SQL keyword alreadyĮxists performing the same function. _addr-an address for the record could be physical or intangible such asĪlways use uppercase for the reserved keywords._size-the size of something such as a file size or clothing._date-denotes a column that contains the date of something._seq-contains a contiguous sequence of values._name-signifies a name such as first_name._num-denotes the field contains any kind of number._total-the total or sum of a collection of values._status-flag value or some other status of any type such as._id-a unique identifier such as a column that is a primary key.Use the correct suffix where appropriate. The following suffixes have a universal meaning ensuring the columns can be readĪnd understood easily from SQL code. Do not prefix with sp_ or any other such descriptive prefix or Hungarian.monitor_tally ) AS monitor_total FROM staff AS s Stored procedures For computed data ( SUM() or AVG()) use the name you would give it were it.Always include the AS keyword-makes it easier to read as it is explicit.If there is already a correlation with the same name then append a number.As a rule of thumb the correlation name should be the first letter of each word.Should relate in some way to the object or expression they are aliasing.Always use lowercase except where it may make sense not to such as proper nouns.Do not add a column with the same name as its table and vice versa.Where possible avoid simply using id as the primary identifier for the table.Rather than cars_mechanics prefer services. Avoid, where possible, concatenating two table names together to create the name.Never give a table the same name as one of its columns and vice versa.Do not prefix with tbl or any other such descriptive prefix or Hungarian.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |