Are you an SQL programmer that, like many, came to SQL after learning and writing procedural or object-oriented code? Or have switched jobs to where a different brand of SQL is being used, or maybe even been told to learn SQL yourself? If even one answer is yes, then you need this book. A "Manual of Style" for the SQL programmer, this book is a collection of heuristics and rules, tips, and tricks that will help you improve SQL programming style and proficiency, and for formatting and writing portable, readable, maintainable SQL code. Based on many years of experience consulting in SQL shops, and gathering questions and resolving his students’ SQL style issues, Joe Celko can help you become an even better SQL programmer. + Help you write Standard SQL without an accent or a dialect that is used in another programming language or a specific flavor of SQL, code that can be maintained and used by other people. + Enable you to give your group a coding standard for internal use, to enable programmers to use a consistent style. + Give you the mental tools to approach a new problem with SQL as your tool, rather than another programming language — one that someone else might not know! Front cover Title page Copyright page Table of contents front matter Introduction 1.1 Purpose of the Book 1.2 Acknowledgments 1.3 Corrections, Comments, and Future Editions First chapter 1. Names and Data Elements 1.1 Names 1.1.1 Watch the Length of Names 1.1.2 Avoid All Special Characters in Names 1.1.3 Avoid Quoted Identifiers 1.1.4 Enforce Capitalization Rules to Avoid Case- Sensitivity Problems 1.2 Follow the ISO-11179 Standards Naming Conventions 1.2.1 ISO-11179 for SQL 1.2.2 Levels of Abstraction 1.2.3 Avoid Descriptive Prefixes 1.2.4 Develop Standardized Postfixes. 1.2.5 Table and View Names Should Be Industry Standards, Collective, Class, or Plural Nouns1.2.6 Correlation Names Follow the Same Rules as Other Names ... Almost 1.2.7 Relationship Table Names Should Be Common Descriptive Terms 1.2.8 Metadata Schema Access Objects Can Have Names That Include Structure Information 1.3 Problems in Naming Data Elements 1.3.1 Avoid Vague Names 1.3.2 Avoid Names That Change from Place to Place 1.3.3 Do Not Use Proprietary Exposed Physical Locators 2. Fonts, Punctuation, and Spacing 2.1 Typography and Code. 2.1.1 Use Only Upper- and Lowercase Letters, Digits, and Underscores for Names2.1.2 Lowercase Scalars Such as Column Names, Parameters, and Variables 2.1.3 Capitalize Schema Object Names 2.1.4 Uppercase the Reserved Words 2.1.5 Avoid the Use of CamelCase 2.2 Word Spacing 2.3 Follow Normal Punctuation Rules 2.4 Use Full Reserved Words 2.5 Avoid Proprietary Reserved Words if a Standard Keyword Is Available in Your SQL Product 2.6 Avoid Proprietary Statements if a Standard Statement Is Available 2.7 Rivers and Vertical Spacing 2.8 Indentation 2.9 Use Line Spacing to Group Statements. 3. Data Declaration Language3.1 Put the Default in the Right Place 3.2 The Default Value Should Be the Same Data Type as the Column 3.3 Do Not Use Proprietary Data Types 3.4 Place the PRIMARY KEY Declaration at the Start of the CREATE TABLE Statement 3.5 Order the Columns in a Logical Sequence and Cluster Them in Logical Groups 3.6 Indent Referential Constraints and Actions under the Data Type 3.7 Give Constraints Names in the Production Code 3.8 Put CHECK() Constraint Near what they Check 3.8.1 Consider Range Constraints for Numeric Values. 3.8.2 Consider LIKE and SIMILAR TO Constraints for Character Values3.8.3 Remember That Temporal Values Have Duration 3.8.4 REAL and FLOAT Data Types Should Be Avoided 3.9 Put Multiple Column Constraints as Near to Both Columns as Possible 3.10 Put Table-Level CHECK() Constraints at the End of the Table Declaration 3.11 Use CREATE ASSERTION for Multi-table Constraints 3.12 Keep CHECK() Constraints Single Purposed 3.13 Every Table Must Have a Key to Be a Table 3.13.1 Auto-Numbers Are Not Relational Keys 3.13.2 Files Are Not Tables 3.13.3 Look for the Properties of a Good Key.
Learn about the SQL/PSM standard from the author of Understanding the New SQL
Written by a leading contributor to the development of the SQL standard, Understanding SQL Stored Procedures introduces readers to the concepts of SQL stored procedures and how they are implemented in a variety of DBMSs. The author also teaches how to best apply the powerful storage features of PSM-96, which allow you to store SQL code in a database and execute it directly within the DBMS.
Using practical and interesting examples to illustrate the power of stored procedures, Understanding SQL Stored Procedures offers readers complete coverage of the language's features as well as practical advice on how to best take advantage of them in database application programming. A final section is devoted to a discussion of the next generation of SQL/PSM.
Features:
- Complete, practical coverage of all the features of the SQL/PSM standard in an easy-to-find format (allows use as a reference)
- Supplements syntax of language elements with "railroad diagrams" to better illustrate how the elements of this language work together
- Utilizes a real-life application as a running example of the language features
Written for database product and tool developers, application programmers, and database administrators and analysts, Understanding SQL Stored Procedures will help users better apply SQL/PSM.
"...offers complete coverage of the SQL/PSM standard in an easy-to-find format and provides real-life application... an essential resource written by a leading contributor to the development of the SQL standard."
Are you an SQL programmer that, like many, came to SQL after learning and writing procedural or object-oriented code? Or have switched jobs to where a different brand of SQL is being used, or maybe even been told to learn SQL yourself?
If even one answer is yes, then you need this book. A "Manual of Style" for the SQL programmer, this book is a collection of heuristics and rules, tips, and tricks that will help you improve SQL programming style and proficiency, and for formatting and writing portable, readable, maintainable SQL code. Based on many years of experience consulting in SQL shops, and gathering questions and resolving his students’ SQL style issues, Joe Celko can help you become an even better SQL programmer.
- Help you write Standard SQL without an accent or a dialect that is used in another programming language or a specific flavor of SQL, code that can be maintained and used by other people.
- Enable you to give your group a coding standard for internal use, to enable programmers to use a consistent style.
- Give you the mental tools to approach a new problem with SQL as your tool, rather than another programming language - one that someone else might not know!
If even one answer is yes, then you need this book. A "Manual of Style" for the SQL programmer, this book is a collection of heuristics and rules, tips, and tricks that will help you improve SQL programming style and proficiency, and for formatting and writing portable, readable, maintainable SQL code. Based on many years of experience consulting in SQL shops, and gathering questions and resolving his students' SQL style issues, Joe Celko can help you become an even better SQL programmer. More specifically, this book will give you expert advice from a noted SQL guru and award-winning columnist and will: Help you write Standard SQL without an accent or a dialect that is used in another programming language or a specific flavor of SQL, code that can be maintained and used by other people, Enable you to give your group a coding standard for internal use, to enable programmers to use a consistent style, Give you the mental tools to approach a new problem with SQL as your tool, rather than another programming language-one that someone else might not know! Are you an SQL programmer that, like many, came to SQL after learning and writing procedural or object-oriented code? Or have switched jobs to where a different brand of SQL is being used, or maybe even been told to learn SQL yourself? If even one answer is yes, then you need this book. A "Manual of Style" for the SQL programmer, this book is a collection of heuristics and rules, tips, and tricks that will help you improve SQL programming style and proficiency, and for formatting and writing portable, readable, maintainable SQL code. Based on many years of experience consulting in SQL shops, and gathering questions and resolving his students?TM SQL style issues, Joe Celko can help you become an even better SQL programmer. + Help you write Standard SQL without an accent or a dialect that is used in another programming language or a specific flavor of SQL, code that can be maintained and used by other people. + Enable you to give your group a coding... Annotation Are you an SQL programmer that, like many, came to SQL after learning and writing procedural or object-oriented code? Or have switched jobs to where a different brand of SQL is being used, or maybe even been told to learn SQL yourself? If even one answer is yes, then you need this book. A "Manual of Style" for the SQL programmer, this book is a collection of heuristics and rules, tips, and tricks that will help you improve SQL programming style and proficiency, and for formatting and writing portable, readable, maintainable SQL code. Based on many years of experience consulting in SQL shops, and gathering questions and resolving his students' SQL style issues, Joe Celko can help you become an even better SQL programmer Annotation;Front cover; Title page; Copyright page; Table of contents; front matter; Introduction; 1.1 Purpose of the Book; 1.2 Acknowledgments; 1.3 Corrections, Comments, and Future Editions; First chapter; 1. Names and Data Elements; 1.1 Names; 1.1.1 Watch the Length of Names; 1.1.2 Avoid All Special Characters in Names; 1.1.3 Avoid Quoted Identifiers; 1.1.4 Enforce Capitalization Rules to Avoid Case- Sensitivity Problems; 1.2 Follow the ISO-11179 Standards Naming Conventions; 1.2.1 ISO-11179 for SQL; 1.2.2 Levels of Abstraction; 1.2.3 Avoid Descriptive Prefixes; 1.2.4 Develop Standardized Postfixes. Vers 210 av. J.-C. Qin Shi Huangdi, Premier empereur de Chine, se prpare disparatre pour toujours. bord d'un gigantesque navire, il prend la route pour une terre inconnue et, peut-tre, la vie ternelle... 2020. Kendall Kjlsrud, le fantasque milliardaire, runit nouveau l'quipe commando de K2 Industries. sa tte, Caleb McKay et Poppy Borghese, deux soldats d'lite aux capacits hors normes. Leur mission : retrouver le mausole de Qin Shi Huangdi. Et si les Chinois avaient t les premiers dcouvrir l'Amrique ? This text presents the basic concepts and foundations of SQL/PSM, a standard for database procedural language extensions. It offers complete coverage of all the features of SQL/PSM and is formatted for easy use as a reference. YOUR DATA WILL not come when it is called either if you do not give it a name that is always distinct and recognizable.