WHERE clause in MariaDB

MariaDB WHERE To filter the results, the MariaDB WHERE clause is used with SELECT, INSERT, UPDATE and DELETE statements. Syntax: WHERE conditions;WHERE conditions; Parameters: conditions: It is used to specify the conditions to be strictly followed for selection. Example: Selecting specific fields from a table. Students table: ID NAME AGE 1 Joy 5 2 Smiley … Read more

TRUNCATE TABLE in MariaDB

TRUNCATE TABLE To delete all records of a table such that the table cannot be rolled back, the MariaDB TRUNCATE TABLE statement is used. It is much similar to the DELETE TABLE statement without a WHERE clause. Syntax: TRUNCATE TABLE database_name.table_name Parameters: database_name: It is used to specify the name of the database to select. … Read more

DELETE Query in MariaDB

MariaDB DELETE To remove or delete a single record or multiple records from a table, MariaDB DELETE statement is used. Syntax: To delete all rows from a table. DELETE FROM table_name Syntax: To delete specific rows from a table. DELETE FROM table_name WHERE conditions; Parameters: table_name: It is used to specify the name of the … Read more

UPDATE Query in MariaDB

MariaDB UPDATE To modify the existing records in a table by changing their values, the MariaDB UPDATE statement is used. Syntax: UPDATE table_name SET column_1 = value_1, column_2 = value_2, … column_n = value_n WHERE conditions; Parameters: value_1, value_2, … value_n: It is used to specify the values to be updated to the respective columns. … Read more

SELECT LIMIT in MariaDB

MariaDB SELECT LIMIT To fetch limited records from the tables stored in the database, the MariaDB SELECT statement is used with LIMIT clause. Syntax: SELECT columns FROM table_name WHERE conditions ORDER BY expression [ ASC | DESC ] LIMIT row_count; Parameters: columns: It is used to specify the columns or calculations to be retrieved. table_name: … Read more

SELECT Query in MariaDB

MariaDB SELECT To retrieve records from a table or multiple tables stored in a database, the MariaDB SELECT statement is used. Syntax: To select all fields from a table. SELECT * FROM table_name; Example: Selecting all fields from a table. SELECT * FROM Players;SELECT * FROM Players; Output: ID NAME SPORTS 1 Sachin Cricket 2 … Read more

Comparison Operator in MariaDB

MariaDB Comparison Operator To test the equality and inequality, as well as other advanced comparing operations, MongoDB Comparison Operators are used. MariaDB supports the following comparison operators.   OPERATOR USES = equal <=> equal (safe to compare null values) <> not equal != not equal > greater than >= greater than or equal < less … Read more

INSERT query in MariaDB

MariaDB INSERT The MariaDB INSERT INTO statement is used to insert records into a table. Syntax: INSERT into table_name(column_1, column_2, … column_n ) VALUES(value1, value2, .. valuen); Example 1: Single record insertion: Players table before insertion: ID NAME SPORTS 1 Sachin Cricket 2 Dhoni Cricket INSERT INTO Players (id, name, sports) VALUES (3, ‘Sunil’, ‘Football’);INSERT … Read more

CREATE TABLE in MariaDB

CREATE TABLE After creating a database in MariaDB, one can create a new table in the selected database using the MariaDB CREATE TABLE statement. Syntax 1: To create a Table in MariaDB. CREATE TABLE table_name ( column_name data_type column_constraint ); Syntax 2: To check all the existing Tables in a database. SHOW tables; Example 1: … Read more

DROP TABLE in MariaDB

DROP TABLE To drop a table permanently (with no option for the recovery of the table) from a MariaDB database, the MariaDB DROP TABLE statement is used. Syntax: DROP TABLE table_name; Example: DROP TABLE players;DROP TABLE players; Explanation: The “players” is an already existing table. The selected table will be deleted permanently from the database … Read more