Tag: keys

Tip #8 – Setting Your Own Names for Primary Key

Sometimes the naming convention you use requires a specific pattern for the primary keys’ names. That’s why you may want to set your own names for each primary key in your database model instead of using default ones. Go on reading to get to know how to do this in Vertabelo .To give your own name to a primary key, select the table that contains the primary key you want to name:

Tip #6 – How to Create a Multicolumn Primary Key

Primary keys may contain more than one column. Multicolumn primary keys are frequently used for junction tables, which are used to model many-to-many relationships.Select a table: In theTable propertiespanel on the right, check all the columns that you want inside the key: Now, you have a multicolumn primary key created: You can check out your SQL code by clicking theSQL previewbutton in the top right corner:

Tip #4 – How to Make a Column Unique

Sometimes there are columns in a table that don’t belong to primary key, but are still unique. To mark them as a unique, you have to create an alternate (unique) key containing it.Single-column alternate (unique) keySelect the table with the column you want to make a unique. Then, click theAlternate (unique) keytab in theTable propertiespanel on the right: ClickAdd key: Click thedown arrowto show the properties: Find the column you want to make a unique and add it to the key:

Tips for Better Database Design

Over the years, working as a data modeler and database architect, I have noticed that there are a couple rules that should be followed during data modeling and development. Here I describe some tips in the hope that they might help you. I have listed the tips in the order that they occur during the project lifecycle rather than listing them by importance or by how common they are.1. Plan Ahead

The Boyce-Codd Normal Form (BCNF)

Why do you need all of this normalization stuff? The main goal is toavoid redundancyin your data. Redundancy can lead to various anomalies when you modify your data .Every fact should be stored only onceand you should know where to look for each fact. The normalization process brings order to your filing cabinet. You decide to conform to certain rules where each fact is stored.Nowadays the go-to normal forms are either the

On Keys

Today we continue our series of posts on data normalization. In the previous post on data normalization I explained what functional dependency is. Today we will talk aboutcandidate keysin a table.A candidate key is a set of columns such thatall other columns in the table are dependent on it, and the set isminimal, that is if you remove a column, then the resulting set is not a candidate key.Example: Table Person