Apply for Zend Framework Certification Training

Mysql Questions




<pre>
<strong>31. How can we get the number of rows affected by query?
Number of rows can be obtained by
SELECT COUNT (user_id) FROM users;
SELECT COUNT (user_id) FROM users;

32.  Is Mysql query is case sensitive?
No.
SELECT VERSION(), CURRENT_DATE;
SeLect version(), current_date;
seleCt vErSiOn(), current_DATE;
SELECT VERSION(), CURRENT_DATE;
SeLect version(), current_date;
seleCt vErSiOn(), current_DATE;
All these examples are same. It is not case sensitive.

33. What is the difference between the LIKE and REGEXP operators?  
LIKE and REGEXP operators are used to express with ^ and %.
SELECT * FROM employee WHERE emp_name REGEXP &quot;^b&quot;;
SELECT * FROM employee WHERE emp_name LIKE &quot;%b&quot;;
SELECT * FROM employee WHERE emp_name REGEXP &quot;^b&quot;;
SELECT * FROM employee WHERE emp_name LIKE &quot;%b&quot;;

34. What is the difference between BLOB AND TEXT?
A BLOB is a binary large object that can hold a variable amount of data. 
There are four types of BLOB &ndash;
TINYBLOB
BLOB
MEDIUMBLOB and
LONGBLOB
They all differ only in the maximum length of the values they can hold.
A TEXT is a case-insensitive BLOB. The four TEXT types
TINYTEXT
TEXT
MEDIUMTEXT and
LONGTEXT
They all correspond to the four BLOB types and have the same maximum 
lengths and storage requirements.
The only difference between BLOB and TEXT types is that sorting and 
comparison is performed in case-sensitive for BLOB values and 
case-insensitive for TEXT values.

35. What is the difference between mysql_fetch_array and mysql_fetch_object?
Following are the differences between mysql_fetch_array and mysql_fetch_object:
mysql_fetch_array() -Returns a result row as an associated array 
or a regular array from database.
mysql_fetch_object &ndash;  Returns a result row as object from database.

36. How can we run batch mode in mysql?
Following commands are used to run in batch mode:
mysql ;
mysql mysql.out
mysql ;
mysql mysql.out
 
37. Where MyISAM table will be stored and also give their formats of storage?
Each MyISAM table is stored on disk in three formats:
The &lsquo;.frm&rsquo; file stores the table definition
The data file has a &lsquo;.MYD&rsquo; (MYData) extension
The index file has a &lsquo;.MYI&rsquo; (MYIndex) extension

38. What are the different tables present in MySQL?
Total 5 types of tables are present:
MyISAM
Heap
Merge
INNO DB
ISAM
MyISAM is the default storage engine as of MySQL .

39. What is ISAM?
ISAM  is abbreviated as Indexed Sequential Access Method.
It was developed by IBM to store and retrieve data on secondary
storage systems like tapes.

40. What is InnoDB?
lnnoDB is a transaction safe storage engine developed by 
Innobase Oy which is a Oracle Corporation now.                </strong></pre>
                                    

< Mysql Questions Part 3 Mysql Questions Part 5 >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top