- 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
75 Views
For this, use LEFT() method. For manipulation, we have used the LOCATE() and the REVERSE() method.Let us first create a table −mysql> create table DemoTable ( Title text ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('$/This$is[MySQL]$/MySQL[FirstClass]$MySQL[SecondClass]'); ... Read More
AmitDiwan
92 Views
For such string manipulations, you need to use MySQL SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable ( SystemIpAddress text ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('192.168.130.67'); Query OK, 1 row affected ... Read More
AmitDiwan
96 Views
No, there’s no need to insert auto_increment column values, since it begins from 1 and inserts on its own. This is because we have set it as auto increment. Let us first create a table −mysql> create table DemoTable ( EmployeeId int NOT NULL AUTO_INCREMENT, EmployeeName varchar(30), ... Read More
AmitDiwan
312 Views
Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, Score int ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Score) values(56); Query OK, 1 row affected (0.24 sec) ... Read More
AmitDiwan
331 Views
For this, use FLOOR() function. Here, we will be fetching records like 12.00, 35.00, etc. from a list with records like 5.23, 8.76, 12.00, 22.68, etc. Let us first create a table −mysql> create table DemoTable ( Value DECIMAL(4, 2) ); Query OK, 0 rows affected (0.53 sec)Insert some ... Read More
AmitDiwan
1K+ Views
Let us first create a table −mysql> create table DemoTable ( Marks int ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(88); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(65); Query OK, 1 ... Read More
AmitDiwan
383 Views
Use DELETE for this. Let us first create a table −mysql> create table DemoTable ( Name varchar(40), Score1 int , Score2 int ); Query OK, 0 rows affected (2.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John', 56, 76); Query OK, ... Read More
AmitDiwan
147 Views
Let’s say the current date is 2019-09-06. For our example, we will first create a table −mysql> create table DemoTable ( AdmissionDate date ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-08'); Query OK, 1 row affected ... Read More
AmitDiwan
684 Views
Let us first create a table −mysql> create table DemoTable ( Code varchar(100) ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('8565-9848-7474'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('9994-6464-8737'); Query OK, 1 ... Read More
AmitDiwan
460 Views
To convert, use JSON.stringify(). Following is the code to convert MySQL DATETIME value to JSON format in JavaScript − var mySQLDateTime = new Date("Fri Sep 06 2019 22 −54 −48 "); var yearValue = mySQLDateTime.getFullYear(); var dateValue = mySQLDateTime.getDate(); var monthValue=mySQLDateTime.getMonth(); var hour=mySQLDateTime.getHours(); var minutes=mySQLDateTime.getMinutes(); var second=mySQLDateTime.getSeconds(); jsonObject={"year" −yearValue, "month" ... Read More