Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A naming convention for the column intended exclusively for ordering

Say, we have a set of records that should be ordered with a non-trivial ordering method, e. g. natural sort or just in some specific sequence, defined by a user. We have to introduce a special column intended just for ordering.

Is there a more or less common convention for naming such columns? What names do you use?

like image 354
codeholic Avatar asked Jun 20 '10 21:06

codeholic


People also ask

What is the naming convention of a column?

The generic standards for the column naming are as follows: Column names must contain only A to Z, 0 to 9, and underscore (_) characters. Column names can contain multiple underscores. The column name must not be very generic.

What are naming conventions examples?

What is an example of a good naming convention? Good naming examples include: [Project number] - Data Use Agreement - [Title of research project] Approval - Change to employee travel policy - February 2014.

What is a naming convention in a database?

Naming conventions are a set of guideline that make strong foundations for such a consistent system. These guidelines ensure that the names of database entities are readable, easy to use in queries and do not collide with names of other defined entities or keywords.


2 Answers

I'd use SortOrder over sequence, for the sake that sequences are by some vendors (Oracle, PostgreSQL) to provide auto increment/identity functionality. SortOrder is more obvious/explicit about what the column is being used for.

like image 141
OMG Ponies Avatar answered Sep 28 '22 08:09

OMG Ponies


I have seen Sequence used as well as SortOrder. Personally I like Sequence better, as it implies uniqueness.

like image 33
Oded Avatar answered Sep 28 '22 06:09

Oded