Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles on Trending Technologies
Technical articles with clear explanations and examples
How can we remove multicolumn UNIQUE indexes?
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 MoreC# program to Illustrate Upper Triangular Matrix
For the upper triangular matrix, set all the elements below the main diagonal to zero. Set the following condition − if (i
Read MoreHow can we check the indexes created by a UNIQUE constraint on a MySQL table?
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 MoreHow can we apply UNIQUE constraint to the field of an existing MySQL table?
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 MoreC# Program to perform all Basic Arithmetic Operations
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 MoreC# Program to create a Simple Thread
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 < 3; i++) { Console.WriteLine("My Thread"); } } } class NewThread { ...
Read MoreC# program to Display Hostname and IP address
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 MoreSpatial Databases
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 MoreHow to return a value from a JavaScript function?
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 MoreHow to insert NULL keyword as a value in a character type column of MySQL table having NOT NULL constraint?
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