MySQL is a multithreaded, multi-user SQL database management system which has more than 11 million installations.
It is the world's second most popular and widely-used open-source database.
Formerly MySQL was initially owned by a for-profit firm MySQL AB, then Sun Microsystems bought it, and then Oracle bought Sun Microsystems, so Oracle currently owns MySQL.
Using MySQL is free of cost for the developer, but enterprises have to pay a license fee to Oracle.
MySQL is an Oracle-supported Relational Database Management System (RDBMS) based on structured query language. MySQL supports a wide range of operating systems, most famous of those include Windows, Linux & UNIX.
Q2. What are some of the advantages of using MySQL?
Flexibility
Power
Enterprise-Level SQL Features
Full-Text Indexing and Searching
Configuration and Security
Query Caching
Replication
Q3. In which language MySQL has been written?
MySQL is written in C and C++, and its SQL parser is written in yacc.
Q4. What are the different tables types/storage engines present in MySQL?
MyISAM is the default database engine used in MySQL.
mysql> SHOW ENGINES;
Q5. What are the technical features of MySQL?
Multithreaded SQL server supporting various client programs and libraries
Different backend
Wide range of application programming interfaces
Administrative tools.
Q6. What is the default port number of MySQL?
The default port number of MySQL is 3306.
Q7. Disadvantages of MySQL?
MySQL is not very efficient in handling very large databases.
MySQL versions less than 5.0 do not support COMMIT, stored procedure and ROLEBACK.
MySQL doesn’t have as good a developing and debugging tool as compared to paid databases.
Transactions are not handled very efficiently.
Developers may find some of its limitations very frustrating.
Q8. What is the difference between TRUNCATE and DELETE in MySQL?
Truncate
Delete
TRUNCATE is a DDL command.
DELETE is a DML command.
It is not possible to use Where command with TRUNCATE.
You can use it with DELETE command.
TRUNCATE cannot be used with indexed views.
DELETE can be used with indexed views.
Truncate is a very dangerous command and should be used carefully because it deletes every row permanently from a table.
The DELETE command is used to delete data from a table. It only deletes the rows of data from the table.
Q9. What is the difference between MySQL_connect and MySQL_pconnect?
Mysql_connect
Mysql_pconnect
It opens a new connection to the database.
it opens the persistent connection.
Every time you need to open and close the database connection.
The database connection cannot be closed.
The mysql_close() method is used to close the connection with the database..
The mysql_close() does not close the connection with the database..
Due to its complex use, it is not much user-friendly.
Due to its simplicity, it is more user-friendly..
Q10. Can you tell what are the different set operations available in MySQL?
UNION – This operation returns all the distinct rows selected by a query
UNION ALL – This operation returns all the rows selected by a query and also includes all duplicate rows.
MINUS – This operation returns all the distinct rows selected by the first query but does not select the rows selected by the second query.
INTERSECT – This operation returns all the distinct rows selected by both queries.
Q11. What do you mean by databases?
A database is a structured collection of data stored in a computer system and organized in a way to be quickly searched. With databases, information can be rapidly retrieved.
Data is made up of small facts and information without context. If you give data context, then you have information. Knowledge is gained when information is consumed and used for decision making.
A database is an organized collection of related information.
Q12. What is the difference between MySQL and SQL?
SQL is known as the standard query language. It is used to interact with the database like MySQL. MySQL is a database that stores various types of data and keeps it safe.
A PHP script is required to store and retrieve the values inside the database.
SQL is a computer language, whereas MySQL is a software or an application
SQL is used for the creation of database management systems whereas MySQL is used to enable data handling, storing, deleting and modifying data
Q13. 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.
Q14. How can you find out the version of the installed MySQL?
mysql> SHOW VARIABLES LIKE “%version%”;
Q15. Can you tell the order of SQL SELECT statement?
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY;
Q16. What does a MySQL database contain?
A MySQL database contains one or more tables, each of which contains records or rows.
Within these rows are various columns or fields that contain the data itself.
Q17. What is the difference between the database and the table?
There is a major difference between a database and a table.
Tables are used to group the data in relation to each other and create a dataset. This dataset will be used in the database. The data stored in the table in any form is a part of the database, but the reverse is not true.
Tables are a way to represent the division of data in a database while the database is a collection of tables and data.
A database is a collection of organized data and features used to access them, whereas the table is a collection of rows and columns used to store the data.
Q18. What are Heap tables?
HEAP tables are present in memory and they are used for high speed storage on temporary.
Some key points as follows:
BLOB or TEXT fields are not allowed
AUTO_INCREMENT is not supported by HEAP tables
Indexes should be NOT NULL
Only comparison operators can be used =, <,>, = >,=<
Q19. Why do we use the MySQL database server?
First of all, the MYSQL server is free to use for developers and small enterprises..
MySQL's community is tremendous and supportive; hence any help regarding MySQL is resolved as soon as possible.
MySQL has very stable versions available, as MySQL has been in the market for a long time. All bugs arising in the previous builds have been continuously removed, and a very stable version is provided after every update.
MySQL server is open source
The MySQL database server is very fast, reliable, and easy to use. You can easily use and modify the software. MySQL software can be downloaded free of cost from the internet.
Q20. 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
Q21. What is the function of myisamchk?
myisamchk is a useful database utility tool that is used to get information about MyISAM database tables.
It is also used for checking, debugging, repairing and optimizing database tables. It is better to use this command when the server is down or when the required tables are not in use by the server.
myisamchk [OPTION] table_name…
myisamchk –help
myisamchk *.MYI
Q22. What are the advantages and disadvantages of using MySQL?
Advantages:
It is well-known for its reliable and secure database management system. Transactional tasks of the website can be done more securely by using this software.
It supports different types of storage engines to store the data and it works faster for this feature.
It can handle millions of queries with a high-speed transactional process.
It supports many advanced level database features, such as multi-level transactions, data integrity, deadlock identification, etc.
Maintenance and debugging processes are easier for this software.
Disadvantages:
It is hard to make MySQL scalable.
It is not suitable for a very large type of database.
The uses of stored routines and triggers are limited to MySQL.
Q23. What is Database White Box Testing?
The Database Whitebox Testing deals with the tables, data model, schema and referential integrity rules. It also deals with the triggers, logical views with database consistency and ACID properties.
Q24. How can you interact with MySQL?
There are three main ways you can interact with MySQ
using a command line
via a web interface
through a programming language
Q25. What are the different tables present in MySQL?
There are many tables that remain present by default. But, MyISAM is the default database engine used in MySQL.
MyISAM
Heap
Merge
INNODB
ISAM
Q26. Differentiate 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.
Q27. What are some of the common MySQL commands?
Alter
Delete
Drop
Insert
Show
Truncate
Update
use
Q28. What is the difference between CHAR and VARCHAR?
Char
Varchar
CHAR column length is fixed.
VARCHAR length is variable.
The maximum no. of character CHAR data types can hold is 255 characters.
VARCHAR can hold up to 4000 characters..
CHAR is 50% faster than VARCHAR.
Slower than CHAR.
CHAR uses static memory allocation.
VARCHAR uses dynamic memory allocation.
CHAR stands for Character.
VARCHAR stands for Variable Character.
Q29. What is the difference between primary key and candidate key?
Primary Key
Candidate key
Primary Key is a unique and non-null key which identify a record uniquely in table. A table can have only one primary key.
Candidate key is also a unique key to identify a record uniquely in a table but a table can have multiple candidate keys.
Primary key column value can not be null.
Candidate key column can have null value.
Primary key is most important part of any relation or table.
Candidate key refers to which key can be used as the primary key.
Primary Key is a candidate key.
Candidate key may or may not be a primary key.
Q30. What are the Numeric Data Types in MySQL?
TINYINT
SMALLINT
MEDIUMINT
INT
BIGINT
DECIMAL
FLOAT
DOUBLE
BIT
Q31. What are the Temporal Data Types in MySQL?
DATE
TIME
DATETIME
TIMESTAMP
YEAR
Q32. What are the String Data Types in MySQL?
CHAR
VARCHAR
BINARY
BLOB
TINYTEXT
TEXT
ENUM
SET
NULL
Q33. What are MySQL Database Queries?
A query is a specific request or a question. One can query a database for specific information and have a record returned.
Q34. How to add columns in MySQL?
ALTER TABLE table_name
ADD COLUMN column_name column_definition [FIRST|AFTER existing_column];
Q35. 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.
Q36. What are the purposes of using ENUM and SET data types?
ENUM data type is used in the MySQL database table to select any one value from the predefined list.
The value of a particular field can be restricted by defining the predefined list as the field which is declared as ENUM will not accept any value outside the list.
The SET data type is used to select one or more or all values from the predefined list. This data type can also be used to restrict the field for inserting only the predefined list of values like ENUM.
Q37. How to represent ENUMs and SETs internally?
ENUMs and SETs are used to represent powers of two because of storage optimizations
Q38. What is Database Black Box Testing?
Database Black Box Testing deals with data mapping, data storing and retrieving. The Database Black Box Testing is used for techniques such as Equivalence Partitioning and Boundary Value Analysis.
Q39. How do you create a database in MySQL?
CREATE DATABASE books;
Q40. How do you create a table using MySQL?
CREATE TABLE user (
name VARCHAR(128),
uname VARCHAR(128),
email VARCHAR(16),
password VARCHAR(20)
) ENGINE InnoDB;
Q41. How to delete a table in MySQL?
Using the Drop Table statement We can delete a table in MySQL.
The foreign key is used to link one or more tables together. It matches the primary key field of another table to link the two tables. It allows us to create a parent-child relationship with the tables.
Q44. How do you Insert Data Into MySQL?
INSERT INTO table_name (column1, column2, column3,...)
VALUES (value1, value2, value3,...)
============= OR ==============
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
Q45. 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.
Q47. What are the differences between a primary key and a foreign key?
The database table uses a primary key to identify each row uniquely.
When the primary key of any table is used in another table as the primary key or another field for making a database relation, then it is called a foreign key.
The primary key uniquely identifies a record, whereas foreign key refers to the primary key of another table.
When a record is inserted in a table that contains the primary key then it is not necessary to insert the value on the table that contains this primary key field as the foreign key.
The primary key can never accept a NULL value but foreign key accepts a NULL value.
When a record is deleted from the table that contains the primary key then the corresponding record must be deleted from the table containing the foreign key for data consistency. But any record can be deleted from the table that contains a foreign key without deleting a related record of another table.
Q48. What is CTE?
An expression which consists of a temporary set of results defined in a SQL statement is said to be a Common Table Expression(CTE).
Q49. How do you remove a column from a database?
You can remove a column by using the DROP keyword -
ALTER TABLE classics DROP pages;
Q50. What is an Index in MySQL?
In MySQL, there are different index types, such as a regular INDEX, a PRIMARY KEY, or a FULLTEXT index.
You can achieve fast searches with the help of an index, telling the SQL engine where to go to find your data.
Indexes can be created using one or more columns.
Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows.
Q51. How to create an Index in MySQL?
ALTER TABLE user ADD INDEX(email(10));
Q52. How to Delete Data From a MySQL Table?
DELETE FROM table_name WHERE column_name = value_name
Q53. How to change the MySQL password?
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
Q54. Give string types available for column?
SET
BLOB
CHAR
VARCHAR
ENUM
TEXT
Q55. What is the purpose of using the TIMESTAMP data type?
A TIMESTAMP data type is used to store the combination of date and time value which is 19 characters long.
YYYY-MM-DD HH:MM: SS
1970-01-01 00:00:01
Q56. What is a Cursor?
A Cursor is nothing but a control which enables traversal over the records in the table. So, the cursor is used for performing traversing actions such as addition, retrieval, and removal of records in a database.
Q57. How can you test for NULL values in a database?
A NULL value is a field with no value present in that particular field. Since the NULL value cannot be compared to any other NULL values, you cannot use the comparison operators such as =, <, or <>. To compare the fields with NULL values, you have to use the IS NULL and IS NOT NULL operator.
SELECT column_names FROM table_name WHERE column_name IS NULL;
SELECT column_names FROM table_name WHERE column_name IS NOT NULL;
Q58. What is BLOB in MySQL?
BLOB is an acronym that stands for a binary large object. It is used to hold a variable amount of data.
It can hold a very large amount of data. For example - documents, images, and even videos. You could store your complete novel as a file in a BLOB if needed.
There are four types of BLOB -
TINYBLOB
BLOB
MEDIUMBLOB
LONGBLOB
Q59. How to change the table name in MySQL?
mysql> RENAME old_table TO new_table;
Q60. What storage engines Technique are used in MySQL?
Storage mechanism
Locking levels
Indexing
Capabilities and functions
Q61. What are the drivers in MySQL?
PHP Driver
JDBC Driver
ODBC Driver
C WRAPPER
PYTHON Driver
PERL Driver
RUBY Driver
CAP11PHP Driver
Q62. What is the difference between mysql_fetch_array() and ysql_fetch_object() ?
Both mysql_fetch_array() and mysql_fetch_object() are built-in methods of PHP to retrieve records from MySQL database table.
The difference between these methods is that mysql_fetch_array() returns the result set as an array and mysql_fetch_object() returns the result set as an object.
Q63. What is the difference between the NVL function, IFNULL function, and the ISNULL function?
The NVL function, IFNULL function, and the ISNULL function all of them are used to replace the NULL value with another value.
The ORACLE users use the NVL function, MySQL users use the IFNULL function and the SQL servers use the ISNULL function
Q64. 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.
Q65. How do you login to MySql using Unix shell?
mysql -h hostname -u <UserName> -p <password>
Q66. Why should we use Lamp(Linux, Apache, MySQL, PHP) instead of any other software?
The reason behind selecting Lamp stack is very simple.
Linux, Apache, MySQL, PHP are open source software. The security of the Linux operating system is much more than Windows.
The Apache server is a better server than others in the perspective of functionalities and security.
MySQL is one of the most popular open source databases is used with PHP to perform various functionalities.
Q67. How can you filter the duplicate data while retrieving records from the table?
A DISTINCT keyword is used to filter the duplicate data from the table while retrieving the records from a table.
SELECT DISTINCT type from items;
Q68. 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.
Q69. What are MySQL Views?
In MySQL, a view consists of a set of rows that is returned if a particular query is executed. This is also known as a ‘virtual table’. Views make it easy to retrieve the way of making the query available via an alias.
A trigger is a task that executes in response to some predefined database event, such as after a new row is added to a particular table. Specifically, this event involves inserting, modifying, or deleting table data, and the task can occur either prior to or immediately following any such event.
Audit Trails
Validation
Referential integrity enforcement
Q72. How many Triggers are possible in MySQL?
Before Insert
After Insert
Before Update
After Update
Before Delete
After Delete
Q73. How do you create a trigger in MySQL?
CREATE TRIGGER <trigger name> BEFORE INSERT
ON <table name>
FOR EACH ROW
<trigger body>;
Q74. How can I find the number of days between the two given dates?
Use the strtotime function to subtract both the dates and find the differences between the days in seconds
Q75. What is the difference between NOW() and CURRENT_DATE()?
Both NOW() and CURRENT_DATE() are built-in MySQL methods.
NOW() is used to show the current date and time of the server and CURRENT_DATE() is used to show only the date of the server.
SELECT now(); // 2022-03-11 19:51:05
SELECT current_date(); // 2022-03-11
Q76. How to change the database name in MySQL?
To rename the database name, we need first to create a new database into the MySQL server.
Next, MySQL provides the mysqldump shell command to create a dumped copy of the selected database and then import all the data into the newly created database.
ALTER TABLE table_name
CHANGE COLUMN old_column_name new_column_name column_definition [FIRST|AFTER existing_column];
Q80. How to delete columns in MySQL?
Using the ALTER TABLE statement we can follow this task.
ALTER TABLE table_name DROP COLUMN column_name1, column_name2....;
Q81. What are the types of relationships used in MySQL?
One-to-One - Usually, when two items have a one-to-one relationship, you just include them as columns in the same table.
One-to-Many - One-to-many (or many-to-one) relationships occur when one row in one table is linked to many rows in another table.
Many-to-Many - In a many-to-many relationship, many rows in one table are linked to many rows in another table. To create this relationship, add a third table containing the same key column from each of the other tables
Q82. What is Scaling in MySQL?
Scaling capacity is actually the ability to handle the load, and it’s useful to think of load from several different angles.
Quantity of data
Number of users
User activity
Size of related datasets
Q83. Which MySQL function is used to concatenate string?
CONCAT() function is used to combine two or more string data.
Q84. What are the functions used to encrypt and decrypt the data present in MySQL?
The function used to encrypt the data is AES_ENCRYPT() and the function used to decrypt the data is AES_DECRYPT().
Q85. What is the difference between a Heap table and Temporary table?
Heap Table
Temporary Table
Heap Table exists in the memory.
A temporary table is valid only during the session.
Heap Tables are shared among a various number of clients.
Temporary tables are not shared among the clients.
Temporary tables need a special privilege to create tables.
Heap Tables are storage engines which do not need special privileges.
Q86. What is meant by a decimal (5,2)?
A decimal data type is used in MySQL to store the fractional data.
The meaning of decimal (5,2) means that the total length of the fractional value is 5.
The field can contain 3 digits before the decimal point and 2 digits after the decimal point.
If a user adds any value larger than the defined length then it will insert 999.99 in the field.
Q87. How to join two tables in MySQL?
We can connect two or more tables in MySQL using the JOIN clause. MySQL allows various types of JOIN clauses. These clauses connect multiple tables and return only those records that match the same value and property in all tables. The following are the four easy ways to join two or more tables in MySQL.
Inner Join
Left Join
Right Join
Cross Join
Q88. How to join three tables in MySQL? Please write query for the same?
SELECT name, scores, address, email FROM Student s
INNER JOIN Marks m on s.stud_id = m.stud_id
INNER JOIN Details d on d.school_id = m.school_id;
Q89. How to create a Stored Procedure in MySQL?
A stored procedure is a group of SQL statements that we save in the database. The SQL queries, including INSERT, UPDATE, DELETE, etc. can be a part of the stored procedure.
A procedure allows us to use the same code over and over again by executing a single statement. It stores in the database data dictionary.
CREATE PROCEDURE procedure_name [ (parameter datatype [, parameter datatype]) ]
BEGIN
Body_section of SQL statements
END;
Q90. How to execute a stored procedure in MySQL?
We can execute a stored procedure in MySQL by simply CALL query. This query takes the name of the stored procedure and any parameters we need to pass to it.
CALL stored_procedure_name (argument_list);
Q91. What is Sharding in SQL?
The process of breaking up large tables into smaller chunks (called shards) that are spread across multiple servers is called Sharding.
Sharding is a very important concept which helps the system to keep data into different resources according to the sharding process.
The advantage of Sharding is that since the sharded database is generally much smaller than the original queries, maintenance, and all other tasks are much faster.
1. Sharding makes the Database smaller 2. Sharding makes the Database faster 3. Sharding makes the Database much more easily manageable 4. Sharding can be a complex operation sometimes 5. Sharding reduces the transaction cost of the Database.
Q92. How to clear screen in MySQL?
mysql> SYSTEM CLS;
Q93. How to check USERS in MySQL?
mysql> SELECT USER FROM mysql.user;
Q94. How does indexing works in MySQL?
Indexing is a process to find an unordered list into an ordered list. It helps in maximizing the query's efficiency while searching on tables in MySQL. The working of MySQL indexing is similar to the student index.
Suppose we have a student and want to get information about, say, searching.
Without indexing, it is required to go through all pages one by one, until the specific topic was not found.
On the other hand, an index contains a list of keywords to find the topic mentioned on pages. Then, we can flip to those pages directly without going through all pages.
Q95. What are federated tables?
Federated tables which allow access to the tables located on other databases on other servers.
Q96. What is the function of mysqldump?
mysqldump is a useful utility tool of MySQL that is used to dump one or more or all databases from the server for backup or transfer to another database server.
mysqldump --databases_name newdb_name > newdb.sql
Q97. Who owns MySQL?
MySQL is the most popular free and open-source database software which comes under the GNU General Public License.
In the beginning, it was owned and sponsored by the Swedish company MySQL AB. Now, it is bought by Sun Microsystems (now Oracle Corporation), who is responsible for managing and developing the database.
Q98. What is the difference between UNIX TIMESTAMP and MySQL TIMESTAMP?
Both UNIX TIMESTAMP and MySQL TIMESTAMP are used to represent the date and time value.
The main difference between these values is that UNIX TIMESTAMP represents the value by using 32-bits integers and MySQL TIMESTAMP represents the value in the human-readable format.
Q99. How to set auto increment in MySQL?
Auto Increment is a constraint that automatically generates a unique number while inserting a new record into the table. Generally, it is used for the primary key field in a table.
ALTER TABLE table_name AUTO_INCREMENT = value;
Q100. What happens when the column is set to AUTO INCREMENT and you reach maximum data in the table?
It stops incrementing. Any further inserts are going to produce an error, since the key has been used already.
Q101. How can you import tables from a SQL file into a database?
mysql -u username -p database_name < sql_filename
Ex:
mysql -u root mydb < newdb.sql
Q102. What does "i_am_a_dummy flag" do in MySQL?
The "i_am_a_dummy flag" enables the MySQL engine to refuse any UPDATE or DELETE statement to execute if the WHERE clause is not present. Hence it can save the programmer from deleting the entire table my mistake if he does not use WHERE clause.
Q103. How to get the current date in MySQL?
SELECT CURRENT_DATE();
Q104. How can you see all indexes defined for a table?
SHOW INDEX FROM <tablename>;
Q105. What do you mean by % and _ in the LIKE statement?
% corresponds to 0 or more characters, _ is exactly one character in the LIKE statement.
Q106. How can you export the table as an XML file in MySQL?
mysql -u username -X -e “SELECT query” database_name
Ex:
mysql -u root -X -e "SELECT * from users" newdb > xmlData.xml
Q107. What is a CSV table?
MySQL table that uses the CSV storage engine is called a CSV table. Data are stored as comma-separated values in the CSV table. MySQL server creates a data file with an extension .csv to store the content of the CSV table.
CREATE TABLE user ( id INT NOT NULL) ENGINE=CSV;
Q108. What are the column comparisons operators?
= , <>, <=, <, >=, >,<<,>>, <=>, AND, OR, or LIKE operators are used in column comparisons in SELECT statements.
Q109. What is the difference between the LIKE and REGEXP operators?
LIKE and REGEXP operators are used to express with ^ and %
SELECT * FROM users WHERE name REGEXP "^s";
SELECT * FROM users WHERE name LIKE "%s";
Q110. What are the security alerts while using MySQL?
Install antivirus and configure the operating system's firewall.
Never use the MySQL Server as the UNIX root user.
Change the root username and password Restrict or disable remote access.
Q111. How to calculate the sum of any column of a table?
SUM() function is used to calculate the sum of any column.
SELECT SUM(amount) as total FROM products;
Q112. How can you count the total number of records of any table?
COUNT() function is used to count the total number of records of any table.
SELECT COUNT(id) as total _records FROM products;
Q113. 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.
Q114. What are the nonstandard string types?
LONGTEXT
TEXT
TINYTEXT
MEDIUMTEXT
Q115. What is SQLyog?
SQLyog program is the most popular GUI tool for admin.
It is the most popular MySQL manager and admin tool. It combines the features of MySQL administrator, phpMyadmin, and others. MySQL front ends and MySQL GUI tools.
Q116. What is a transaction?
When a group of database operations is done as a single unit then it is called a transaction.
If any task of the transactional tasks remains incomplete then the transaction will not succeed. Hence, it is mandatory to complete all the tasks of a transaction to make the transaction successful.
A transaction has four properties which are known as ACID property.
Atomicity
Consistency
Isolation
Durability
Q117. What are the advantages of MyISAM over InnoDB?
MyISAM follows a conservative approach to disk space management and stores each MyISAM table in a separate file, which can be further compressed if required.
On the other hand, InnoDB stores the tables in the tablespace. Its further optimization is difficult.
Q118. What are the functions of commit and rollback statements?
Commit is a transaction command that executes when all the tasks of a transaction are completed successfully. It will modify the database permanently to confirm the transaction.
Rollback is another transactional command that executes when any of the transactional tasks become unsuccessful and undoes all the changes that are made by any transactional task to make the transaction unsuccessful.
Q119. What is the use of mysql_close()?
Mysql_close() cannot be used to close the persistent connection. However, it can be used to close a connection opened by mysql_connect().
Q120. What is the difference between MyISAM Static and MyISAM Dynamic?
MyISAM Static and MyISAM dynamic are the variations of the MyISAM storage engine.
All the fields of MyISAM static table are of a fixed length and MyISAM dynamic table accepts variable length fields such as BLOB, TEXT, etc.
After data corruption, it is easier to restore the MyISAM static table than MyISAM dynamic table.
Q121. What is MySQL data directory?
MySQL data directory is a place where MySQL stores its data.
Each subdirectory under this data dictionary represents a MySQL database.
Cookie Policy
This website uses cookie or similar technologies, to enhance your browsing experience and provide personalised recommendations. By continuing to use our website, you agree to our Cookie Policy.