
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
3K+ Views
To perform multiple inserts, the syntax is as follows −insert into yourTableName(yourColumnName1, yourColumnName2, yourColumnName3, ..N) select yourValue1 as yourColumnName1, yourValue2 as yourColumnName2, yourValue3 as yourColumnName3, ......N union select yourValue1 as yourColumnName1, yourValue2 as yourColumnName2, yourValue3 as yourColumnName3, ......N . . NTo understand the above syntax, let us ... Read More

AmitDiwan
319 Views
For this, use RLIKE and filter records as in the below syntax &Minus;select * from yourTableName where yourColumnName rlike 'yourValue1|yourValue2';Let us first create a table −mysql> create table DemoTable1935 ( Subject varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using ... Read More

AmitDiwan
262 Views
The hasClass() method in jQuery is used to check if any of the selected elements is having a specified class name.SyntaxThe syntax is as follows −$(selector).hasClass(classname)Above, the parameter class name is the class name to search for in the selected elements.ExampleLet us now see an example to implement the jQuery ... Read More

AmitDiwan
537 Views
For getting average, use AVG() and use it with DISTINCT to calculate from distinct records. Let us first create a table −mysql> create table DemoTable1934 ( StudentName varchar(20), StudentMarks int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More

AmitDiwan
315 Views
The has() method in jQuery is used to return elements having one or more elements inside them, that matches the specified selector.SyntaxThe syntax is as follows−$(selector).has(ele)Above, the parameter ele is used to specify a selector expression or an element to match elements against.ExampleLet us now see an example to implement ... Read More

AmitDiwan
1K+ Views
Let us first create a table −mysql> create table DemoTable1933 ( ClientName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1933 values('Chris Brown'); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1933 values('David ... Read More

AmitDiwan
368 Views
Use ORDER BY to fix a record and then displayselect * from yourTableName order by yourColumnName1=yourValue desc, yourColumnName2;Let us first create a table −mysql> create table DemoTable1932 ( UserName varchar(20), ShippingDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using ... Read More

AmitDiwan
729 Views
For month and year in a specific format, use DATE_FORMAT() along with STR_TO_DATE(). Let us first create a table −mysql> create table DemoTable1931 ( ShippingDate varchar(40) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1931 values('10-11-2017'); ... Read More

AmitDiwan
567 Views
For this, you can use date_add(). Let us first create a table −mysql> create table DemoTable1930 ( DueTime datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1930 values('2017-10-21'); Query OK, 1 row affected (0.00 sec) ... Read More

AmitDiwan
629 Views
To reset primary key, at first use TRUNCATE table, then use ALTER TABLE. Let us first create a table −mysql> create table DemoTable1929 ( UserId int NOT NULL AUTO_INCREMENT, PRIMARY KEY(UserId) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert ... Read More