- Trending Categories
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
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
For this, use UNION ALL.Let us first create a table:mysql> create table DemoTable729 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100), MySQLMarks int, CMarks int, JavaMarks int ); Query OK, 0 rows affected (0.40 sec)Insert some records in the table using insert command:mysql> insert into DemoTable729(StudentName, MySQLMarks, CMarks, JavaMarks) values('Chris', 94, 67, 75); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable729(StudentName, MySQLMarks, CMarks, JavaMarks) values('Robert', 45, 99, 54); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable729(StudentName, MySQLMarks, CMarks, JavaMarks) values('David', 57, 89, 43); Query OK, 1 row ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
262 Views
The UK date format supports day-moth-year format. To convert it to MySQL date, use STR_TO_DATE(). Following is the syntax:select str_to_date(yourColumnName, '%d/%m/%Y') from yourTableName;Let us first create a table:mysql> create table DemoTable728 (DueDate varchar(100)); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command:mysql> insert into DemoTable728 values('10/11/2019'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable728 values('31/01/2016'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable728 values('01/12/2015'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable728 values('11/03/2018'); Query OK, 1 row affected (0.16 sec)Display all records from the table ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
95 Views
For this, you can use IN().Let us first create a table:mysql> create table DemoTable727 ( Name varchar(100), Score int ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command:mysql> insert into DemoTable727 values('Chris', 45); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable727 values('Robert', 89); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable727 values('Carol', 94); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable727 values('David', 93); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable727 values('Mike', 78); Query OK, 1 row affected (0.21 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
403 Views
Let us first create a table −mysql> create table DemoTable726 (Value varchar(100)); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable726 values('100'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable726 values('10'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable726 values('110'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable726 values('2000'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable726 values('1000'); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable726;This will ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
84 Views
To calculate power of a number, use POWER() function. Let us first create a table −mysql> create table DemoTable ( Amount int ); Query OK, 0 rows affected (0.89 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(64); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(144); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(400); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+--------+ | Amount | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
1K+ Views
You cannot give underscore in table name. If you still want to create a new table with underscore, surround it using backticks, not single quotes.However, let us first try to set quotes around a table name with underscore. Following is an example −mysql> create table 'Demo_Table725'( ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ClientName varchar(100), ClientAge int, ClientCountryName varchar(100), isMarried boolean );This will produce the following output i.e. an error since we haven’t used backtick −ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
814 Views
Let us first create a table −mysql> create table DemoTable724 (Value int); Query OK, 0 rows affected (0.79 sec)Insert some records in the table using insert command −mysql> insert into DemoTable724 values(101); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable724 values(183); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable724 values(983); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable724 values(234); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable724 values(755); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable724 values(435); Query OK, 1 row affected (0.28 sec) mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
371 Views
Let us first create a table −mysql> create table DemoTable723 (Value int); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable723 values(100); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable723 values(200); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable723 values(200); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable723 values(100); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable723 values(300); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable723 values(400); Query OK, 1 row affected (0.16 sec) mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
317 Views
Let us first create a table −mysql> create table DemoTable(DueDate varchar(100)); Query OK, 0 rows affected (0.78 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('10-01-2019 10:19:20'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('12-03-2018 11:00:00'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('02-23-2018 04:20:40'); Query OK, 1 row affected (0.19 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+---------------------+ | DueDate | +---------------------+ | 10-01-2019 10:19:20 | | 12-03-2018 11:00:00 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
150 Views
Yes, we can all the reserved words in MySQL using the command-line utility. Following is the syntax −select *from mysql.help_keyword;Let us implement the above syntax in order to get list of all the reserved words in MySQL.Following is the query −mysql> select *from mysql.help_keyword;This will produce the following output -