Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > it.comp.www.php > #22759

Re: [OT] Info su BIGINT, INT, etc.

From bramante <bramante@yopmail.com>
Newsgroups it.comp.www.php
Subject Re: [OT] Info su BIGINT, INT, etc.
Date 2019-11-01 17:18 +0100
Organization Aioe.org NNTP Server
Message-ID <qphls1$1ub4$1@gioia.aioe.org> (permalink)
References <qp1e4n$7sa$1@gioia.aioe.org> <qp29o1$7qg$1@gioia.aioe.org> <qphc6i$i2l$1@gioia.aioe.org> <qphd11$lt5$1@gioia.aioe.org>

Show all headers | View raw


Il 01/11/19 14:47, ^Bart ha scritto:
> Il 01/11/19 14:33, ^Bart ha scritto:
>>> no
>>
>> Ti ringrazio per la risposta e chiedo venia per le mie domande da 
>> newbie ma alle volte anche leggendo libri, manuali etc. qualche dubbio 
>> magari banale viene! :)
> 
> Ho trovato la suluzione qui: 
> https://stackoverflow.com/questions/5634104/what-is-the-size-of-column-of-int11-in-mysql-in-bytes 
> 
> 
> Morale della favola in un campo INT(10) UNSIGNED potrei scrivere un 
> numero fino a dieci cifre quindi 9999999999 per un totale di inserimenti 
> pari a 4294967295 valori!
> 
> Quindi facendo questa ipotesi di tabella:
> 
> users
> -------------------------------
> id_user name     personal_number
> 1    Peter   9991234569
> 2    John    2345435439
> 
> Nel caso volessi memorizzare personal_number come numero sarei costretto 
> ad usare lo stesso valore di id_user quindi per entrambi INT o per 
> entrambi BIGINT ed in generale sarebbe meglio usare l'opzione ZEROFILL 
> in modo che 1 diventi 0000000001 e che si possa quindi mettere in ordine 
> crescente/decrescente senza problemi.
> 

dipende...
se personal_number è univoco per ogni user allora si, puoi inserire al 
max il numero di righe dato dal valore massimo di int(10) unsigned e 
cioè 4294967295 righe, ma se personal_number non è univoco puoi inserire 
al max il numero di righe dato da id_user bigint(20) unsigned e cioè 
18446744073709551615 righe.


ma se il tuo caso è il primo, personal_number univoco, il campo user_id 
diventa inutile.
quale è secondo il tuo utilizzo lo scopo di user_id?

Saluti



> Saluti!
> ^Bart

Back to it.comp.www.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-10-26 14:28 +0200
  Re: [OT] Info su BIGINT, INT, etc. bramante <bramante@yopmail.com> - 2019-10-26 22:19 +0200
    Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-01 14:33 +0100
      Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-01 14:47 +0100
        Re: [OT] Info su BIGINT, INT, etc. bramante <bramante@yopmail.com> - 2019-11-01 17:18 +0100
          Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-02 13:29 +0100
            Re: [OT] Info su BIGINT, INT, etc. Alessandro Pellizzari <shuriken@amiran.it> - 2019-11-04 16:43 +0000
              Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-06 19:52 +0100
                Re: [OT] Info su BIGINT, INT, etc. Alessandro Pellizzari <shuriken@amiran.it> - 2019-11-09 10:38 +0000
  Re: [OT] Info su BIGINT, INT, etc. Leonardo Serni <lserni@gmail.com> - 2019-10-27 11:10 +0100
    Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-01 14:22 +0100
      Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-01 14:50 +0100
        Re: [OT] Info su BIGINT, INT, etc. Leonardo Serni <lserni@gmail.com> - 2019-11-04 00:02 +0100
          Re: [OT] Info su BIGINT, INT, etc. ^Bart <gabriele1NOSPAM@hotmail.com> - 2019-11-06 20:00 +0100
            Re: [OT] Info su BIGINT, INT, etc. Leonardo Serni <lserni@gmail.com> - 2019-11-08 15:56 +0100

csiph-web