AmitDiwan has Published 11365 Articles

HTML onsearch Event Attribute

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:53:54

73 Views

The HTML onsearch event attribute is triggered when a user hit “Enter” key in an HTML input element with type=”text” in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onsearch event Attribute −Example Live Demo    body {       color: #000; ... Read More

HTML onscroll Event Attribute

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:50:33

127 Views

The HTML onscroll event attribute is triggered when an HTML element is scrolled by using its scrollbar in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onscroll event Attribute −Example Live Demo    body {       color: #000;       ... Read More

HTML onsubmit Event Attribute

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:47:37

312 Views

The HTML onsubmit event attribute is triggered when the form is submitted in an HTML document.SyntaxFollowing is the syntax −Let us see an example of HTML onsubmit event Attribute −Example Live Demo    body {       color: #000;       height: 100vh;       ... Read More

How to find specific row with a MySQL query?

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:39:45

294 Views

Let us first create a table −mysql> create table DemoTable (    UserId int,    UserName varchar(100) ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable ... Read More

MySQL query to display the count of distinct records from a column with duplicate records

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:37:34

134 Views

Let us first create a table −mysql> create table DemoTable (    StudentId int,    StudentFirstName varchar(100) ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'John'); Query OK, 1 row affected (0.32 sec) mysql> insert into DemoTable ... Read More

More elegant way to insert empty java.sql.Date in MySQL Database?

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:31:50

302 Views

Let us first create a table. Following is the query to create a table in database ‘web’ −mysql> create table DemoTable (    AdmissionDate date ); Query OK, 0 rows affected (0.53 sec)Here is the Java code to insert empty(NULL) java.sql.Date in MySQL DB −import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; ... Read More

Remove trailing numbers surrounded by parenthesis from a MySQL column

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:26:46

133 Views

For this, use trim() along with substring(). Let us first create a table −mysql> create table DemoTable (    Name varchar(100) ); Query OK, 0 rows affected (0.80 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('1stJohn'); Query OK, 1 row affected (0.10 sec) mysql> ... Read More

MySQL query to group concat distinct by Id?

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:24:55

375 Views

Let us first create a table −mysql> create table DemoTable (    Id int,    Name varchar(100) ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.44 sec) mysql> insert into DemoTable ... Read More

MySQL query to replace backslash from a varchar column with preceding backslash string values

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:22:18

1K+ Views

Let us first create a table −mysql> create table DemoTable (    Title varchar(100) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('\"MySQL'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('MongoDB\"'); Query OK, 1 ... Read More

Is it necessary to add DEFAULT NULL in MySQL?

AmitDiwan

AmitDiwan

Updated on 26-Sep-2019 08:19:44

2K+ Views

No, it isn’t necessary because without adding DEFAULT NULL, it gives NULL value. For example, let’s say you haven’t added DEFAULT NULL and inserted a record with no value, then the result would display the NULL value as the inserted value.Let us first create a table −mysql> create table DemoTable ... Read More

Advertisements