- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Updated on 30-Jul-2019 22:30:25
If you try to create a table and the table name already exist then MySQL will give a warning message. Let us verify the concept.Here, we are creating a table that already exist −mysql> CREATE TABLE IF NOT EXISTS DemoTable ( CustomerId int, CustomerName varchar(30), CustomerAge int ); Query OK, 0 rows affected, 1 warning (0.05 sec)The table name DemoTable is already present. Let us check the warning message.Following is the query −mysql> show warnings;This will produce the following output i.e. the warning message −+-------+------+------------------------------------+ | Level | Code | Message ... Read More 
Updated on 30-Jul-2019 22:30:25
We shall discuss about a C++ program which can generate random Hexadecimal numbers. Here we shall use rand() and itoa() functions to implement the same. Let us discuss on these functions separately and categorically.rand(): rand() function is a predefined method of C++. It is declared in header file. rand() is used to generate random number within a range. Here min_n is the minimum range of the random numbers and max_n is the maximum range of the numbers. So rand() will return the random numbers between min_n to (max_n – 1) inclusive of the limit values. Here if we mention ... Read More 
Updated on 30-Jul-2019 22:30:25
To check the read/write ratio, you need to use SHOW STATUS command. This will give all the ratios.Case 1 − The syntax is as follows to get the read/write ratio −SHOW STATUS LIKE ‘Com_%’;Case 2 − If you want the insert, update, select and delete ratio, use the below syntax −SHOW GLOBAL STATUS WHERE Variable_name = 'Com_insert' OR Variable_name = 'Com_select' OR Variable_name = 'Com_Update' OR Variable_name = 'Com_delete';Here is no need to do any changes in the above syntax. The query is as follows −mysql> SHOW GLOBAL STATUS WHERE Variable_name = 'Com_insert' OR Variable_name = 'Com_select' OR -> ... Read More 
Updated on 30-Jul-2019 22:30:25
The addAtX() method is used to add a value to the Triplet Tuple. The index can be set here with the X i.e. the place where the value gets added.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Here, we have used Quartet class also, therefore import the following −import org.javatuples.Quartet;Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Triplet Class in JavaTuples, then Right Click Project ->Properties ->Java Build Path ->Add External Jars and ... Read More 
Updated on 30-Jul-2019 22:30:25
Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrate about How to use upper () in Android sqliteStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ... Read More 
Updated on 30-Jul-2019 22:30:25
You need to use substring_index() function from MySQL to select text.The syntax is as followsSELECT substring_index(yourColumnName, '/', -1) AS anyAliasName FROM yourTableName;To understand the above concept, let us create a table. The query to create a table is as followsmysql> create table selectTextAfterLastSlashDemo - > ( - > UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > UserPathDirectory varchar(200) - > ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into selectTextAfterLastSlashDemo(UserPathDirectory) values('C:/MyFolder1/MyEntityFramework'); Query OK, 1 ... Read More 
Updated on 30-Jul-2019 22:30:25
An immutable copy of the LocalDate where the weeks are subtracted from it can be obtained using the minusWeeks() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of weeks to be subtracted and it returns the instant with the subtracted weeks.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Demo { public static void main(String[] args) { LocalDate ld1 = LocalDate.parse("2019-02-14"); System.out.println("The LocalDate is: " + ld1); ... Read More 
Updated on 30-Jul-2019 22:30:25
The allMatch() method in the LongStream class returns whether all elements of this stream match the provided predicate.The syntax is as follows.boolean allMatch(LongPredicate predicate)The parameter predicate is a stateless predicate to apply to elements of this stream. The LongPredicate represents a predicate of one long-valued argument.To use the LongStream class in Java, import the following package.import java.util.stream.LongStream;The following is an example to implement LongStream allMatch() method in Java.Example Live Demoimport java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(100L, 150L, 200L, 300L, 400L, 500L); boolean res = longStream.allMatch(a ... Read More 
Updated on 30-Jul-2019 22:30:25
The mapToInt() method returns an IntStream consisting of the results of applying the given function to the elements of this stream.The syntax is as followsmapToInt(LongToIntFunction mapper)Here, the parameter mapper is the stateless function applied to each element.Declare LongStream and add some elementsLongStream longStream = LongStream.of(1000L, 13000L, 18000L);Now, use the IntStream and mapToInt()IntStream intStream = longStream.mapToInt(val -> (int) val);The following is an example to implement LongStream mapToInt() in JavaExample Live Demoimport java.util.*; import java.util.stream.IntStream; import java.util.stream.LongStream; public class Demo { public static void main(String[] args) { LongStream longStream = LongStream.of(1000L, 13000L, 18000L); IntStream intStream = ... Read More 
Updated on 30-Jul-2019 22:30:25
The desc is a MySQL reserved word, therefore you cannot use it. But, if you still want to set the column name as ‘desc’, you need to use backticks. The backtick notation is (` `).To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table useOfDescColumnNameDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20), -> `desc` varchar(200) default 'GOOD' -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command. The query is as follows ... Read More Advertisements