Karthikeya Boyini has Published 2192 Articles

Format hour in HH (00-23) format in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

4K+ Views

The “HH” format in Java Date is like 00, 01, 02, 03, … 23 hour. Use SimpleDateFormat("HH") to get the same format and in that way you can format hour.// displaying hour in HH format SimpleDateFormat simpleformat = new SimpleDateFormat("HH"); String strHour = simpleformat.format(new Date()); System.out.println("Hour in HH format = ... Read More

Should I store a field PRICE as an int or as a float in the database?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

836 Views

You do not need to store a field PRICE as an int or as float in the database. For this, you can set the DECIMAL()..Most of the time integers can be used to represent the float point numbers and these integers are internally cast into DECIMAL() data type. Therefore, if ... Read More

Format hour in kk (01-24) format in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

713 Views

The “kk” format in Java Date is used to format hour in 01-24 format. Use SimpleDateFormat("kk") to get the same format.// displaying hour in kk format SimpleDateFormat simpleformat = new SimpleDateFormat("kk"); String strHour = simpleformat.format(new Date()); System.out.println("Hour in kk format = "+strHour);Above, we have used the SimpleDateFormat class, therefore the ... Read More

Using LIKE for two where clauses in MySQL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

186 Views

You don’t need to use two where clauses. Use two conditions using the LIKE operator and AND operator.To understand how to use LIKE for this, let us create a table. The query to create a table is as follows −mysql> create table WhereDemo    -> (    -> Id int, ... Read More

Format Minutes in mm format in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

259 Views

The “mm” format is to format minutes i.e. 01, 02, 03, 04, etc. Here, we will use the following −SimpleDateFormat("mm");Let us see an example −// displaying minutes in mm format SimpleDateFormat simpleformat = new SimpleDateFormat("mm"); String strMinute = simpleformat.format(new Date()); System.out.println("Minutes in mm format = "+strMinute);Above, we have used the ... Read More

Exploratory Data Analysis in Python

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

3K+ Views

For data analysis, Exploratory Data Analysis (EDA) must be your first step. Exploratory Data Analysis helps us to −To give insight into a data set.Understand the underlying structure.Extract important parameters and relationships that hold between them.Test underlying assumptions.Understanding EDA using sample Data setTo understand EDA using python, we can take ... Read More

Create MySQL column with Key=MUL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

5K+ Views

You need to use ADD KEY to make a column with Key=MUL. The syntax is as follows −ALTER TABLE yourTableName MODIFY COLUMN yourColumnName data type, ADD KEY(yourColumnName);To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table Instructor   ... Read More

DecimalFormat("000E00") in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

102 Views

DecimalFormat is a concrete subclass of NumberFormat that formats decimal numbers.Let us set DecimalFormat("000E00") first −Format f = new DecimalFormat("000E00");Now, we will format a number and display the result in a string using the format() method −String res = f.format(-5977.3427);Since, we have used both Format and DecimalFormat class in Java, ... Read More

Format Month in M format in Java

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

282 Views

The “M” format is to format months i.e. 1, 2, 3, 4, etc. Here, we will use the following.SimpleDateFormat("M");Let us see an example −// displaying month with M format simpleformat = new SimpleDateFormat("M"); String strMonth = simpleformat.format(new Date()); System.out.println("Month in M format = "+strMonth);Above, we have used the SimpleDateFormat class, ... Read More

MySQL command to copy table?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jul-2019 22:30:24

375 Views

You can achieve this with the help of INSERT INTO SELECT statement. The syntax is as follows −INSERT INTO yourDatabaseName.yourTableName(SELECT *FROM yourDatabaseName.yourTableName);To understand the above syntax, let us create a table in a database and second table in another databaseThe database name is “bothinnodbandmyisam”. Let us create a table in ... Read More

Advertisements