
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
169 Views
For random rows, you can use RAND(), whereas to fix a specific column, use ORDER BY clause. Let us create a table −mysql> create table DemoTable1921 ( Number int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert ... Read More

AmitDiwan
10K+ Views
To group marks, use MySQL GROUP BY. To sum, use MySQL sum()function. Let us first create a table −mysql> create table DemoTable1920 ( StudentName varchar(20), StudentMarks int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

AmitDiwan
554 Views
You can use DECLARE in a stored procedure. The syntax is as follows −declare yourVariableName yourDataType;To understand the above syntax, let us create a stored procedure:mysql> delimiter // mysql> create procedure square_demo(in Value int) begin declare magicValue int; set magicValue=Value; select concat('Your Square Value=', magicValue*magicValue) as ... Read More

AmitDiwan
228 Views
Filtering methods in jQuery include eq(), filter(), not(), etc. Let us see some of them here−not() methodThe not() method in jQuery is used to return elements that do not match specific criteria.ExampleLet us see an example to implement the jQuery not() method− Live Demo $(document).ready(function(){ ... Read More

AmitDiwan
3K+ Views
To fix the error, let us see how to create a user correctly. Let us create a user −mysql> create user 'Emma'@'localhost' IDENTIFIED BY 'emma_654'; Query OK, 0 rows affected (0.00 sec)Let us display all users along with host −mysql> select user, host from MySQL.user;This will produce the following output. ... Read More

AmitDiwan
122 Views
For this, you can use UNION ALL along with WHERE NOT EXISTS and implement NOT IN to ignore the values already in the table. Use SELECT with UNION ALL to add values not already in the table.Let us first create a table −mysql> create table DemoTable1918 ( Value ... Read More

AmitDiwan
564 Views
To parse a CSV file in PHP, the code is as follows. Under fopen(), set the path of the .csv file−Example$row_count = 1; if (($infile = fopen("path to .csv file", "r")) !== FALSE) { while (($data_in_csv = fgetcsv($infile, 800, ", ")) !== FALSE) { $data_count = ... Read More

AmitDiwan
185 Views
To get all rows apart from first and last, use subquery along with MIN() and MAX(). Let us first create a table −mysql> create table DemoTable1917 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentCode int, StudentMarks int ); Query OK, 0 rows affected (0.00 ... Read More

AmitDiwan
2K+ Views
The 'foreach' is slow in comparison to the 'for' loop. The foreach copies the array over which the iteration needs to be performed.For improved performance, the concept of references needs to be used. In addition to this, ‘foreach’ is easy to use.ExampleBelow is a simple code example − Live DemoOutputThis will ... Read More

AmitDiwan
184 Views
For this, set conditions using MySQL CASE statement −mysql> create table DemoTable1916 ( StudentName varchar(20), StudentMarks int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1916 values('Chris', 59); Query OK, 1 row affected (0.00 sec) ... Read More