
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 10744 Articles

AmitDiwan
888 Views
For this, use count(*) and the divide the count of two different sets of rows. Let us first create a table −mysql> create table DemoTable(isMarried tinyint(1)); Query OK, 0 rows affected (0.53 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1); Query OK, 1 row ... Read More

AmitDiwan
767 Views
To copy all rows of a table to another table, use the below syntax −insert into yourTableName2(yourColumnName1, ...N) select yourColumnName1, ..N from yourTableName1;Let us first create a table −mysql> create table DemoTable1(FirstName varchar(100)); Query OK, 0 rows affected (1.11 sec)Insert some records in the table using insert command −mysql> insert ... Read More

AmitDiwan
502 Views
Let’s say we have two tables and both of them have two columns PlayerId and PlayerScore. We need to add the PlayerScore from both these tables, but only for a particular PlayerId.For this, you can use UNION. Let us first create a table −mysql> create table DemoTable1(PlayerId int, PlayerScore int); ... Read More

AmitDiwan
2K+ Views
Let us first create a table −mysql> create table DemoTable(DueDate datetime); Query OK, 0 rows affected (0.94 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-07-10 04:20:00'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('2019-07-10 05:10:40'); Query OK, 1 row affected ... Read More

AmitDiwan
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

AmitDiwan
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

AmitDiwan
560 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

AmitDiwan
148 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

AmitDiwan
280 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

AmitDiwan
171 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