You can sort the table_name property from INFORMATION_SCHEMA.TABLES with ORDER BY clause. Sort in ascending order or descending order with the help of ASC or DESC respectively. The syntax is as follows −SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND table_schema='yourDatabaseName' ORDER BY table_name DESC;Use the database with the name sample and have some tables. First, we will show all tables after that we will apply to sort on the table name. The query to display all tables is as follows −mysql> show tables;The following is the output −+--------------------------+ | Tables_in_sample | +--------------------------+ | ... Read More
To update data into a MySQL database table, use UPDATE command. The syntax is as follows −update yourTableName set yourColumnName1 = value1, ....N where condition;First, we need to create a table. The query is as follows −mysql> create table UpdateDemo -> ( -> id int, -> Name varchar(200) -> ); Query OK, 0 rows affected (0.67 sec)Let us insert records into the table. The following is the query −mysql> insert into UpdateDemo values(101, 'John'); Query OK, 1 row affected (0.19 sec) mysql> truncate table UpdateDemo; Query OK, 0 rows affected (0.86 sec) mysql> insert ... Read More
Water is a very important resource not only for us but also for our future generations. We should; therefore, save it in order to provide the maximum benefit to others. Water is necessary for our lives. So, if we save water, we save life.However, one must either not be aware of the ways to conserve it or may be reluctant thinking that such work will require a lot of toil. Let's talk about the ways in which water can be conserved.Turn off the Tap Post Use: While we brush our teeth, water keeps spilling out. It is necessary to close ... Read More
The specified input sequence can be split around a particular match for a pattern using the java.util.regex.Pattern.split() method. This method has a single parameter i.e. the input sequence to split and it returns the string array obtained by splitting the input sequence around a particular match for a pattern.A program that demonstrates the method Pattern.split() in Java regular expressions is given as follows:Example Live Demoimport java.util.regex.Pattern; public class Demo { public static void main(String[] args) { String regex = "_"; String input = "Oranges_are_orange"; System.out.println("Regex: " + regex); ... Read More
To auto generate database diagram in MySQL, use MySQL workbench. For this, select the option from database as shown below −Database->Reverse EngineerHere is the snapshot showing the Database tab −After clicking “Database” above, choose the option “Reverse Engineer”. This state the “Reverse Engineer” mode.Clicking above will display the following table automatically. We had one table in the database “business”. The same table “tblstudent” is visible here −
The h format in Java Date is like 1-12 hour in AM/ PM. Use SimpleDateFormat("h") to get the same format;// displaying hour in h format SimpleDateFormat simpleformat = new SimpleDateFormat("h"); String strHour = simpleformat.format(new Date()); System.out.println("Hour in h format = "+strHour);Above, we have used the SimpleDateFormat class, therefore the following package is imported −import java.text.SimpleDateFormat;The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time ... Read More
To make MySQL’s NOW() and CURDATE() functions use UTC, you need to write my.cnf file. Write the below instruction in my.cnf −[mysqld_safe] timezone = UTCFirstly, reach the directory with the help of the following query −mysql> select @@datadir;The following is the output −+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)Now reach the directory for which the link ... Read More
At the release of iPhone 5, it’s resolution and aspect ratio was different (640 x 1136 pixels), hence it was tough to migrate applications from iPhone 4 sizes to the newer iPhone. But later with the release of iOS 8, size classes and abstract screen sizes were also introduced to make it easier. As of now, applications for almost all sizes can be developed with Xcode storyboard editor.Apart from storyboard editor, you can also change the launch image. Let’s see the first method.Change the launch image to Default-568h@2x.png. Change the size to be 1136x640.Go to info.plist and remove the value ... Read More
There are broadly five categories of forests in India. They are named as Tropical evergreen forests, Tropical deciduous forests, Tropical thorn forests, Montane forests, and Swamp forests. Although different geographers divide the forests into many other categories, these are supposed to remain uniform throughout the country. Let's take one by one in brief.Tropical Deciduous ForestsThese trees have broadleafs. India also has temperate deciduous forests but they are very less in number. These broad leaves are shed in the autumn season but it is in case of temperate deciduous mode. The tropical deciduous forests have the trees that shed their leaves ... Read More
The specified string can be split around a particular match for a regex using the String.split() method. This method has a single parameter i.e. regex and it returns the string array obtained by splitting the input string around a particular match for the regex.A program that demonstrates splitting a string is given as follows:Example Live Demopublic class Demo { public static void main(String args[]) { String regex = "_"; String strInput = "The_sky_is_blue"; System.out.println("Regex: " + regex); System.out.println("Input string: " + strInput); String[] strArr = ... Read More