Articles on Trending Technologies

Technical articles with clear explanations and examples

How can we remove multicolumn UNIQUE indexes?

Samual Sam
Samual Sam
Updated on 19-Jun-2020 149 Views

Multicolumn UNIQUE indexes can also be removed in the same as we remove UNIQUE constraint from the table.ExampleIn this example, with the following query we have removed the multicolumn UNIQUE indexes on table ‘employee’ −mysql> DROP index id_fname_lname on employee; Query OK, 0 rows affected (0.30 sec) Records: 0 Duplicates: 0 Warnings: 0The removal of UNIQUE indexes can be observed from the result sets of the following query −mysql> show index from employee; Empty set (0.00 sec) mysql> describe employee; +------------+-------------+------+-----+---------+-------+ | Field      | Type        | Null | Key | Default | Extra | ...

Read More

C# program to Illustrate Upper Triangular Matrix

Samual Sam
Samual Sam
Updated on 19-Jun-2020 593 Views

For the upper triangular matrix, set all the elements below the main diagonal to zero. Set the following condition − if (i

Read More

How can we check the indexes created by a UNIQUE constraint on a MySQL table?

karthikeya Boyini
karthikeya Boyini
Updated on 19-Jun-2020 621 Views

SHOW INDEX statement is used to check the indexes created by a UNIQUE constraint on a MySQL table.SyntaxSHOW INDEX from table_name;ExampleSuppose we have the table ‘empl’ which have a UNIQUE constraint on column ‘empno’.mysql> describe empl; +--------+-------------+------+-----+---------+-------+ | Field  | Type        | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | empno  | int(11)     | YES  | UNI | NULL    |       | | F_name | varchar(20) | YES  |     | NULL    |       | +--------+-------------+------+-----+---------+-------+ 2 rows in set (0.23 sec)Now as we know that ...

Read More

How can we apply UNIQUE constraint to the field of an existing MySQL table?

Swarali Sree
Swarali Sree
Updated on 19-Jun-2020 593 Views

We can apply the UNIQUE constraint to a column of an existing MySQL table with the help of ALTER TABLE statement.SyntaxALTER TABLE table_name MODIFY colum_name datatype UNIQUE;                     OR ALTER TABLE table_name ADD UNIQUE (colum_name);ExampleSuppose we have the following table named ‘Test4’ and we want to add UNIQUE constraint to the column ‘Name’ then it can be done with the help of ALTER TABLE command as follows −mysql> DESCRIBE test4; +-------+-------------+------+-----+---------+-------+ | Field | Type        | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | ID   ...

Read More

C# Program to perform all Basic Arithmetic Operations

Samual Sam
Samual Sam
Updated on 19-Jun-2020 10K+ Views

Basic Arithmetic Operators in C#, include the following − Operator Description + Adds two operands - Subtracts the second operand from the first * Multiplies both operands / Divides the numerator by de-numerator % Modulus Operator and remainder of after an integer division ++ Increment operator increases integer value by one -- Decrement operator decreases integer value by one To add, use the Addition Operator − num1 + num2; In the same way, it works for Subtraction, Multiplication, ...

Read More

C# Program to create a Simple Thread

Samual Sam
Samual Sam
Updated on 19-Jun-2020 621 Views

To create a thread, I have created a function − public void myThread() {     for (int i = 0; i < 3; i++) {         Console.WriteLine("My Thread");     } } The above function is called to create a thread and a new ThreadStart delegate is created − Demo d = new Demo(); Thread thread = new Thread(new ThreadStart(d.myThread)); Example Create a simple thread using the following code. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; class Demo {     public void myThread() {         for (int i = 0; i &lt; 3; i++) {             Console.WriteLine(&quot;My Thread&quot;);         }     } } class NewThread { ...

Read More

C# program to Display Hostname and IP address

karthikeya Boyini
karthikeya Boyini
Updated on 19-Jun-2020 1K+ Views

To find the hostname, use the Dns.GetHostName() method in C# −String hostName = string.Empty; hostName = Dns.GetHostName(); Console.WriteLine("Hostname: "+hostName);Now, use the IPHostEntry.AddressList Property to get IP Address −IPHostEntry myIP = Dns.GetHostEntry(hostName); IPAddress[] address = myIP.AddressList;ExampleTry the following code to display hostname and IP address −using System; using System.Net; class Program {    static void Main() {       String hostName = string.Empty;       hostName = Dns.GetHostName();       Console.WriteLine("Hostname: "+hostName);       IPHostEntry myIP = Dns.GetHostEntry(hostName);       IPAddress[] address = myIP.AddressList;       for (int i = 0; i < address.Length; i++) {          Console.WriteLine("IP Address {1} : ",address[i].ToString());       }       Console.ReadLine();    } }

Read More

Spatial Databases

David Meador
David Meador
Updated on 19-Jun-2020 24K+ Views

Spatial data is associated with geographic locations such as cities, towns etc. A spatial database is optimized to store and query data representing objects. These are the objects which are defined in a geometric space.Characteristics of Spatial DatabaseA spatial database system has the following characteristicsIt is a database systemIt offers spatial data types (SDTs) in its data model and query language.It supports spatial data types in its implementation, providing at least spatial indexing and efficient algorithms for spatial join.ExampleA road map is a visualization of geographic information. A road map is a 2-dimensional object which contains points, lines, and polygons ...

Read More

How to return a value from a JavaScript function?

Srinivas Gorla
Srinivas Gorla
Updated on 19-Jun-2020 3K+ Views

To return a value from a JavaScript function, use the return statement in JavaScript. You need to run the following code to learn how to return a value −Example                    function concatenate(name, age) {             var val;             val = name + age;             return val;          }          function DisplayFunction() {             var result;             result = concatenate('John ', 20) ;             document.write (result );          }                     Click the following button to call the function                          

Read More

How to insert NULL keyword as a value in a character type column of MySQL table having NOT NULL constraint?

Kumar Varma
Kumar Varma
Updated on 19-Jun-2020 291 Views

It is quite possible to insert the NULL keyword as a value in a character type column having NOT NULL constraint because NULL is a value in itself. Following example will exhibit it −ExampleSuppose we have a table test2 having character type column ‘Name’ along with NOT NULL constraint on it. It can be checked from the DESCRIBE statement as follows −mysql> Describe test2\G *************************** 1. row ***************************   Field: id    Type: int(11)    Null: NO     Key: Default: NULL   Extra: *************************** 2. row ***************************   Field: NAME    Type: varchar(20)    Null: NO     Key: ...

Read More
Showing 49591–49600 of 61,248 articles
Advertisements