Let suppose you are working as a database controller in a renowned company which has a huge database system that change recurrently. A lot of transactions, searches and DML operations are being processed daily. It is obvious that these operations facilities are being provided by different types of query languages.
Following are the two cases;
For above mentioned cases, you are asked to create columns (table) of database with suitable data types meeting to the following conditions.
Suggest the suitable Data Types, NCHAR, NVARCHAR, CHAR and VARCHAR, for the above mentioned situations with reasoning; so that the retrieval of information from the column (tables) would be fast enough.
Note: In the above scenario you only read from columns (table) and not write to columns (table).
For every situation explain your answer with suitable arguments.
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)
NCHAR is "Double Byte" and no need for unicode as per point 1, how will u deal with performance?
same case NVARCHAR is performance hit.
u will have to use collate with VARCHAR (column level collate) and CHAR for point 1 where no unicode and fixed length
hi sir i have question for u that VARCHAR is used for non-unicode characters and in question statement it is clear that you have to use fixed-length Unicode characters like Japanese, Chinese, French, Arabic and so on characters and also in second statement we have to store Unicode or multilingual , so how we can use varchar in these statements???
simple answer is that it is COLLATE which allow you to use unicode with varchar
ALTER TABLE yourtable ALTER
COLUMN account_name varchar(10)COLLATE Latin1_General_CI_AS NOT NULL;
here you can use Arabic_CI which i mentioned in my first comment
and u can see detail about collate there as well
if any one has objection please look into the Internationalization PDF i shared with previous replies
for fixed length non unicdoe u can use CHAR
if you use NVARCHAR its performance hit i mentioned couple of time.
we are using same solution for our banking product being used in middle east, africa and pakistan
ab finally post kiya karna hai yea bhe batadein ;P
final post plz mujhe to ab tk kuch samj nhi aya
• NCHAR and NVARCHAR can store Unicode characters.
• CHAR and VARCHAR cannot store Unicode characters.
• CHAR and NCHAR are fixed-length which will reserve storage space for number of characters you specify even if you don't use up all that space.
• VARCHAR and NVARCHAR are variable-length which will only use up spaces for the characters you store. It will not reserve storage like CHAR or NCHAR.
final solution kisi pass hai tu share kr den
true friend wala ko edit karo....or kam chalo
true friend waly pe to 2 major objection hian, agar ksi k pass uska answer hy to must wohi use kary :)
see anila rasool message and my reply on that agar ksi ko thori c b DB ki samjh hy :)
thanks Awais jutt. much appreciated