MariaDB Interview Questions
1) What is MariaDB?
MariaDB is a popular open source and community based project developed by MySQL developers. It is a relational database management technology which provides same features of MySQL. It is a new replacement of MySQL.
2) What are the main features of MariaDB?
Following is a list of features of MariaDB:
- MariaDB can run on different operating systems and support a wide variety of programming language.
- MariaDB follows a standard and popular querying language.
- MariaDB provides Galera cluster technology.
- MariaDB provides supports for PHP which is the most popular web development language.
3) How to create database in MariaDB?
CREATE DATBASE command is used to create database in MariaDB.
Syntax:
4) How to use database in MariaDB?
USE DATABASE command is used to select and use a database in MariaDB.
Syntax:
5) How to delete a database in MariaDB ?
DROP DATABASE command is used to drop a database in MariaDB.
Syntax:
6) How to create a table in MariaDB's database?
First, you have to create a database in MariaDB follows by selecting the database and then create a table by using CREATE TABLE statement.
Syntax:
7) How to delete a table in MariaDB's database?
DROP TABLE command is used to delete a table from a database in MariaDB. It deletes the table permanently and cannot be recovered.
Syntax:
8) How to insert records in a table in MariaDB database?
INSERT INTO statement is used to insert records in a table in MariaDB database.
Syntax:
9) How to retrieve records from a table in MongoDB database?
SELECT statement is used to retrieve records from a table in MongoDB database. You can choose, single, multiple or all records from a table by using different keywords.
Syntax:
10) How can you retrieve limited number of records from a table?
LIMIT clause is used with SELECT statement to select a limited number of records from a table. It facilitates you to retrieve records according to your use.
Syntax:
11) How can you change or update the already inserted records of a MariaDB table?
UPDATE statement is used to change, update or modify the existing records of a MariaDB table. It can be used with WHERE, OBDER BY and LIMIT clauses.
Syntax:
12) What is the use of DELETE statement in MariaDB?
The MariaDB DELETE statement is used to delete one or more records from the table in the database. It can be used to delete records from the table as well the whole table if you use it without WHERE condition.
Syntax:
13) What is the use of TRUNCATE statement? How is it different from DELETE statement?
TRUNCATE TABLE statement is used to delete a table permanently. It deletes all the records from the table.
Syntax:
Difference between DELETE and TRUNCATE statement:
- DELETE statement is used to remove one or more columns from a table as well as whole table. On the other hand, TRUNCATE TABLE statement is used to delete the whole table permanently.
- TRUNCATE TABLE statement is same as DELETE statement without a WHERE clause.
14) What is an aggregate function? How many types of aggregate functions in MariaDB?
In relational database management system, aggregate functions are the functions where the values of multiple rows are grouped together as input on certain criteria and provide a single value of more significant meaning such as a list, set etc.
Following is a list of aggregate function in MariaDB:
- MariaDB COUNT Function
- MariaDB SUM Function
- MariaDB MIN Function
- MariaDB MAX Function
- MariaDB AVG Function
15) What are the different types of clauses used in MariaDB?
MariaDB supports all clauses used in RDBMS. For example:
- MariaDB Where Clause
- MariaDB Like Clause
- MariaDB Order By Clause
- MariaDB DISTINCT Clause
- MariaDB FROM Clause
- Etc.
16) What is the use of WHERE clause?
WHERE clause is used to select or change a specific location to fetch the records from a table. It is used with SELECT, INSERT, UPDATE and DELETE statement.
Syntax:
17) What is the use of LIKE clause in MariaDB?
MariaDB LIKE clause is used with SELECT, INSERT, UPDATE and DELETE statement to retrieve data when an operation needs an exact match.
Syntax:
18) What is the use of ORDER BY clause in MariaDB?
MariaDB ORDER BY Clause is used to sort the records in your result set in ascending or descending order.
Syntax:
19) What is the use of MariaDB DISTINCT clause?
MariaDB DISTINCT Clause is used to remove duplicates from the result when it is used with SELECT statement.
Syntax:
20) Why do we use FROM clause with SELECT statement?
FROM clause is used with SELECT statement to retrieve data from the table. It is also used to join tables.
Syntax:
21) What is the use of COUNT() aggregate function?
MariaDB COUNT() aggregate function is used to return the count of an expression.
Syntax:
22) What is the use of MariaDB SUM() function?
MariaDB SUM function is used to return the summed value of an expression.
Syntax:
23) What is the usage of MIN() function in MariaDB?
MariaDB MIN() functiuon is used to retrieve the minimum value of the expression.
Syntax:
24) What is the usage of MAX() function in MariaDB?
MariaDB MAX() function is used to retrieve the maximum value of the expression.
Syntax:
25) What is the usage of AVG() function in MariaDB database?
MariaDB AVG() function is used to retrieve the average value of an expression.
Syntax:
26) What is JOIN? How many types of JOIN in MariaDB?
JOIN is used to retrieve data from two or more tables. By default JOIN is also called INNER JOIN. It is used with SELECT statement.
There are mainly two types of joins in MariaDB:
- INNER JOIN
- OUTER JOIN
Again OUTER JOIN is divided in two types:
- LEFT JOIN
- RIGHT JOIN
27) What is MariaDB INNER JOIN?
MariaDB INNER JOIN is the most common type of join which returns all rows from multiple tables where the join condition is satisfied.
Syntax:
28) What is LEFT OUTER JOIN in MariaDB?
MariaDB LEFT OUTER JOIN is used to return all rows from left-hand table specified in the ON condition and only those rows from the other table where the joined condition is satisfied.
LEFT OUTER JOIN is also called LEFT JOIN.
Syntax:
29) What is RIGHT OUTER JOIN in MariaDB?
MariaDB RIGHT OUTER JOIN is used to return all rows from right-hand table specified in the ON condition and only those rows from the other table where the joined fields are satisfied the conditions.
MariaDB RIGHT OUTER JOIN is also called RIGHT JOIN.
Syntax:
30) What is function in MariaDB? How can you create and drop function in MariaDB?
MariaDB function is a stored program that is used to pass parameters into them and return a value.
We can easily create and drop functions in MariaDB.
31) What is a procedure or a stored procedure in database?
Procedures are sort of functions in a database. Procedures are created when you want to perform a task repetitively.
MariaDB procedure is a stored program that is used to pass parameters into it. It does not return a value like a function does.
You can create and drop procedures like functions.
0 comments:
Post a Comment