Question:- How Can You See All Indexes Defined For A Table?
Answer:- Indexes are defined for the table by: SHOW INDEX FROM ;
Question:- What Do You Mean By % And _in The LIKE Statement?
Answer:- % corresponds to 0 or more characters, _ is exactly one character in the LIKE statement.
Question:- How Can We Convert Between Unix & MySQL Timestamps?
Answer:- • UNIX_TIMESTAMP is the command which converts from MySQL timestamp to Unix timestamp • FROM_UNIXTIME is the command which converts from Unix timestamp to MySQL timestamp.
Question:- What Are The Column Comparisons Operators?
Answer:- The = , < > , <=, <, >=, >, <<,>>, <=> , AND, OR, or LIKE operators are used in column comparisons in SELECT statements.
Question:- How Can We Get The Number Of Rows Affected By Query?
Answer:- Number of rows can be obtained by SELECT COUNT (user_id) FROM users;
Question:- Is MySQL Query Case Sensitive?
Answer:- No, its not. • SELECT VERSION(), CURRENT_DATE; • seleCt vErsion(), current_DATE; • SeLect version(), current_date; All these examples are the same. It is not case sensitive.
Question:- What Is The Difference Between The LIKE And REGEXP Operators?
Answer:- LIKE and REGEXP operators are used to express ^ and %. • SELECT * FROM employee WHERE emp_name REGEXP “^b”; • SELECT * FROM employee WHERE emp_name LIKE “%b”.
Question:- What Is The Difference Between Mysql_fetch_array And Mysql_fetch_object?
Answer:- Following are the differences between mysql_fetch_array and mysql_fetch_object: • mysql_fetc_array() – Returns a result row as an associated array or a regular array from the database. • Mysql_fetch_object – Returns as a result row as object from database.
Question:- How Can We Run Batch Mode In MySQL?
Answer:- Following commands are used to run in batch mode: Mysql; Mysql mysql.out
Question:- Where Will MyISAM Tables Be Stored And Also Give Their Formats Of Storage?
Answer:- Each MyISAM table is stored on disk in three formats: • The .frm file stores the table definition • The data file has a .MYD (MYData) extension • The index file has a .MYI (MYIndex) extension
Question:- What Is ISAM?
Answer:- ISAM is abbreviated as Indexed Sequential Access Method. It was developed by IBM to store and retrieve data on secondary storage systems like tapes.
Question:- What Is InnoDB?
Answer:- InnoDB is a transaction-safe storage engine developed by innobase, which is an Oracle Corporation now.
Question:- How MySQL Optimizes DISTINCT?
Answer:- DISTINCT is converted to a GROUP BY on all columns and it will be combined with the ORDER BY clause. SELECT DISTINCT t1.a FROM t1,t2 where t1.a=t2.a;
Question:- How To Enter Characters As HEX Numbers?
Answer:- If you want to enter characters as HEX numbers, you can enter HEX numbers with single quotes and a prefix of (X), or just prefix HEX numbers with (OX). A HEX number string will be automatically converted into a character string if the expression context is a string.
