Re: Newbie question about BIGINT and INT in the same table

From: ^Bart <gabriele1NOSPAM_at_hotmail.com>
Date: Sun, 27 Oct 2019 09:05:28 +0100
Message-ID: <qp3j47$1nqf$1_at_gioia.aioe.org>


> Only if cities.id_city is a BIGINT. The type of id_user is irrelevant.

[Quoted] If I have something like this:

id_user (BIGINT) age (INT)


1            		1
2             		2
...             	...

18446744073709551615 4294967295

Should be the field age BIGINT like id_user? Should they have the same lenght (both INT or both BIGINT)?

When I add the user 4294967296 it will not be able to add a value in age field because 4294967296 is over quota of INT but it's available for BIGINT...
> A FK data type must match the column it is referencing.

[Quoted] Yes, I know it, it was the first error I made when I started to create a DB (lol! :D).

> Cheers
> Tony

Regards.
^Bart Received on Sun Oct 27 2019 - 09:05:28 CET

Original text of this message