Questions tagged [naming-convention]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14 votes
2 answers
3k views

Should I call my UUID primary key column ID or not?

I'm working on a database design that extensively uses UUIDs for PRIMARY KEYs. However, this confronts me with a very consequential choice. How do I name these columns? I would call them uuid, except ...
  • 317
1 vote
1 answer
403 views

Naming conventions for views and materialized views: "*_v", "v_*", "*_mv", "mv_*" or none? [closed]

My view stores quality metrics for various gizmos1 in the database. Today I designed it to be a view. In a few years, as we produce more gizmos, it may need to be changed to a materialized view. I was ...
0 votes
1 answer
230 views

Best practice for SQL table names when using sub namespaces that exceed maximum table name length

I have a MySQL database that includes many tables named according to a namespace that uses sub names and underscores (_ as in a_b_c), such as the following: life_domain_kingdom_phylum ...
  • 134
0 votes
1 answer
202 views

What does the "wi" stand for in SQL Azure Automatic Index Naming? [closed]

I have a SQL Database on Azure that is giving me a performance recommendation for an index. What does the "wi" part of the name? I'm guessing something to do with the include part of the ...
1 vote
1 answer
107 views

Proper name for reference tables in OLTP

I know this might be a silly question. But I really appreciate accepting and answering this question. When I have an OLTP database with some big tables like orders and items. I have other tables (...
  • 123
0 votes
1 answer
83 views

How to name tables which are responsible for storing dictionaries and configuration?

Below I attached diagram which corresponds to part of my database : My questions: In your opininon Do I have to divide ServiceInsance and ConfServiceInstance ? I did it like that because I would ...
  • 101
1 vote
0 answers
595 views

How to properly name a database table

First of all, I understand this question may seem opinion-based, but I know there are some standards for naming conventions and I would like to know which is the best and why. It's not so complex ...
  • 111
0 votes
1 answer
435 views

created_at vs meaningful db column name , or both? [closed]

I need often to store the datetime of an action. For example, for a customer order, "processed_at" would be a right name. However I need all my tables to have a created_at/updated_at fields for ...
  • 378
0 votes
0 answers
29 views

Is it possible to have SQL server look for entities under other schemas than DBO when the schema name isn't specified in the query? [duplicate]

Not sure if this is a thing, and I understand it's better practice to write your queries using the two-part naming convention, but it would be cool if SQL Server had a way to setup a schema priority ...
  • 26.6k
2 votes
1 answer
168 views

Can we change Log Shipping backup file naming convention

Seems the Log Shipping backup files naming convention (especially the date-time stamp in the name) is followed by UTC time, i believe that is default and standard. I would like to clarify on ...
  • 2,309
10 votes
2 answers
17k views

Should I not use camelCase in my column names?

I am creating a GraphQL API using Node.js, which foces me to return all the field names in camelCase. In my PostgreSQL database, I currently have all my columns named following a camelCase convention,...
1 vote
3 answers
92 views

Best name to name a table [closed]

The project I am currently working request me to name the tables to something like: df_cmn_aum_xx_typ_cur instead of something like courses. Are there some known standards or best practices to ...
  • 111
0 votes
2 answers
74 views

Is there a good reason to put the company name at the beginning of the table names? [closed]

When developing a new system, for a big corporation. Technologies: Web, Java, Spring Boot, Rest Api, Postgres, Hibernate Company: Bank System: Promissory control, and all others Company name: ...
  • 103
4 votes
2 answers
13k views

PostgreSQL naming conventions

Maybe double post but I could not find any answer here. I saw couple of posts how to name my tables and I understood that (semi-officially) it should contain lower cases, should be underscored and ...
1 vote
0 answers
35 views

Redundancy in table names / Table naming convensions

I am creating some templates in my database that users would be able to use to help set up some of their data. For example, I have the following tables (simplified of course): store (id, store_name)...
  • 151
3 votes
2 answers
796 views

SQL table with same name as catalog view

When naming tables in SQL I try to stay away from SQL reserved keywords, but today a colleague questioned the use of Events as a table name. They said, anything that turns green in SSMS shouldn't be ...
  • 133
0 votes
0 answers
92 views

Schema Master, Schema, Scheme - table name/design help

I’m stuck! 3 table names. Schema Master, Schema, Scheme. They are too confusing for me I always get them mixed up.... Any ideas on how to name better? I also maybe designing this database ...
2 votes
1 answer
2k views

Naming Convention for Login, User and Roles? [closed]

What are the Naming Conventions for a Login, A database User and a Database role? Is there any best practice to follow?
  • 131
0 votes
2 answers
1k views

Column names - (created, modified) vs. (creation, modification) [closed]

I have a database schema where all the tables are required to have a column to hold the timestamp for the initial INSERT and another column that holds the timestamp of the last UPDATE. Initially this ...
  • 107
0 votes
2 answers
2k views

Can any database table name support double quotes "?

I need to know whether any database supports double quotes as a part of their table name. I am especially interested in JDBC compliant databases. And if they do, can I please know how?
0 votes
1 answer
767 views

How to name tables such as "Suppliers Categories" [closed]

I am refactoring a very old DB (< 2001) migrating from MyISAM to InnoDB and I experience some issues with the CamelCase notation. I don't know why but with the use of MySQL Workbench, sometime, my ...
  • 123
0 votes
1 answer
165 views

How do I fix the naming of columns in Metabase?

Metabase currently imports the column names and tries to figure out the wording. This convention is fundamentally broken in my schema. For example, when it scans my PostgreSQL database it'll bring in ...
  • 57.3k
0 votes
0 answers
30 views

What is the naming convention where column names are prefixed by chars indicating the data type?

I work on a database where column names are prefixed by a character representing the datatype of the column. I quite like this, because it's easy to see at a glance what type of data each column holds....
  • 2,222
0 votes
1 answer
239 views

Comparing SQL binary data types

I am curious if there are any major differences with performance and/or conventionality regarding which binary data types one chooses. Let's say I have a table of metallic objects and I am considering ...
0 votes
0 answers
19 views

Name of attributes that are indirectly related to entity

If I have a set of data that relate to an entity directly and some that do not, is there a standard name for these two types of attributes? example, Employee: employeeID firstname lastname manager ...
1 vote
0 answers
129 views

ERD mostly in text

In LaTeX I can replicate database tables similar to the ones in the diagram below, but I do not want to deal with figuring out how to nicely draw the relation diagrams between the tables. Is there an ...
  • 111
1 vote
1 answer
904 views

Recommended user ID column names to use

I use user IDs a lot in tables, and I would like to find out when naming these columns, what's the best way to go about naming them. Should you be specific to what the user ID is, or should you keep ...
  • 113
7 votes
2 answers
13k views

MySQL database naming convention?

Is there any convention for database names in MySQL/MariaDB? I've searched Google and this Stack Exchange and haven't been able to find anything. Not even a "Nope, there's no official convention." Is ...
  • 173
2 votes
1 answer
219 views

Does the SQL-1992 standard restrict naming identifiers to 18 characters?

In this draft of SQL:1992, I found… Section 5.2 Leveling Rules .... The following restrictions apply for Entry SQL in addition to any Intermediate SQL restrictions: a) No <...
2 votes
1 answer
249 views

