AmitDiwan has Published 10740 Articles

Using CREATE TABLE AS statement with UNION of two tables in MySQL

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 10:54:03

2K+ Views

For this, you can use UNION. Let us first create a table −mysql> create table DemoTable1(FirstName varchar(1000)); Query OK, 0 rows affected (1.22 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('John'); Query OK, 1 row affected (0.20 sec)Display all records from the table using ... Read More

How to check an empty table already in a MySQL database?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 10:48:25

2K+ Views

To check an empty table is in a database, you need to extract some records from the table. If the table is not empty then the table records would be returned.Let us first create a table −mysql> create table DemoTable(Id int, Name varchar(100), Age int); Query OK, 0 rows affected ... Read More

How to order by auto_increment in MySQL?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 10:42:20

581 Views

Let us first create a table −mysql> create table DemoTable(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100)); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName) values('Chris'); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable(FirstName) values('Robert'); ... Read More

HTML DOM Input Password type property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 10:39:46

172 Views

The HTML DOM Input password type property is associated with the input element having its type=”password”. It will always return password for the input password element.SyntaxFollowing is the syntax for password type property −passwordObject.typeExampleLet us look at an example for the Input password type property − Live Demo password ... Read More

Facing difficulty in removing the apostrophe in MySQL stored procedure?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 10:26:46

305 Views

To remove apostrophe, replace it. For this, you can use REPLACE(). Following is the syntax −SET anyVariableName = REPLACE(yourVaribleName , '\'', '');To understand the above syntax, let us create a stored procedure to remove the apostrophe in MySQL −mysql> DELIMITER // mysql> CREATE PROCEDURE remove_Apostrophe(IN Value VARCHAR(200))    BEGIN   ... Read More

HTML DOM Input Password size property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 09:12:03

198 Views

The HTML DOM Input Password size property is used for setting or returning the input password size attribute value. It is used for defining the password field width in terms of characters. The default width is of 20 characters.SyntaxFollowing is the syntax for −Setting the password size property −passwordObject.size = ... Read More

HTML DOM Input Password required property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 09:04:18

187 Views

The HTML DOM input password required property is associated with the required attribute of an element. The required property is used for setting and returning if it is necessary to fill some password field or not before the form is submitted to the server. This allows the form to ... Read More

HTML DOM Input Password readOnly property

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 08:52:39

177 Views

The HTML DOM Input Password readOnly property is used for setting or returning whether the input password field is read-only or not. The readOnly property makes the element non-editable but it can still be focused by tab or by clicking. If there is a default value inside a read-only element ... Read More

MySQL isn’t inserting binary data properly? Which datatype should be used?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 08:48:59

663 Views

For this, use BIT data type. Let us first create a table −mysql> create table DemoTable(binaryValue BIT(5)); Query OK, 0 rows affected (0.83 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(15); Query ... Read More

MySQL float data field not accepting every float number? How to fix this?

AmitDiwan

AmitDiwan

Updated on 22-Aug-2019 08:40:52

210 Views

To get fixed float data type, use DECIMAL(). This will fix the issue of unacceptance. Let us first create a table −mysql> create table DemoTable(Amount DECIMAL(10, 2)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(2194848.90); Query OK, 1 ... Read More

Advertisements