Ramu Prasad has Published 69 Articles

Simple Arithmetic Operators Example Program In C++

Ramu Prasad

Ramu Prasad

Updated on 11-Feb-2020 05:07:26

18K+ Views

C++ has 5 basic arithmetic operators. They are −Addition(+)Subtraction(-)Division(/)Multiplication(*)Modulo(%)These operators can operate on any arithmetic operations in C++. Let's have a look at an example −Example#include using namespace std; main() {    int a = 21;    int b = 10;    int c ;    c = a + b;    cout

How can we analyze the tables of a particular database from MySQL Server command line?

Ramu Prasad

Ramu Prasad

Updated on 10-Feb-2020 06:48:01

254 Views

We need to use ‘mysqlcheck’ client program along with –analyze option to analyze the tables of a particular database. Its syntax would be as follows −Mysqlcheck – u root –analyze db_nameExampleThe following command will analyze the tables of database ‘query’ −C:\mysql\bin>mysqlcheck -u root --analyze query query.cars           ... Read More

How MySQL evaluates the blank line between two lines written in the text file while importing that text file into MySQL table?

Ramu Prasad

Ramu Prasad

Updated on 06-Feb-2020 06:07:46

263 Views

Suppose if there is a blank line between two line written in the text file then MySQL evaluates it as the data line while importing that text file into MySQL table. It can be understood with the help of the following example −ExampleSuppose we are having a blank line between ... Read More

How to use classes in other package in Java

Ramu Prasad

Ramu Prasad

Updated on 04-Feb-2020 11:21:21

881 Views

You can understand it using an example where a Boss class is defined in payroll package.package payroll; public class Boss {    public void payEmployee(Employee e) {       e.mailCheck();    } }if the Employee class is not in the payroll package? The Boss class must then use one ... Read More

Usage of color property in CSS

Ramu Prasad

Ramu Prasad

Updated on 31-Jan-2020 06:25:32

158 Views

The color property is used to set the color of text. You can try to run the following code to learn how to work with the color property in CSS:Example                            This text will be written in blue.          

Set the Background Attachment with CSS

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 09:21:35

104 Views

To set the background-attachment, use the background-attachment property. Background attachment determines whether a background image is fixed or scrolls with the rest of the page.ExampleYou can try to run the following code to learn how to work with the background-attachment property to set fixed background image:       ... Read More

How can we use MySQL function STR_TO_DATE(Column, ‘%input_format’)?

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 05:59:04

384 Views

STR_TO_DATE() function will convert a string value into datetime value and it would be according to a specific format string. Both string value and format string must be passed as arguments to the function. Following is the syntax of STR_TO_DATE() function.STR_TO_DATE(string, format)Here string is the value of string which needs ... Read More

What MySQL returns if we include time components along with date component as an argument to DATEDIFF() function?

Ramu Prasad

Ramu Prasad

Updated on 30-Jan-2020 05:17:21

112 Views

MySQL DATEDIFF() function also works with date and time values but it ignores the time value. Hence even if we include the time value in DATEDIFF() function MySQL will return the difference, in days, between dates by ignoring the time values.mysql> Select DATEDIFF('2018-10-22 04:05:36', '2017-10-22 03:05:45'); +-------------------------------------------------------+ | DATEDIFF('2018-10-22 04:05:36', ... Read More

How to get last day of the next month in MySQL?

Ramu Prasad

Ramu Prasad

Updated on 29-Jan-2020 05:11:19

377 Views

With the help of following MySQL query, we can get the last day of next month −mysql> SELECT LAST_DAY(now() + INTERVAL 1 MONTH) AS 'LAST DAY OF NEXT MONTH'; +------------------------+ | LAST DAY OF NEXT MONTH | +------------------------+ | 2017-11-30             | +------------------------+ 1 row in set (0.00 sec)

What is the usage of ZEROFILL for INT datatype?

Ramu Prasad

Ramu Prasad

Updated on 28-Jan-2020 07:18:28

215 Views

On specifying ZEROFILL for a numeric column, MYSQL automatically pads the displayed value of the field with zeros up to the display width specified in the column definition.For example, we create a table showzerofill and insert the values as follows −mysql> Create Table showzerofill(Val1 INT(5) ZEROFILL, Val2 INT(5)); Query OK, ... Read More

Advertisements