What is MySQL?
MySQL is a multithreaded, multi-user SQL Open source database management system which is built, supported and distributed by MySQL AB (now acquired by Oracle)
What are the technical features of MySQL?
MySQL database software is a client or server system which includes
- Multithreaded SQL server supporting various client programs and libraries
- Different backend
- Wide range of application programming interfaces and
- Administrative tools
What are the technical specification of MySQL?
MySQL has the following technical specifications
- Flexible structure
- High performance
- Manageable and easy to use
- Replication and high availability
- Security and storage management
Why MySQL is used?
MySQL database server is reliable, fast and very easy to use. This software can be downloaded as freeware and can be downloaded from the internet.
What are Heap tables?
HEAP tables are present in memory and they are used for high speed storage on temporary basis.
- BLOB or TEXT fields are not allowed
- Only comparison operators can be used =, <,>, = >,=<
- AUTO_INCREMENT is not supported by HEAP tables
- Indexes should be NOT NULL
What is the default port for MySQL Server?
The default port for MySQL server is 3306
What are the advantages of MySQL when compared with Oracle?
- MySQL is open source software which is available at any time and has no cost involved
- MySQL is portable
- GUI with command prompt
- Administration is supported using MySQL Query Browser
What are the Differences between FLOAT and DOUBLE?
- Floating point numbers are stored in FLOAT with eight place accuracy and it has four bytes
- Floating point numbers are stored in DOUBLE with accuracy of 18 places and it has eight bytes
Differentiate CHAR_LENGTH and LENGTH?
CHAR_LENGTH is character count whereas the LENGTH is byte count. The numbers are same for Latin characters but they are different for Unicode and other encodings.
How to represent ENUMs and SETs internally?
ENUMs and SETs are used to represent powers of two because of storage optimizations.
What is the usage of ENUMs in MySQL?
ENUM is a string object used to specify set of predefined values and that can be used during table creation.
REGEXP is a pattern match in which matches pattern anywhere in the search value.
Give string types available for column?
The string types are:
What storage engines are used in MySQL?
Storage engines are called table types and data is stored in files using various techniques Technique involves:
- Storage mechanism
- Locking levels
- Capabilities and functions
What are the drivers in MySQL?
Following are the drivers available in MySQL:
- PHP Driver
- JDBC Driver
- ODBC Driver
- C WRAPPER
- PYTHON Driver
- PERL Driver
- RUBY Driver
- CAP11PHP Driver
What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?
TIMESTAMP column is updated with Zero when the table is created. UPDATE CURRENT_TIMESTAMP modifier updates the timestamp field to current time whenever there is a change in other fields of the table.
What is the difference between primary key and candidate key?
Every row of a table is identified uniquely by primary key. There is only one primary key for a table. Primary Key is also a candidate key. By common convention, candidate key can be designated as primary and which can be used for any foreign key references.
How do you login to MySQL using UNIX shell?
We can login through this command:
# [mysql dir]/bin/mysql -h hostname -u -p
What does myisamchk do?
It compress the MyISAM tables, which reduces their disk or memory usage.
How do you control the max size of a HEAP table?
Maximum size of Heal table can be controlled by MySQL config variable called max_heap_table_size.
What is the difference between MyISAM Static and MyISAM Dynamic?
In MyISAM static all the fields will have fixed width. The Dynamic MyISAM table will have fields like TEXT, BLOB, etc. to accommodate the data types with various lengths. MyISAM Static would be easier to restore in case of corruption.
What are federated tables?
Federated tables which allow access to the tables located on other databases on other servers.
What, if a table has one column defined as TIMESTAMP?
Timestamp field gets the current timestamp whenever the row gets altered.
What happens when the column is set to AUTO INCREMENT and if you reach maximum value in the table?
It stops incrementing. Any further inserts are going to produce an error, since the key has been used already.
How can we find out which auto increment was assigned on Last insert?
LAST_INSERT_ID will return the last value assigned by Auto_increment and it is not required to specify the table name.
How can you see all indexes defined for a table?
Indexes are defined for the table by:
SHOW INDEX FROM ;
What do you mean by % and _ in the LIKE statement?
% corresponds to 0 or more characters, _ is exactly one character in the LIKE statement.
How can we convert between UNIX & MySQL timestamps?
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
What are the column comparisons operators?
The = , <>, <=, <, >=, >,<<,>>, <=>, AND, OR, or LIKE operators are used in column comparisons in SELECT statements.
What is the difference 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 – Returns a result row as object from database.
Where MyISAM table will be stored and also give their formats of storage?
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
What are the different tables present in MySQL?
Total 5 types of tables are present:
- INNO DB
MyISAM is the default storage engine as of MySQL
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.
What is InnoDB?
lnnoDB is a transaction safe storage engine developed by Innobase Oy which is a Oracle Corporation now.
How to enter Characters as HEX Numbers?
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.
How many columns can be used for creating Index?
Maximum of 16 indexed columns can be created for any standard table.
What is the different between NOW() and CURRENT_DATE()?
NOW () command is used to show current year, month, date with hours, minutes and seconds.
CURRENT_DATE() shows current year, month and date only.
What are the objects can be created using CREATE statement?
Following objects are created using CREATE statement:
How many TRIGGERS are allowed in MySQL table?
SIX triggers are allowed in MySql table. They are as follows:
- BEFORE INSERT
- AFTER INSERT
- BEFORE UPDATE
- AFTER UPDATE
- BEFORE DELETE
- AFTER DELETE
What are the nonstandard string types?
Following are Non-Standard string types:
How do you backup a database in MySQL?
It is easy to backing up data with phpMyAdmin. Select the database you want to back up by clicking the database name in the left hand navigation bar. Then click the export button and make sure that all tables are highlighted that you want to backup. Then specify the option you want under export and save the output.
In how many ways we can retrieve the data in the result set of MySQL using PHP?
You can do it by 4 Ways