- 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
AmitDiwan has Published 11365 Articles
AmitDiwan
386 Views
Let us first create a table −mysql> create table DemoTable( EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY, EmployeeName varchar(100), JoiningDate date ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(EmployeeName, JoiningDate) values('Chris', '2019-01-21'); Query OK, 1 ... Read More
AmitDiwan
4K+ Views
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.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name) values('John'); Query OK, 1 row affected (0.10 sec) mysql> ... Read More
AmitDiwan
2K+ Views
The statement SELECT TRUE returns 1 if a row match. Let us first create a table −mysql> create table DemoTable(Name varchar(100)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert ... Read More
AmitDiwan
184 Views
Let us first create a table −mysql> create table DemoTable(GetSundayDate date); Query OK, 0 rows affected (0.44 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-08-07'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('2018-09-05'); Query OK, 1 row affected (0.22 sec) ... Read More
AmitDiwan
618 Views
To convert varchar to unsigned integer, use CAST() function. Let us first create a table −mysql> create table DemoTable868(Amount varchar(100)); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable868 values('781'); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More
AmitDiwan
1K+ Views
For this, use LIMIT and OFFSET. Let us first create a table −mysql> create table DemoTable867(EmployeeSalary int); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable867 values(63737); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable867 values(899833); Query ... Read More
AmitDiwan
2K+ Views
For this, use CASE statement and set for both SUM and SUBTRACTION. Let us first create a table −mysql> create table DemoTable866( Status varchar(100), Amount int ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable866 values('ACTIVE', 50); ... Read More
AmitDiwan
297 Views
The SELECT(COLNAME) means, we are creating an alias for that column. Let us see an example and create a table −mysql> create table DemoTable865( FirstName varchar(100), LastName varchar(100) ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using insert command −mysql> insert into DemoTable865 ... Read More
AmitDiwan
132 Views
Let us first create a table −mysql> create table DemoTable839( StudentFirstName varchar(100), StudentLastName varchar(100) ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable839 values('Chris', 'Brown'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable839 values('', ... Read More
AmitDiwan
139 Views
For this, use the ENUM data type. Let us first create a table −mysql> create table DemoTable838(Color ENUM('RED', 'GREEN', 'BLUE')); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable838 values('RED'); Query OK, 1 row affected (0.11 sec) mysql> insert into ... Read More