How many sub-domain are allowed for an Email Id? - subdomain

How many subdomains are possible for an Email address?
For Example: something#something.co.uk.uk
like that....

There isn't any constraints based on subdomain count.
There is limitation of lengths parts of e-mail address in RFC821
user
The maximum total length of a user name is 64 characters.
domain
The maximum total length of a domain name or number is 64 characters.
path
The maximum total length of a reverse-path or forward-path is 256 characters (including the punctuation and element separators).
limitations in RFC2821
local-part
The maximum total length of a user name or other local-part is 64
characters.
domain
The maximum total length of a domain name or number is 255
characters.
and newest in RFC5321
4.5.3.1.1. Local-part
The maximum total length of a user
name or other local-part is 64
octets.
4.5.3.1.2. Domain
The maximum total length of a
domain name or number is 255 octets.
4.5.3.1.3. Path
The maximum total length of a
reverse-path or forward-path is 256
octets (including the punctuation and
element separators).

Related

Is this a Valid Email "xyz#abc.com.com.com.com"? [duplicate]

How many subdomains are possible for an Email address?
For Example: something#something.co.uk.uk
like that....
There isn't any constraints based on subdomain count.
There is limitation of lengths parts of e-mail address in RFC821
user
The maximum total length of a user name is 64 characters.
domain
The maximum total length of a domain name or number is 64 characters.
path
The maximum total length of a reverse-path or forward-path is 256 characters (including the punctuation and element separators).
limitations in RFC2821
local-part
The maximum total length of a user name or other local-part is 64
characters.
domain
The maximum total length of a domain name or number is 255
characters.
and newest in RFC5321
4.5.3.1.1. Local-part
The maximum total length of a user
name or other local-part is 64
octets.
4.5.3.1.2. Domain
The maximum total length of a
domain name or number is 255 octets.
4.5.3.1.3. Path
The maximum total length of a
reverse-path or forward-path is 256
octets (including the punctuation and
element separators).

what is the max limit of mysql int 11?

I read that you can specify the max limit of int to be 11. Why is this if in 4294967295 there are only 10 digits?
It is the "display width", not the maximum storage size. That means it can take ten characters to write the digits and perhaps one character for a minus sign in the negative case, so 11 characters are the most necessary to write the integer.
For more info, see:
http://waynewhitty.ie/blog-post.php?id=19
and
https://blogs.oracle.com/jsmyth/entry/what_does_the_11_mean

What MySQL data type should be used for xsd:anyURI?

I have a parameter that i wish to store into my MySQL database.
Here is the description of the parameter :
Parameter Name : endUserId
Type : xsd:anyURI
Max Length : 256
Description : The format is 'tel:' followed by '+' and followed by the phone number
for e.g. tel: +22507588125 , The endUserId in the URL must be the same and URL-escaped, i.e. tel%3A%2B22507588125
so what data type is suitable for the parameter 'endUserId' described above ?
Thanks
A maximum length of 256 is larger than required. I have never seen a phone number with more than, say, 15 digits. Under reasonable constraints, you could store the phone number as a BIGINT. Just store the numeric part, and format the output (append "tel:+") when only you read it.
You may also store the international prefix apart, i.e. a phone number would be stored in two numeric columns (one for the international prefix, another for the actual phone number -- I am told no phone number has a 0 after its international prefix).
If the max size of 256 is not negociable, then your only choice is VARCHAR.

MySQL char & varchar character sets & storage sizes

Wondering how much actual storage space will be taken up by these two datatypes, as the MySQL documentation is slightly unclear on the matter.
CHAR(M) M × w bytes, 0 <= M <= 255, where w is the number of bytes
required for the maximum-length character in the character set
VARCHAR(M), VARBINARY(M) L + 1 bytes if column values require 0 – 255
bytes, L + 2 bytes if values may require more than 255 bytes
This seems to imply to me that, given a utf8-encoded database, a CHAR will always take up 32 bits per character, whilst a VARCHAR will take between 8 and 32 depending on the actual byte length of the characters stored. Is that correct? Or does a VARCHAR imply an 8-bit character width, and storing multi-octet UTF8 characters actually consumes multiple 'characters' from the VARCHAR? Or does the VARCHAR also always store 32 bits per character? So many possibilities.
Not something I've ever had to worry this much about before, but I'm starting to hit in-memory temp table size limits and I don't necessarily want to have to increase MySQL's available pool (for the second time).
CHAR and VARCHAR both count characters. Both of them count the maximum storage that they might require given the character encoding and length. For ASCII, that's 1 byte per character. For UTF-8, that's 3 bytes per character (not 4 as you'd expect, because MySQL's Unicode support is limited for some reason, and it doesn't support any Unicode characters which would require 4 bytes in UTF-8). So far, CHAR and VARCHAR are the same.
Now, CHAR just goes ahead and reserves this amount of storage.
VARCHAR instead allocated 1 or 2 bytes, depending on whether this maximum storage is < 256 or ≥ 256. And the actual amount of space occupied by the entry is these one or two bytes, plus the amount of space actually occupied by the string.
Interestingly, this makes 85 a magic number for UTF-8 VARCHAR:
VARCHAR(85) uses 1 byte for the length because the maximum possible length of 85 UTF-8 characters is 3 × 85 = 255.
VARCHAR(86) uses 2 byte for the length because the maximum possible length of 86 UTF-8 characters is 3 × 86 = 258.

Why can't tinyint store more than the number 255 in MySQL?

If TINYINT can store three characters, for example, why can't it store up to the number 999?
Because it takes only 8 bit and hence can encode no more than 2^8 = 256 values.
The three characters you see in something like '123' are the result of the binary to decimal conversion. You cannot store arbitrary 3 characters there.
It is 8 bits and can actually store a maximum value of 255. 8 bits have 256 possible states including zero.