Data modelling for specific units of measurement

I am currently adding a feature in our software where we save a timeout in the database to initialize cronjobs which get active after that timeout. To model this I see different ways but can't say ...
  • 121
6 votes
3 answers
7k views

What is the significance of the trailing dollar sign `$` on identifiers in SQL Server?

Dumping some internal views, such as sys.system_objects as done in this question I see that some identifiers end with a dollar-sign $ CREATE VIEW sys.system_objects AS -- cutout FROM sys....
  • 57.3k
5 votes
2 answers
453 views

Is there a name for the class of characters represented by [] in SQL Server?

I am interested in the terminology for the characters you can put around table names, column names, etc. when referencing them in a query. A name that in Microsoft SQL Server would be for []s and in ...
3 votes
4 answers
7k views

MySQL similar name for status or type column

As status and type is reserved key in MySQL, I need a column name similar to status to identify the status of a row. I know there is way to ignore this problem but in different language and different ...
0 votes
1 answer
53 views

What's the recommended way to handle naming collisions with the PK column? [closed]

I have a data field "Shipment ID" which is a VARCHAR(18) from a number of different vendors. This is going into a table shipment with a surrogate PK shipment_id. I'm trying to figure out the best way ...
  • 105
10 votes
1 answer
444 views

Issue with Table Naming Conventions and Policy Management in SQL Server 2016

