ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Databases >> MySQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions (2040)
 SQL Server interview questions  SQL Server Interview Questions (1079)
 MS Access interview questions  MS Access Interview Questions (25)
 MySQL interview questions  MySQL Interview Questions (194)
 Postgre interview questions  Postgre Interview Questions (6)
 Sybase interview questions  Sybase Interview Questions (22)
 DB Architecture interview questions  DB Architecture Interview Questions (5)
 DB Administration interview questions  DB Administration Interview Questions (213)
 DB Development interview questions  DB Development Interview Questions (53)
 SQL PLSQL interview questions  SQL PLSQL Interview Questions (775)
 Databases AllOther interview questions  Databases AllOther Interview Questions (107)
Question
What is the difference between char and varchar data types?
 Question Submitted By :: MySQL
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
char is used for fixed length memory storage whereas varchar
is used for variable lenght memory storage.
Fox Example if we have char(10) then we can store 10 bit
value in it but if we store only 6 bit value in it then rest
of the 4 bit space is goes wasted. this limitation is
overcome by varchar.
In varchar if we use less space than define space the rest
of space is not wasted.
 
Is This Answer Correct ?    346 Yes 20 No
Dinesh Goyal
 
Answer
# 2
The char is a fixed-length character data type, the varchar
is a variable-length character data type.

Because char is a fixed-length data type, the storage size
of the char value is equal to the maximum size for this
column. Because varchar is a variable-length data type, the
storage size of the varchar value is the actual length of
the data entered, not the maximum size for this column.

You can use char when the data entries in a column are
expected to be the same size.
You can use varchar when the data entries in a column are
expected to vary considerably in size.
 
Is This Answer Correct ?    81 Yes 6 No
Preeti Singh
 
 
 
Answer
# 3
The char is a fixed-length character data type, the varchar is a variable-length character data type.

Because char is a fixed-length data type, the storage size of the char value is equal to the maximum size for this column. Because varchar is a variable-length data type, the storage size of the varchar value is the actual length of the data entered, not the maximum size for this column.

You can use char when the data entries in a column are expected to be the same size.
You can use varchar when the data entries in a column are expected to vary considerably in size.
 
Is This Answer Correct ?    48 Yes 6 No
Paras Nath
 
Answer
# 4
i m totally aggred with answer no 1 so my answer will be also like that 
Is This Answer Correct ?    1 Yes 0 No
Sonu Kumar
 
Answer
# 5
char stores only character values whereas varchar can
stores alphanumerics values. searching is faster in char in
comparision of varchar
 
Is This Answer Correct ?    52 Yes 76 No
Deven Verma
 
Answer
# 6
no 
Is This Answer Correct ?    40 Yes 85 No
Kav
 

 
 
 
Other MySQL Interview Questions
 
  Question Asked @ Answers
 
What is Inner Joints and Outer Joints ? What is right outer joints,left outer joints,right inner joints , left inner joints , HP 2
What does TIMESTAMP ON UPDATE CURRENT_TIMESTAMP data type do?   1
I have two sql database at different PC.how can link b/w database and database tables.   2
Explain TIMESTAMP DEFAULT ?2006:09:02 17:38:44′ ON UPDATE CURRENT_TIMESTAMP.   1
what is the querry for all managers salary?   2
how many table created when we create a table in mysql?   3
What are some good ideas regarding user security in MySQL?   2
For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number ?1234?. The query should be able to run under a MySQL 4.0 database.   1
What is maximum size of a database in MySQL? V2-Solutions 13
Please suggest me any course and institute which provide training on the below skills. Knowledge of data extraction concepts and tools QMF (query management facility)queries Experience and expertise in QMF queries Excellent ability to write, read, and interpret QMF queries against the Source Data Warehouse base level (daily and monthly) and month-end affinity comp tables RDBMS & ER Knowledge of Relational Databases (RDBMS) and Entity Relationship (ER) Diagrams SOURCE Data Warehouse Experience and expertise in Source Data Warehouse or data warehouses on the mainframe. MS SQL Server Experience in MS SQL Server Excellent skill in writing/interpreting SQL queries and running Data Transformation Services (DTS) or open query packages. Knowledge of writing/interpreting Visual Basic code.   1
What is the difference between mysql_connect() and mysql_pconnect()? TCS 7
how to display only 4 records from a table based on a condition for ex i have a table called products in that nid,prodname are fields i want to display only any 4 records of perticular product plz tell me   6
 
For more MySQL Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com