
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Kumar Varma has Published 107 Articles

Kumar Varma
248 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Subject varchar(100) -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Subject) values('C'); Query ... Read More

Kumar Varma
161 Views
The stripos() equivalent in MySQL is INSTR(), which returns the position of the first occurrence of a string in another string. Following is the syntax −select instr(yourColumnName, yourWord) As anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> Title text -> ... Read More

Kumar Varma
148 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (1.32 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('JOhn'); Query OK, 1 row affected (0.17 sec) mysql> insert ... Read More

Kumar Varma
1K+ Views
For this, you can use subquery. Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command ... Read More

Kumar Varma
251 Views
For this, you can use the mid() function. Following is the syntax −select mid(yourColumnName, yourPositionToStart, yourEndValue) as anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> Title text -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the ... Read More

Kumar Varma
177 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20), -> Age int -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert ... Read More

Kumar Varma
319 Views
Let us first get the current date using CURDATE(). The current date is as follows −mysql> select CURDATE(); +------------+ | CURDATE() | +------------+ | 2019-06-09 | +------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> create table DemoTable -> ( -> Id int ... Read More

Kumar Varma
505 Views
For this, you can use GROUP BY and use COUNT to get only non-duplicate values. Following is the syntax −select yourColumnName from yourTableName group by yourColumnName having count(*)=1;Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ... Read More

Kumar Varma
189 Views
Let us first create a table. We have used AUTO_INCREMENT while creating the table to set auto increment for StudentId −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT, -> StudentFirstName varchar(100), -> StudentLastName varchar(100), -> StudentAge int, -> StudentCountryName varchar(100), ... Read More

Kumar Varma
171 Views
To count where more than three column values are true, you can use WHERE clause. Let us first create a table −mysql> create table DemoTable -> ( -> isMarried boolean, -> isActive boolean, -> isMember boolean, -> isOn boolean -> ); Query OK, 0 ... Read More