- 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
Kumar Varma has Published 110 Articles
Kumar Varma
146 Views
To get the character length, use the CHAR_LENGTH() method. Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (1.04 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query ... Read More
Kumar Varma
2K+ Views
To create a temporary table in a MySQL procedure, following is the syntax −CREATE PROCEDURE yourProcedureName() BEGIN CREATE TEMPORARY TABLE yourTemporaryTableName SELECT yourValue; ENDLet us implement the above syntax to create a temporary table and insert some records in the table. Following is the query ... Read More
Kumar Varma
1K+ Views
To display structure of a table, following is the syntax −show create table yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> EmployeeFirstName varchar(100), -> EmployeeLastName varchar(100), -> EmployeeAge int, -> isMarried ... Read More
Kumar Varma
82 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int, -> Value int -> ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 85885); Query OK, 1 row affected ... Read More
Kumar Varma
272 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.87 sec)Insert some records in the table using insert command −mysql> insert ... Read More
Kumar Varma
88 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Code varchar(100) -> ); Query OK, 0 rows affected (1.07 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('/101/102/106'); Query OK, 1 row affected (0.14 sec) mysql> insert ... Read More
Kumar Varma
53 Views
Yes, you can use LEAST() function from MySQL −select least(yourColumnName1, yourColumnName2, ...N) from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> Date1 date, -> Date2 date, -> Date3 date -> ); Query OK, 0 rows affected (0.54 sec)Insert some records ... Read More
Kumar Varma
168 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Amount int, -> SubTotal int -> ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −ysql> insert into DemoTable(Amount) values(50); Query OK, 1 row affected (0.17 sec) mysql> insert ... Read More
Kumar Varma
85 Views
Let us first see the syntax of IF NOT IN in MySQL −if(yourVariableName NOT IN (yourValue1, yourValue2, ........N) ) then statement1 else statement2 endif Let us implement the above syntax to use IF NOT IN −mysql> DELIMITER // mysql> CREATE PROCEDURE IF_NOT_INDemo(IN value int) -> ... Read More
Kumar Varma
46 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Value int -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.21 sec) mysql> insert ... Read More