![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 4219 Articles for MySQLi
![Nitya Raut](https://www.tutorialspoint.com/assets/profiles/13573/profile/60_92249-1512715559.jpg)
4K+ Views
We can write multiple-line statements because MySQL determines the end of a statement by looking for the termination semicolon, not by looking for the end of the input line.Examplemysql> Select * -> from -> stock_item; +------------+-------+----------+ | item_name | Value | Quantity | +------------+-------+----------+ | Calculator | 15 | 89 | | Notebooks | 63 | 40 | | Pencil | 15 | 40 | | Pens | 65 | 32 | | Shirts | 13 ... Read More
![Priya Pallavi](https://www.tutorialspoint.com/assets/profiles/13562/profile/60_91320-1512544134.jpg)
64 Views
For creating a table with such kinds of names we must have to use quote character. The quotes can be single or double depends upon ANSI_QUOTES SQL mode. If this mode is disabled then the identifier quote character is the backtick (“`”). Consider the following example in which we created a table named ‘select’ −mysql> Create table `a^b`(`a^b` int); Query OK, 0 rows affected (0.19 sec) mysql> Create table "a^g"("a^g" int); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"a^g" ("a^g" ... Read More
![usharani](https://www.tutorialspoint.com/assets/profiles/13564/profile/60_32161-1512638316.jpg)
1K+ Views
As we know that a query consists of MySQL statements followed by a semicolon. We can enter multiple MySQL statements, separated by semicolons, on a single line. Consider the following example −mysql> Select * from Student; Select * from Student ORDER BY Name; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aarav | 150 | M.SC | | Aryan | 165 | M.tech | +--------+--------+--------+ 3 rows in set (0.00 sec) +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Aarav | 150 ... Read More
![Jennifer Nicholas](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
106 Views
For writing MySQL query to get all the tables having a particular column name, we can use LIKE operator. It can be understood with the help of an example as follows −ExampleFollowing is the MySQL query to get all the tables having columns name ‘ID’ in it −mysql> Select Column_name as 'ColumnName', Table_name As 'Tablename' FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '%ID%' ORDER BY Tablename LIMIT 10; +-------------+---------------+ | ColumnName | Tablename | +-------------+---------------+ | id | arena | | id | arena1 | ... Read More
![Vrundesha Joshi](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
66 Views
It can be done with the help of ALTER TABLE command of MySQL. Consider the table ‘Student’ in which the size of ‘Grade’ column is declared as Varchar(10), can be seen from the following query −mysql> DESCRIBE Student; +--------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | Name | varchar(20) | YES | | NULL | | | RollNo | int(11) | YES | | NULL | | | Grade | varchar(10) | YES | ... Read More
![seetha](https://www.tutorialspoint.com/assets/profiles/13549/profile/60_42938-1512640859.jpg)
113 Views
We can sort multiple columns in a single query by giving more than one column name with ORDER BY Clause. The syntax of the above is as follows −SyntaxSelect Col1, Col2, … from table_name ORDER BY Col1, Col2, …ExampleSuppose we want to sort the table named ‘Student’ by columns ‘Name’ and ‘RollNo’ both then we can write the single query for this as follows −mysql> Select Name, RollNo from student order by name, rollno; +--------+--------+ | name | rollno | +--------+--------+ | Aarav | 150 | | Aryan | 165 | | Gaurav | 100 | ... Read More
![Prabhas](https://www.tutorialspoint.com/assets/profiles/13554/profile/60_90506-1512543588.jpg)
74 Views
As we know the EXPLAIN statement will provide the information/structure of the whole table. With the help of the EXPLAIN statement along with the table name and the column name, we can get the information about that column.SyntaxEXPLAIN table_name col_name;Example1mysql> EXPLAIN employee ID; +-------+---------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+----------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | +-------+---------+------+-----+---------+----------------+ 1 row in set (0.11 sec)The query above will give the information about the column ‘ID’ of a table named ... Read More
![Vrundesha Joshi](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
71 Views
With the statement SHOW FULL COLUMNS, we can get more information about the columns of a table than the information we got by DESCRIBE, EXPLAIN, and SHOW COLUMNS MySQL statements.SyntaxSHOW FULL COLUMNS from Table_name;Examplemysql> SHOW FULL COLUMNS FROM EMPLOYEE\G; *************************** 1. row *************************** Field: ID Type: int(11) Collation: NULL Null: NO Key: PRI Default: NULL Extra: auto_increment Privileges: select, insert, update, references Comment: *************************** 2. row *************************** Field: Name Type: varchar(20) Collation: latin1_swedish_ci Null: YES ... Read More
![vanithasree](https://www.tutorialspoint.com/assets/profiles/13547/profile/60_85216-1512542720.jpg)
188 Views
Followings are the synonyms statements of MySQL DESCRIBE i.e. the statements with the help of which we can get the same kind of information/structure of the table as we get from DESCRIBE −EXPLAIN StatementEXPLAIN is the synonym of the DESCRIBE statement. Its syntax is also similar to the DESCRIBE statement. Consider the following example −mysql> Explain Employee; +-------+-------------+------+-----+---------+------------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+------------------+ | ID | int(11) | NO | PRI | NULL | auto_increment | | ... Read More
![Arushi](https://www.tutorialspoint.com/assets/profiles/13510/profile/60_55588-1512537391.jpg)
198 Views
Subqueries can work well in a SELECT statement FROM clause. Following is the syntax for the same −SELECT … FROM(subquery) [AS] name …To make it understand we are using the following data from table ‘cars’ −mysql> Select * from Cars; +------+--------------+---------+ | ID | Name | Price | +------+--------------+---------+ | 1 | Nexa | 750000 | | 2 | Maruti Swift | 450000 | | 3 | BMW | 4450000 | | 4 | VOLVO | 2250000 | | ... Read More