- 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
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
449 Views
Let us first create a table −mysql> create table DemoTable -> ( -> FirstName varchar(100), -> Age int, -> Score int -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Robert', 21, 78); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values('Bob', 20, 90); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Sam', 22, 69); Query OK, 1 row affected (0.20 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+-----------+------+-------+ | ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
1K+ Views
Use BETWEEN and INTERVAL to achieve this. Let us first create a table −mysql> create table DemoTable -> ( -> AdmissionDate date -> ); Query OK, 0 rows affected (0.84 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-09-30'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('2019-10-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('2019-03-30'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('2019-04-24'); Query OK, 1 row affected (0.17 sec)Display all records from the table using select ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
89 Views
For this, use the following syntax, wherein we have used SHOW GRANTS −SHOW GRANTS FOR 'yourUserName'@'yourHostName';HostName may be ‘%’ or localhost.Let us implement the above syntax in order to show grants from ROOT −mysql> SHOW GRANTS FOR 'root'@'%' ;Output+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@% ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
192 Views
You can use TIME_FORMAT(). Let us first create a table −mysql> create table DemoTable -> ( -> PunchIn time, -> PunchOut time, -> Launch time -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('9:00', '6:00', '1:00:00'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('9:30', '6:10', '00:30:00'); Query OK, 1 row affected (0.21 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+----------+----------+----------+ | PunchIn | PunchOut | Launch | +----------+----------+----------+ | 09:00:00 | ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
106 Views
For this, use the substring_index() method. Let us first create a table −mysql> create table DemoTable -> ( -> FolderName varchar(100), -> FolderLocation varchar(200) -> ); Query OK, 0 rows affected (1.03 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('CProgram', 'C:/AllPrograms/.....'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Images', 'E:/MyImage/home/garbage'); Query OK, 1 row affected (0.15 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+------------+-------------------------+ | FolderName | FolderLocation | +------------+-------------------------+ | CProgram | C:/AllPrograms/..... ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
108 Views
You can use DATE_ADD() function from MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> ShippingDate varchar(100) -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('06-01-2019'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('01-04-2017'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('29-06-2019'); Query OK, 1 row affected (0.47 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+--------------+ | ShippingDate | +--------------+ | 06-01-2019 | ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
100 Views
Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentScore varchar(100) -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentScore) values('90'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable(StudentScore) values('100'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(StudentScore) values('56'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable(StudentScore) values('98'); Query OK, 1 row affected (0.13 sec)Display all records from the table ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
221 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name, Age) values('Robert', 24); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(Name, Age) values('Chris', 22); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+----+--------+------+ | Id | Name | Age | +----+--------+------+ ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
87 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100), -> DueDate datetime -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-05” −mysql> insert into DemoTable values('Chris', '2019-06-24'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('Chris', '2018-01-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Robert', '2019-07-05'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('Carol', '2019-08-03'); Query OK, 1 row affected (0.22 ... Read More
![Naveen Singh](https://www.tutorialspoint.com/assets/profiles/13881/profile/60_68188-1512710896.jpg)
208 Views
For this, concatenate both the date and time using CONCAT() function. Let us first create a table −mysql> create table DemoTable -> ( -> ShippingDate date, -> ShippingTime time, -> ShippingDatetime datetime -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ShippingDate, ShippingTime) values('2019-01-10', '10:40:20'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(ShippingDate, ShippingTime) values('2019-06-14', '04:00:10'); Query OK, 1 row affected (0.14 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+--------------+--------------+------------------+ | ShippingDate | ShippingTime | ... Read More