InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What is the use of CONCAT() in Mysql? |
|
Answer» It is USED to CONCATENATE TWO or more strings. Example |
|
| 52. |
List some comparisons operators used in Mysql? |
|
Answer» Comparisons OPERATORS are used to comparing ONE EXPRESSION to ANOTHER value or expression. It is just LIKE = , < , > , => , =<, <> |
|
| 53. |
What are the difference between NOW and CURRENT_DATE in MySQL? |
||||
Answer»
|
|||||
| 54. |
What is TRIGGERS and how it can be used in MySQL? |
|
Answer» In Mysql, a trigger is a database object that is directly associated with a table. It will be activated when a defined action is executed for the table. It can be PERFORMED when you run ONE of the following MySQL LIKE INSERT, UPDATE and DELETE occurred in a table. It's activation time can be BEFORE or AFTER Examplemysql> delimiter // mysql> CREATE TRIGGER age_check BEFORE INSERT ON people FOR EACH ROW IF NEW.age < 0 THEN SET NEW.age = 0; END IF; mysql> delimiter ; |
|
| 55. |
Explain the difference between primary key and candidate key in Mysql? |
||||
Answer»
|
|||||
| 56. |
How do I import database through command line? |
|
Answer» MySQL -u username -p database_name < file.SQL |
|
| 57. |
What is the default port for MySQL and how it can change? |
|
Answer» The default port is 3306. We can CHANGE it in /etc/MySQL/my.conf there is a port variable. We can UPDATE this port ACCORDING to our NEED |
|
| 58. |
What is DDL, DML and DCL in MySQL? |
|
Answer» 1. DDL In MySQL, DDL is the short FORM for Data Definition Language, which is used in DATABASE schemas and descriptions while deciding how data should RESIDE in the database. Here’s a list of DDL Queries:
DML is a short form for Data Manipulation Language which is used in data manipulation and mostly includes common SQL statements to store, modify, retrieve, delete and update data in a database. Here is the list of DML Queries:
DCL is a short form for Data Control Language including commands which are concerned with User rights, permissions and other controls within the database system. Here’s a list of queries for DCL:
|
|
| 59. |
What is the difference between the primary and unique key in Mysql? |
||||||
Answer»
|
|||||||
| 60. |
How to create case insensitive query in MySQL? |
|
Answer» The standard way to perform case INSENSITIVE queries in SQL is to use the SQL UPPER or lower functions like the following: select * from users where upper(first_name) = 'AJAY'; OR select * from users where lower(first_name) = 'ajay'; The method is to make the FIELD you are searching as uppercase or lowercase then ALSO make the search string uppercase or lowercase as per the SQL function. Also Read: MongoDB Interview Questions And ANSWERS |
|
| 61. |
What is cardinality in MySQL? |
|
Answer» In MySQL, the time PERIOD cardinality REFERS to the SPECIALTY of facts VALUES that can be put into columns. It is a type of property that influences the potential to search, cluster and kind data. Cardinality can be of TWO sorts which are as follows
|
|
| 62. |
What is indexing and how do you create an index in MySQL? |
|
Answer» A DATABASE index is the structure of a fact that improves the velocity of operations in a table. It can be created the USAGE of one or greater columns, presenting the FOUNDATION for each fast random lookups and efficient ORDERING of getting admission to records. Indexes are used to locate rows with specific column values quickly. ExampleCREATE INDEX [index name] ON [table name]([column name]); |
|
| 63. |
What are the different ways to optimize a MySQL query? |
Answer»
|
|
| 64. |
Is MySQL case-sensitive? |
|
Answer» Mysql is not CASE sensitive. Its case-SENSITIVITY relies on the UNDERLYING operating system as OS determines the case sensitivity of TABLES names and database. In windows, database and table names are not case sensitive but in the case of UNIX, it is case sensitive in nature. Especially on the UNIX host, database ACCEPTS the upper case and lower-case table names. |
|
| 65. |
What is the difference between delete, drop and truncate? |
|
Answer» TRUNCATE
|
|
| 66. |
What are the difference between and MyISAM and InnoDB? |
|
Answer» These are most commonly used storage engine in MySQL are MyISAM and InnoDB. Difference between MyISAM and InnoDB are given below:-
|
|