![idatabase relational idatabase relational](https://miro.medium.com/max/1400/0*Va1FMu_W9-sVYUzx.jpg)
Let's illustrate with an example: a table customers contains columns lastName, firstName, phoneNumber, address, city, state, zipCode. You should use as few columns as possible. But it could also make up of several columns. Primary key is usually a single column (e.g., customerID or productCode).Unlike factual information such as phone number, fact-less number is ideal for primary key, as it does not change. This arbitrary number is fact-less, as it contains no factual information. Most RDBMSs support so-called auto-increment (or AutoNumber type) for integer primary key, where (current maximum value + 1) is assigned to the new record. Primary key could take an arbitrary number.However, it is best to use numeric column as primary key for efficiency. But it could also be other types, such as texts. Primary key often uses integer (or number) type.
![idatabase relational idatabase relational](https://www.rnibbookshare.org/cover/Rw/Rw3KyAzea0182RnNRYgV1xYVQZhhFfML-F2UOmIuLLw-MEDIUM.jpg)
For example, phoneNumber may not be appropriate to be used as primary key for table Customers, because it might change. If you change its value, you have to change all its references otherwise, the references will be lost. Primary key is used to reference other tables.
IDATABASE RELATIONAL FREE
There are also many free and open-source RDBMS, such as MySQL, mSQL (mini-SQL) and the embedded JavaDB (Apache Derby).Ī relational database organizes data in tables (or relations). Today, there are many commercial Relational Database Management System (RDBMS), such as Oracle, IBM DB2 and Microsoft SQL Server. It has since become the dominant database model for commercial applications (in comparison with other database models such as hierarchical, network and object models). Relational database was proposed by Edgar Codd (of IBM Research) around 1969. A Quick-Start Tutorial on Relational Database Design Introduction