In SQL Server 2012, I had a policy set to not allow spaces in a table name. However, when I use the same policy in SQL Server 2016, I get an error. Here is the code for the condition: DECLARE @...
  • 461
0 votes
2 answers
269 views

Change naming conventions in SQL Server

In SQL Server 2014 we need to change naming convention for indexes and keys. The old naming convention is not following any standards. My questions are: How can we change the naming convention for ...
  • 135
1 vote
1 answer
73 views

Naming convention for automated table outputs (processed with Python)

I have several tables that I process nightly with Python. For example, I have read-only access to an incidents table. I process the table with a specialized Python library called ArcPy. The script ...
  • 1,387
1 vote
1 answer
129 views

Dependency management by decoupling table name from table key

If I share a Google Spreadsheet with someone, I will share a link like this: https://docs.google.com/spreadsheets/d/1UL0Aii1aaErbUm6pdmZ_D9dsqx2p3BPZ5GHxz7TH37M/edit This means that I am free to ...
  • 1,145
3 votes
1 answer
7k views

CREATE VIEW as join between tables with identically named columns

As the title says, I'd like to create a view from a join between tables which have columns with identical names (surprisingly "id"). Postgres doesn't prepend the table name to the result, but for ...
  • 135
102 votes
18 answers
38k views

Is adding the ‘tbl’ prefix to table names really a problem?

I’m watching some Brent Ozar videos (like this one, for instance) and he suggests not prefixing tables with ‘tbl’ or ‘TBL’. On the internet I found some blogs saying it adds nothing to documentation,...
  • 7,156
1 vote
2 answers
784 views

How to Apply a Title-Case RegEx Condition for Object Names with Policy Based Management

I'm implementing PBM on a SQL Server 2014 instance and want to enforce a condition that all objects are created outside the dbo schema and all object names are created in title-case (i.e., OrderDetail)...
  • 1,913
2 votes
3 answers
2k views

Best name for link table [closed]

I was wondering what the best name for a linked table in this situation (or any) would be. I've searched for this, but could not find any concrete examples. For example, I have the following tables (...
  • 133
1 vote
1 answer
194 views

Standard naming for a credential systems

Is there a standard naming convention in regards to credential oriented systems? (Logins) The only one I could really come up with (in a shorthand form) is using the word "Gateway". Representing a ...
19 votes
2 answers
7k views

Naming conflict between function parameter and result of JOIN with USING clause

Given this setup in current Postgres 9.4 (from this related question): CREATE TABLE foo (ts, foo) AS VALUES (1, 'A') -- int, text , (7, 'B'); CREATE TABLE bar (ts, bar) AS VALUES (3, 'C') ...
1 vote
1 answer
1k views

How do I open an ERwin Naming Standards file (.nsm) in Excel?

I have a Naming Standards file in ERwin (.nsm format) that I want to be able to open up in Excel (for example, in order to compare 2 .nsm files). How would I be able to do that?
1 vote
1 answer
95 views

Comparing the contents of 2 .nsm (naming standards) files

I have 2 naming standards files from ERwin (.nsm extension), and I want to compare them to see if they contain the same rules. Is there some sort of automated way to check this? If there isn't a way ...
0 votes
1 answer
90 views

Naming a second additional column referencing another table column?

I'm working with a table in database that references to a column in another table. Such as: Product Table ------------ Id Description Currencies_Code Currencies ------------ Id Code Description We ...
3 votes
1 answer
3k views

What problems would using the reserved keywords DATE and TIME as column names cause in Oracle?

DATE is an SQL Reserved Word and TIME is a PL/SQL Reserved Word in Oracle (listed in SQL> HELP RESERVED WORDS). What problems would using them as column names cause in Oracle? The database server ...
1 vote
1 answer
1k views

Which terms are used to refer a row in database?

I am creating a Java application, in which I want to create a class that will relate to a row in database. I decided to use Entity while naming the class with a prefix/suffix. But, This page says: ...
  • 113
0 votes
1 answer
164 views

How to reference a table called `\` (simply just backslash character) in MySQL in a query?

Through some unknown circumstances I have a table called "\" in a database. mysql> show tables like '\\'; +-----------------------------+ | Tables_in_in_realestate (\) | +--------------------------...
  • 123