![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
![Rishi Rathor](https://www.tutorialspoint.com/assets/profiles/13563/profile/60_89283-1512714754.jpg)
1K+ Views
To select MySQL based on month and year, use in-built function YEAR() and MONTH(). The syntax is as follows −select *from yourTableName where YEAR(yourColumnName) = YearValue AND MONTH(yourColumnName) = monthValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table selectDataOnYearandMonthDemo −> ( −> BookId int, −> BookName varchar(100), −> BookDueDate datetime −> ); Query OK, 0 rows affected (0.57 sec)Now you can insert some records in the table. The query is as ... Read More
![Jennifer Nicholas](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
794 Views
To insert the current date (not time), then you can use in-built function CURDATE() from MySQL. The syntax is as follows −INSERT INTO yourTableName values(curdate());Or if you want to add date and time both then you can use the in-built function NOW() from MySQL. The syntax is as follows −INSERT INTO yourTableName values(now());To understand both the syntax, let us first create a table. The query to create a table is as follows −mysql> create table NowAndCurdateDemo −> ( −> YourDueDate datetime −> ); Query OK, 0 rows affected (1.75 sec)Implement both ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
3K+ Views
In order to install MySQL command line client for Windows, you need to visit the following URL to get the download link https://dev.mysql.com/downloads/mysql/ −The snapshot is as follows −After that you need to select operating system. The snapshot is as follows −You need to choose Windows (x86, 32/64-bit) and download the installer.
![Vrundesha Joshi](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
1K+ Views
To know whether a MySQL table is using MyISAM or InnoDB engine then you can use below syntax.The below syntax can be used for multiple tables −show table status from yourDatabaseName;Here is the syntax that can be used for a specific table i.e. to know the engine of a table −show table status from yourDatabaseName Like ‘yourTableName’.The following is the query to display engine of all the tables −mysql> show table status from sampleTest;The following is the output −+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | ... Read More
![Rishi Rathor](https://www.tutorialspoint.com/assets/profiles/13563/profile/60_89283-1512714754.jpg)
323 Views
To update the column size, you can use alter command. The syntax is as follows −alter table yourTableName change yourColumnName yourColumnName data type;To understand the above syntax, let us create a table. The query to create a table −mysql> create table DataTruncated −> ( −> id int, −> Name varchar(5) −> ); Query OK, 0 rows affected (0.64 sec)Look at the column ‘Name’ above, the column size is 5. Whenever we will give the size greater than 5 then MySQL gives the following error −mysql> ... Read More
![Jennifer Nicholas](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
4K+ Views
To get the primary key of a table, you can use the show command. The syntax is as follows −SHOW INDEX FROM yourDatebaseName.yourTableName WHERE Key_name = 'PRIMARY';Suppose, we have a table with two primary keys; one of them is “Id” and second is “RollNum". The query for a table is as follows −mysql> create table TwoOrMorePrimary −> ( −> Id int, −> Name varchar(200), −> RollNum int −> , −> Primary key(Id, Age) −> ); Query OK, 0 rows affected (0.85 sec)Apply the above syntax to get primary key of a table. ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
6K+ Views
Delimiters can be used when you need to define the stored procedures, function as well as to create triggers. The default delimiter is semicolon.You can change the delimiters to create procedures and so on. However, but if you are considering multiple statements, then you need to use different delimiters like $$ or //.Here we have a table “GetRecordFromNow” wherein the following are the records −+---------------------+ | YourDateTime | +---------------------+ | 2018-12-07 22:30:18 | | 2018-12-03 22:30:31 | | 2018-12-02 22:30:41 | | 2018-12-01 22:30:56 | | 2018-12-03 22:31:04 | +---------------------+ 5 rows in ... Read More
![Vrundesha Joshi](https://www.tutorialspoint.com/assets/profiles/13566/profile/60_88163-1512715024.jpg)
1K+ Views
To get records from NOW()-1 Day, you can use the following syntax −select *from yourTableName where yourColumnName >=now()-interval 1 day;To understand the above syntax, let us first create a table. The query to create a table.mysql> create table GetRecordsFromNow −> ( −> YourDateTime datetime −> ); Query OK, 0 rows affected (1.76 sec)Now insert some dates into the fields. The query to insert records are as follows −mysql> insert into GetRecordsFromNow values(date_add(now(), interval 3 day)); Query OK, 1 row affected (0.28 sec) mysql> insert into GetRecordsFromNow values(date_add(now(), interval -1 day)); ... Read More
![Rishi Rathor](https://www.tutorialspoint.com/assets/profiles/13563/profile/60_89283-1512714754.jpg)
9K+ Views
You can change the column position of MySQL table without losing data with the help of ALTER TABLE command. The syntax is as follows −ALTER TABLE yourTableName MODIFY yourColumnName1 data type AFTER yourColumnName2;To understand the above concept, let us create a table. The query to create a table with some columns is as follows −mysql> create table changeColumnPositionDemo −> ( −> StudentId int, −> StudentAddress varchar(200), −> StudentAge int, −> StudentName varchar(200) −> ); Query OK, 0 rows affected (0.72 sec)Let us insert some data in the table. The query to insert records is as follows -.mysql> insert into changeColumnPositionDemo ... Read More
![Jennifer Nicholas](https://www.tutorialspoint.com/assets/profiles/13569/profile/60_88876-1512715262.jpg)
660 Views
You can search for a string within text column in MySQL with the help of LIKE clause. The syntax is as follows −select *from yourTableName where yourColumnName like '%anyStringValue%';To use the above syntax, let us first create a table −mysql> create table SearchTextDemo −> ( −> BookName TEXT −> ); Query OK, 0 rows affected (0.55 sec)Insert some strings in the table. The query is as follows −mysql> insert into SearchTextDemo values('Let us C'); Query OK, 1 row affected (0.28 sec) mysql> insert into SearchTextDemo values('C in Depth'); Query OK, 1 row affected (0.14 sec) ... Read More