- 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)
324 Views
Let us first create a table −mysql> create table DemoTable837(Name varchar(100)); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable837 values('Chris'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable837 values(''); Query OK, 1 row affected (0.23 sec) mysql> insert into DemoTable837 values('Robert'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable837 values(''); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable837 values('David'); Query OK, 1 row affected (1.13 sec)Display all records from the table using select statement −mysql> select *from DemoTable837;This will produce ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
272 Views
For fetching records between dates, use BETWEEN. Let us first create a table −mysql> create table DemoTable863(StudentDateOfBirth date); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable863 values('1998-01-10'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable863 values('2000-10-15'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable863 values('2003-04-20'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable863 values('2005-12-31'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable863 values('1999-07-01'); Query OK, 1 row affected (0.27 sec)Display all records from the table using select ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
923 Views
Let us first create a table −mysql> create table DemoTable836(FirstName SET('John', 'Chris', 'Adam')); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable836 values('John, Chris'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable836 values('John, Chris, Adam'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable836 values('Chris, Adam'); Query OK, 1 row affected (0.25 sec) mysql> insert into DemoTable836 values('John, Adam'); Query OK, 1 row affected (0.37 sec)Display all records from the table using select statement −mysql> select *from DemoTable836;This will produce the following output −+-----------------+ | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
520 Views
Yes, we can insert values without mentioning the column name using the following syntax −insert into yourTableName values(yourValue1, yourValue2, yourValue3, .....N);Let us first create a table. Here, we have set Id as NOT NULL −mysql> create table DemoTable862( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100) , Age int ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable862 values(NULL, 'Chris', 23); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable862 values(NULL, 'Robert', 21); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
833 Views
Let us first create a table −mysql> create table DemoTable835( CountryCode int, CountryName varchar(100) ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable835 values(100, 'US'); Query OK, 1 row affected (0.36 sec) mysql> insert into DemoTable835 values(101, 'UK'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable835 values(102, 'AUS'); Query OK, 1 row affected (0.26 sec) mysql> insert into DemoTable835 values(103, 'ENG'); Query OK, 1 row affected (0.09 sec)Display all records from the table using select statement −mysql> select *from DemoTable835;This will produce the following ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
698 Views
To update only month in date, use MONTH(). Let us first create a table −mysql> create table DemoTable861(AdmissionDate date); Query OK, 0 rows affected (1.22 sec)Insert some records in the table using insert command −mysql> insert into DemoTable861 values('2019-01-21'); Query OK, 1 row affected (0.31 sec) mysql> insert into DemoTable861 values('2018-01-01'); Query OK, 1 row affected (0.49 sec) mysql> insert into DemoTable861 values('2016-01-02'); Query OK, 1 row affected (1.27 sec) mysql> insert into DemoTable861 values('2018-01-14'); Query OK, 1 row affected (0.47 sec)Display all records from the table using select statement −mysql> select *from DemoTable861;This will produce the following output −+---------------+ ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
451 Views
Let us first create a table −mysql> create table DemoTable834( Value1 int, Value2 int ); Query OK, 0 rows affected (1.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable834 values(10, 20); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable834 values(40, 50); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable834 values(20, 24); Query OK, 1 row affected (0.29 sec) mysql> insert into DemoTable834 values(30, 10); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable834;This will produce the following ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
3K+ Views
To skip rows, use LIMIT OFFSET. Let us first create a table −mysql> create table DemoTable860( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100) ); Query OK, 0 rows affected (0.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable860(Name) values('Chris'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable860(Name) values('Robert'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable860(Name) values('David'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable860(Name) values('Bob'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable860(Name) values('Mike'); Query OK, 1 row ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
316 Views
To make numbers ‘human readable’ i.e. including separators, you need to use format(). Let us first create a table −mysql> create table DemoTable859(Number bigint); Query OK, 0 rows affected (1.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable859 values(747464646473737); Query OK, 1 row affected (0.45 sec) mysql> insert into DemoTable859 values(3836365366464); Query OK, 1 row affected (0.71 sec) mysql> insert into DemoTable859 values(8376437647433); Query OK, 1 row affected (0.46 sec)Display all records from the table using select statement −mysql> select *from DemoTable859;This will produce the following output −+-----------------+ | Number | ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
300 Views
Let us first create a table −mysql> create table DemoTable833(ArrivalTime datetime); Query OK, 0 rows affected (0.79 sec)Insert some records in the table using insert command −mysql> insert into DemoTable833 values('2019-01-10 12:40:50'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable833 values('2019-02-16 11:10:30'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable833 values('2018-03-17 10:00:10'); Query OK, 1 row affected (0.20 sec)Display all records from the table using select statement −mysql> select *from DemoTable833;This will produce the following output −+---------------------+ | ArrivalTime | +---------------------+ | 2019-01-10 12:40:50 | | ... Read More