You can add a value to each row in MySQL using UPDATE command.Let us see when your column is an integer. The syntax is as follows:UPDATE yourTableName SET yourIntegerColumnName = yourIntegerColumnName+anyValue; UPDATE yourTableName SET yourIntegerColumnName = anyValue WHERE yourIntegerColumnName IS NULL;You can add a value for a date column name. The syntax is as follows:UPDATE yourTableName SET yourDateColumnName = DATEADD(yourDateColumnName, INTERVAL anyIntegerMonth)To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table addEachRowValue -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Amount int, -> ShippingDate ... Read More
To remove all the elements from LinkedHashSet in Java, use the clear() method.The following is an example to declare LinkedHashSet and add elements to it −LinkedHashSet hashSet = new LinkedHashSet(); hashSet.add(10); hashSet.add(20); hashSet.add(30); hashSet.add(40); hashSet.add(50); hashSet.add(60);Use the clear() method to remove all elements −hashSet.clear();The following is an example −Example Live Demoimport java.util.LinkedHashSet; public class Demo { public static void main(String[] args) { LinkedHashSet hashSet = new LinkedHashSet(); hashSet.add(10); hashSet.add(20); hashSet.add(30); ... Read More
The Simplex protocol is data link layer protocol for transmission of frames over computer network. It is hypothetical protocol designed for unidirectional data transmission over an ideal channel, i.e. a channel through which transmission can never go wrong.It is assumed that both the sender and the receiver are always ready for data processing and both of them have infinite buffer. The sender simply sends all its data available onto the channel as soon as they are available its buffer. The receiver is assumed to process all incoming data instantly. It is does not handle flow control or error control. Since ... Read More
Class objects can be created in Java by using the new operator. A class is instantiated by the new operator by allocating memory for the object dynamically and then returning a reference for that memory. A variable is used to store the memory reference.A program that demonstrates this is given as follows:Example Live Democlass Student { int rno; String name; public Student(int r, String n) { rno = r; name = n; } void display() { System.out.println("Roll Number: " + rno); System.out.println("Name: " + ... Read More
You can execute insert if table is empty with the help of subquery. For that, work on not exists condition with subquery.The below syntax will work only when your table is empty. If your table is not empty then it will not insert the record. The syntax is as follows:INSERT INTO yourTableName(yourColumnName) SELECT ‘anyValue’ WHERE NOT EXISTS (SELECT *FROM yourTableName);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table ExecuteInsertDemo -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.67 sec)Let us insert ... Read More
Kubla Khan is one of the most famous poems written by Samuel Taylor Coleridge. Coleridge who was a Romantic poet and became immortal after writing this unique poem.Summary of 'Kubla Khan'The speaker starts by describing the setting of Emperor Kubla Khan's palace as a "pleasure dome." He tells us about a river that runs across the land and then flows through caves into the sea. He also describes the fertile land surrounding the palace. There is a vivid description of a nearby area all covered in streams, trees, and beautiful forests. He also describes how a river leaps and smashes ... Read More
This is not true that everyone leaves a job in frenzy. Sometimes things in personal and professional life go asymmetrical and one has to leave a job. However, champions know how and when to leave a job. Let’s know about it:The Gallop Poll happened in 2014 reveals that 68% of employees are not actively attached to their workplace. You will be surprised to know that many companies including MNCs have dissatisfied employees. Is being unhappy at work a reason to quit a job? Or Don't you consider leaving a job a personal failure?Seth Godin in his book ‘The Dip’ mentions, ... Read More
Stop – and – Wait protocol is data link layer protocol for transmission of frames over noiseless channels. It provides unidirectional data transmission with flow control facilities but without error control facilities.This protocol takes into account the fact that the receiver has a finite processing speed. If data frames arrive at the receiver’s end at a rate which is greater than its rate of processing, frames be dropped out. In order to avoid this, the receiver sends an acknowledgement for each frame upon its arrival. The sender sends the next frame only when it has received a positive acknowledgement from ... Read More
A class can be derived from the base class in Java by using the extends keyword. This keyword is basically used to indicate that a new class is derived from the base class using inheritance. It can also be said that it is used to extend the functionality of the class.A program that demonstrates this is given as follows:Example Live Democlass A { void funcA() { System.out.println("This is class A"); } } class B extends A { void funcB() { System.out.println("This is class B"); } } public class Demo { ... Read More
If your table name or column name are any reserved words then you need to use quotes around table name and column name in a MySQL query. You need to use backticks around table name and column name. The syntax is as follows:SELECT *FROM `table` where `where`=condition;Here is the query to create a table without quotes with reserved words. You will get an error since they are predefined reserved words. The error is as follows:mysql> create table table -> ( -> where int -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check ... Read More