If I check both shared and unversioned checkboxes in a template, what will happen? I knew difference between shared and unversioned. Want to know final result of checking both field in template.
In reality, you have only 3 options. However the combination of checkboxes gives you 4.
A versioned field (default)
This acts like one would expect. The field can have multiple values and multiple versions of a value; for multiple languages.
The Unversioned Field
Essentially this field gets 1 version per language, so the designation "Unversioned" is a little misleading. However there will be only 1 version of the field per language, not multiple versions within a language.
The Shared Field
Only one version of this field exists, across language versions.
This leaves out the last combination:
The Shared Unversioned Field
Now one could argue; that in theory it could make sense to have multiple versions of a shared field, but then have the field value propagate across language versions.
However, on a Data Provider level this just isn't possible. There are also areas of the Sitecore UI that would make this approach unworkable.
To find out why, I refer you to Yan Sklyarenko's post Back to Basics: Versioned, Unversioned and Shared Fields, where he explains that field values in Sitecore is essentially stored in one of 3 different tables:
When selecting field values, Sitecore executes a JOIN statement across these 3. A field value will therefore only be selected from 1 of the above.
This is also reflected in the UI of Sitecore Rocks, where this setting is presented as a Dropdown choice.
Shared is therefore a superset of Unversioned
So to answer your question:
Setting both boxes will make your field be Shared. Unversioned is ignored.
This last article describes the processes that happen under the hood in Sitecore, when you check and uncheck these boxes. A data migration process essentially takes place, moving field values around between the 3 above mentioned tables.