In article <[EMAIL PROTECTED]>, Jacek Becla <[EMAIL PROTECTED]> wrote:
> Keywords: DataAccWG > > > Hi, > > Now when we have several schemas written/changed by different groups > of people, it is becoming more and more apparent that we need > to start standardizing the way we code in SQL, name variable etc. > > Based on the schemas I saw so far and Maria's suggestions, > I tried to write down the first few rules. > > ================== > > Names of tables and columns should not include "_" or "-", > if multi-word, first words capitalized. > Table name should start with capital letter. Example: AmpImage. > Attribute name should start with small letter. Example: imageId > > > Avoid using short, common names like "id", instead, use more > descriptive names like "imageId, "sourceId" etc... Up to here everything sounds fine. > Use uppercase for reserved words. Example: INT, VARCHAR, PRIMARY KEY The reason UW's SQL looks this way is that is how EA exports it. > All constraints should have names, unique within given table. > Example: > CONSTRAINT fk_Filter_id FOREIGN KEY (filter) REFERENCES Filter (id) I agree that contsraints should be named. The names we used came out of EA; I didn't make them up and I'm not sure if EA even allows manual naming. > Define all constraints at the end of table definition, > not in the same line where the column defined. Again, this comes from EA and is not adjustable as far as I know. I completely agree that a standard for table and column naming is useful and yours sounds fine to me. I'm less sure it is useful for the other items, but at least if we have one, it had better be EA-compatible and I think your suggestions are. -- Rusell _______________________________________________ LSST-data mailing list [email protected] http://www.lsstmail.org/mailman/listinfo/lsst-data
