See How Long Statements Take to Execute on MySQL Command Line

AmitDiwan
Updated on 16-Dec-2019 06:44:39

176 Views

For every single statement on MySQL command line, it shows the exact time to execute the specific statement.Let us first create a table −mysql> create table DemoTable1589    -> (    -> EmployeeId int,    -> EmployeeName varchar(20)    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1589 values(101, 'Sam'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable1589 values(102, 'Bob'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable1589 values(103, 'David'); Query OK, 1 row affected (0.16 sec)Display all records from the table ... Read More

Select Maximum of Sum of Two Columns in MySQL

AmitDiwan
Updated on 16-Dec-2019 06:42:04

633 Views

To select maximum of sum of two columns, use aggregate function MAX() along with subquery. Let us first create a table −mysql> create table DemoTable1587    -> (    -> Value1 int,    -> Value2 int    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1587 values(30, 50); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1587 values(80, 90); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1587 values(40, 67); Query OK, 1 row affected (0.13 sec)Display all records from the table using select ... Read More

HybridDictionary Class in C#

AmitDiwan
Updated on 16-Dec-2019 06:41:19

191 Views

The HybridDictionary class implements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large.Following are the properties of the HybridDictionary class −Sr.NoProperty & Description1CountGets the number of key/value pairs contained in the HybridDictionary.2IsFixedSizeGets a value indicating whether the HybridDictionary has a fixed size.3IsReadOnlyGets a value indicating whether the HybridDictionary is read-only.4IsSynchronizedGets a value indicating whether the HybridDictionary is synchronized (thread safe).5Item[Object]Gets or sets the value associated with the specified key.6KeysGets an ICollection containing the keys in the HybridDictionary.7SyncRootGets an object that can be used to synchronize access to the ... Read More

Using Control Aggregation in SAPUI5

Govinda Sai
Updated on 16-Dec-2019 06:40:35

788 Views

“ControlAggregation” refers to the target aggregation to which the mapped view is added.As Specified in the use case below:"routing": {    "config": {       "routerClass": "sap.m.routing.Router",       "viewType": "XML",       "viewPath": "sap.ui.demo.nav.view",       "controlId": "app",       "controlAggregation": "dummy",       "transition": "slide",       "bypassed": {          "target": "NA"       }ExampleThe views are defined as follows:     So here “controlAggregation” is named as 'dummy' but the app is named as SampleApp.so the target is 'sap.m.SampleApp' and aggregation is named as 'dummy'. Let ... Read More

Display Information About Field Names in MySQL

AmitDiwan
Updated on 16-Dec-2019 06:39:14

118 Views

To display information about field names, the syntax is as follows −show columns from yourTableName;Let us first create a table −mysql> create table DemoTable1586    -> (    -> EmployeeId int,    -> EmployeeFirstName varchar(20),    -> EmployeeLastName varchar(20),    -> EmployeeAge int,    -> EmployeeCountryName varchar(20),    -> EmployeeSalary int    -> ); Query OK, 0 rows affected (0.78 sec)Following is the query to display field names −mysql> show columns from DemoTable1586;This will produce the following output −+---------------------+-------------+------+-----+---------+-------+ | Field               | Type        | Null | Key | Default | ... Read More

Unique and Multiple Insertion with Duplicate Values in Set

AmitDiwan
Updated on 16-Dec-2019 06:35:52

138 Views

An error will arise and nothing will get inserted in the table Let us see an example and create a table −mysql> create table DemoTable1585    -> (    -> StudentId int,    -> StudentMarks int,    -> UNIQUE(StudentId)    -> ); Query OK, 0 rows affected (1.02 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1585 values(1,87),(2,98),(3,91),(3,48); ERROR 1062 (23000): Duplicate entry '3' for key 'StudentId'Display all records from the table using select statement −mysql> select * from DemoTable1585;This will produce the following output. Nothing gets inserted:Empty set (0.00 sec)

Get Synchronized Access to an Array in C#

AmitDiwan
Updated on 16-Dec-2019 06:35:10

163 Views

To get synchronize access to an array, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       Array intArr = new int[] {5, 10, 15, 20, 25, 30, 35, 40 };       Console.WriteLine("Integer array...");       foreach (int i in intArr)       Console.WriteLine(i);       Console.WriteLine("After applying lock on array...");       lock(intArr.SyncRoot) {          foreach (Object ob in intArr)          Console.WriteLine(ob);       }    } }OutputThis will produce the following output −Integer array... 5 ... Read More

Add Object to the End of Collection in C#

AmitDiwan
Updated on 16-Dec-2019 06:29:59

250 Views

To add an object to the end of Collection, the code is as follows −Exampleusing System; using System.Collections.ObjectModel; public class Demo {    public static void Main() {       Collection col = new Collection();       col.Add(10);       col.Add(20);       col.Add(30);       col.Add(40);       col.Add(50);       col.Add(60);       col.Add(70);       col.Add(80);       Console.WriteLine("Elements in the Collection...");       foreach(int val in col) {          Console.WriteLine(val);       }       Console.WriteLine("Does the collection has the ... Read More

Deleting Partial Data from a Field in MySQL

AmitDiwan
Updated on 16-Dec-2019 06:26:55

283 Views

To delete partial data, use UPDATE command along with REPLACE(). Let us first create a table −mysql> create table DemoTable1583    -> (    -> GameDetails text    -> ); Query OK, 0 rows affected (1.38 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1583 values('=Candy, 2000'); Query OK, 1 row affected (0.53 sec) mysql> insert into DemoTable1583 values('=Lucky29, 10000'); Query OK, 1 row affected (0.25 sec)Display all records from the table using select statement −mysql> select * from DemoTable1583;This will produce the following output −+------------------------------------------------------------+ | GameDetails                 ... Read More

Add a String to the End of the StringCollection in C#

AmitDiwan
Updated on 16-Dec-2019 06:26:11

120 Views

To add a string to the end of the StringCollection, the code is as follows −Exampleusing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection strCol = new StringCollection();       strCol.Add("John");       strCol.Add("Tim");       strCol.Add("Gary");       strCol.Add("Katie");       strCol.Add("Andy");       strCol.Add("Amy");       strCol.Add("Scarlett");       strCol.Add("Jacob");       Console.WriteLine("Elements in StringCollection...");       foreach(Object ob in strCol) {          Console.WriteLine(ob);       }       Console.WriteLine("Count of elements = "+strCol.Count); ... Read More

Advertisements