AmitDiwan has Published 10740 Articles

Get sum of column with conditions in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:21:21

362 Views

Let us first create a table −mysql> create table DemoTable1489    -> (    -> ProductId int,    -> ProductPrice int    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1489 values(100, 900); Query OK, 1 row affected ... Read More

Using EXPLAIN keyword in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:12:01

415 Views

MySQL EXPLAIN gives a query execution plan. EXPLAIN can be used in the beginning with SELECT, INSERT, DELETE, REPLACE, and UPDATE.To avoid the complete table scan in database, you need to use index. Let us first create a table −mysql> create table DemoTable1488    -> (    -> StudentId int, ... Read More

How to create a shallow copy of SortedList Object in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:10:26

238 Views

To create a shallow copy of SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList list = new SortedList();       list.Add("A", "Jacob");       list.Add("B", "Sam");       list.Add("C", ... Read More

Sort data column to retrieve max textual value in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:08:26

120 Views

For this, you can use ORDER BY along with some aggregate function right(). Let us first create a table −mysql> create table DemoTable1487    -> (    -> StudentCode text    -> ); Query OK, 0 rows affected (0.91 sec)Insert some records in the table using insert command −mysql> insert ... Read More

How to fetch the newly added records from a MySQL table?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:06:49

641 Views

For this, you can use ORDER BY with LIMIT. Here, LIMIT is used to set the limit (count) of records you want to fetch. Let us first create a table −mysql> create table DemoTable1486    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(20) ... Read More

How to play Beep sound through Console in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:05:47

300 Views

To play beep sound through Console, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args){       Console.WriteLine("Displaying standard output stream...");       Console.WriteLine("Standard Output Stream = "+Console.Out);       Console.WriteLine("Beep sound through Console");       Console.Beep(); ... Read More

How to perform a specified action on each element of the List in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:03:03

259 Views

To perform a specified action on each element of the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void demo(int s){       s = s * 10;       Console.WriteLine(s);    }    public static void Main(String[] ... Read More

How to insert the elements of a collection into the List at the specified index in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 12:27:32

316 Views

To insert the elements of a collection into the List at the specified index, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       string[] strArr = { "John", "Tom", "Kevin", "Mark", "Gary" };       ... Read More

How to get TypeCode in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 12:25:28

214 Views

To get TypeCode in C#, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       string s = "Demo";       Console.WriteLine("String = " +s);       Console.WriteLine("String Type = " +s.GetType());       Console.WriteLine("GetTypeCode = " ... Read More

How to get the Standard Input and Output Stream through Console in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 12:23:12

438 Views

To get the standard input stream through Console, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(string[] args){       Console.WriteLine("Displaying standard input stream...");       Console.WriteLine("Standard Input Stream = "+Console.In);    } }OutputThis will produce the following output −Displaying ... Read More

Advertisements