Explore topic-wise InterviewSolutions in .

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.

1.

What are the types of relationships used in MySQL?

Answer»

There are three categories of relationships 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
2.

What are the MySQL clients and utilities?

Answer»

Several MySQL programs are available to help you communicate with the server. For administrative tasks, some of the most important ONES are listed here:

mysql—An interactive program that enables you to send SQL statements to the server and to view the results. You can also use mysql to EXECUTE batch scripts (text files containing SQL statements).

mysqladmin—An administrative program for performing tasks such as SHUTTING down the server, checking its configuration, or monitoring its status if it appears not to be functioning properly.

mysqldump—A tool for backing up your databases or COPYING databases to another server.

mysqlcheck and myisamchk—Programs that help you perform table checking, analysis, and optimization, as well as repairs if tables become damaged. mysqlcheck works with MyISAM tables and to some extent with tables for other storage ENGINES. myisamchk is for use only with MyISAM tables.

3.

What is the MySQL server?

Answer»

The server, mysqld, is the HUB of a MySQL INSTALLATION; it PERFORMS all manipulation of databases and tables.

4.

How many Triggers are possible in MySQL?

Answer»

There are six TRIGGERS allowed to use in the MySQL DATABASE:

  • Before Insert
  • After Insert
  • Before Update
  • After Update
  • Before DELETE
  • After Delete
5.

What are MySQL Triggers?

Answer»

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. 
Triggers have many purposes, INCLUDING:

  • Audit Trails
  • Validation
  • Referential integrity enforcement
6.

How do you create and execute views in MySQL?

Answer»

Creating a view is accomplished with the CREATE VIEW STATEMENT. As an example:

CREATE [OR REPLACE] [ALGORITHM = {MERGE | TEMPTABLE | UNDEFINED }] [DEFINER = { user | CURRENT_USER }] [SQL SECURITY { DEFINER | INVOKER }] VIEW view_name [(column_list)] AS select_statement [WITH [CASCADED | LOCAL] CHECK OPTION]
7.

What are MySQL “Views”?

Answer»

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. 
The advantages of views are:

  • Simplicity
  • Security
  • Maintainability