
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4218 Articles for MySQLi

1K+ Views
Following are the two approaches with the help of which we can enter characters as a Hexadecimal number −By prefix ‘X’In this approach we need to quote hexadecimal numbers within single quotes with a prefix of X. Then HEX number string will be automatically converted into a character string.Examplemysql> Select X'5152545678'; +---------------+ | X'5152545678' | +---------------+ | QRTVx | +---------------+ 1 row in set (0.00 sec)By prefix 0xIn this approach, we need to write hexadecimal numbers without any quotes with a prefix of 0x. Then HEX number string will be automatically converted into a character string.Examplemysql> ... Read More

1K+ Views
Sometimes we need to include special characters in a character string and at that time they must be escaped or protected. We need to pursue some basic rules for escaping special characters which are given below −The escape character (\) can be escaped as (\)Examplemysql> Select 'A\B'; +-----+ | A\B | +-----+ | A\B | +-----+ 1 row in set (0.00 sec)

433 Views
In MySQL, triggers allow automatic execution of specified actions in response to INSERT, UPDATE or DELETE events on a table. Often, multiple triggers may be created for the same event and action time (e.g.; multiple BEFORE INSERT triggers on the same table). By default, MySQL invokes these triggers in the order they have created. However, the FOLLOWS and PRECEDES option allows control over the sequence of execution which can be critical in complex data handling. In this article, we will explore how to set the order of multiple triggers for the same event and action ... Read More

818 Views
In MySQL, a trigger is a group of SQL statements performed or fired when a specified event is taken place on tables. The events can include INSERT, UPDATE, and DELETE. Such triggers are used for automating repetitive work, ensuring integrity in data, and keeping audit records without human involvement. The FOLLOWS keyword in MySQL allows the creation of several triggers for the same event and also allows you to select the order of execution. Creating Multiple Triggers for the Same Event When working with triggers, sometimes you might need to define several triggers for the same ... Read More

586 Views
As we know that in MySQL we use the delimiter semicolon (;) to end each statement. The semicolon is the by default delimiter in MySQL. We need to change the delimiter, while creating a trigger, to tell MySQL that this is not the end of our trigger statement because we can use multiple statements in the trigger. We can change the delimiter temporarily by DELIMITER // statement to change the delimiter from Semicolon (;) to two back-slash (//). After this MySQL would know that the triggering statement only ends when it encounters a two back-slash (//). Following is an example ... Read More

121 Views
With the help of following MySQL command, we can check the tables of a database other than the database we are currently using −Show Tables from Database_name;For example, the following query would display the list of tables from a database named ‘gaurav’ when currently we are using a database named ‘new’ −mysql> use new; Database changed mysql> show tables from gaurav; +--------------------+ | Tables_in_tutorial | +--------------------+ | testing | | employee | | tender | | Ratelist | +--------------------+ 4 rows in set (0.00 sec)

216 Views
For getting the records from MySQL table in the result set in a particular way either ascending or descending, we need to use the ORDER BY clause along with ASC or DESC keywords. If we will not use any of the above-mentioned keywords then MySQL by default return the records in ascending order. The ORDER BY clause returned the result set based on a particular field (ascending or descending order) with which we will use the ORDER BY clause. Suppose we want to sort the rows of the following table −mysql> Select * from Student; +--------+--------+--------+ | Name | ... Read More

6K+ Views
By using the WHERE clause with a DISTINCT clause in MySQL queries, we are putting a condition on the basis of which MySQL returns the unique rows of the result set. By using the LIMIT clause with a DISTINCT clause in MySQL queries, we are actually providing a perimeter to the server about a maximum number of unique rows of the result set to be returned.ExampleWe can use WHERE and LIMIT clause with DISTINCT as follows on the table named ‘testing’ −mysql> Select * from testing; +------+---------+---------+ | id | fname | Lname | +------+---------+---------+ | 200 ... Read More

957 Views
As we know that in trigger definition, we can refer to columns of the row being inserted, updated or deleted. Following are the ways OLD and NEW keywords enable us to access columns − We must have to prefix the column name with a qualifier of OLD to refer to a value from the original row. We must have to prefix the column name with a qualifier of NEW to refer to a value in the new row. Now, the use of OLD and NEW must be done appropriately because the triggering event Determines which of them are ... Read More

10K+ Views
Yes, it is possible to use MySQL GROUP BY clause with multiple columns just as we can use MySQL DISTINCT clause. Consider the following example in which we have used DISTINCT clause in first query and GROUP BY clause in the second query, on ‘fname’ and ‘Lname’ columns of the table named ‘testing’.mysql> Select * from testing; +------+---------+---------+ | id | fname | Lname | +------+---------+---------+ | 200 | Raman | Kumar | | 201 | Sahil | Bhalla | | 202 | Gaurav | NULL | | 203 | Aarav | ... Read More