Kumar Varma has Published 107 Articles

How to add a column using MySQL SELECT in an already created table?

Kumar Varma

Kumar Varma

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

292 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> Name varchar(100),    -> Age int    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert ... Read More

How to add some days to str_to_date() MySQL function?

Kumar Varma

Kumar Varma

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

154 Views

You can use DATE_ADD() function from MySQL. Let us first create a table −mysql> create table DemoTable    -> (    -> ShippingDate varchar(100)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('06-01-2019'); Query OK, 1 ... Read More

How to calculate the difference between time in different MySQL columns?

Kumar Varma

Kumar Varma

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

238 Views

You can use TIME_FORMAT(). Let us first create a table −mysql> create table DemoTable    -> (    -> PunchIn time,    -> PunchOut time,    -> Launch time    -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

How to show GRANTS for root in MySQL?

Kumar Varma

Kumar Varma

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

130 Views

For this, use the following syntax, wherein we have used SHOW GRANTS −SHOW GRANTS FOR 'yourUserName'@'yourHostName';HostName may be ‘%’ or localhost.Let us implement the above syntax in order to show grants from ROOT −mysql> SHOW GRANTS FOR 'root'@'%' ;Output+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@%               ... Read More

Update multiple columns of a single row MySQL?

Kumar Varma

Kumar Varma

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

550 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> FirstName varchar(100),    -> Age int,    -> Score int    -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Robert', 21, 78); ... Read More

Getting the maximum value from a varchar field in MySQL

Kumar Varma

Kumar Varma

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

202 Views

Use MAX() function along with SUBSTRING() for this. Let us first create a table −mysql> create table DemoTable    -> (    -> Id varchar(200)    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-0515-1980'); Query OK, ... Read More

How to detect a long press in iOS?

Kumar Varma

Kumar Varma

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

922 Views

Long-press (also known as press-and-hold) gestures detect one or more fingers touching the screen for an extended period of time. You configure the minimum duration required to recognize the press and the number of times the fingers must be touching the screen. (The gesture recognizer is triggered only by the ... Read More

How to set background color of a View in iOS App?

Kumar Varma

Kumar Varma

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

2K+ Views

Views are the fundamental building blocks of your app's user interface, and the  UIView class defines the behaviors that are common to all views. A view object renders content within its bounds rectangle and handles any interactions with that content. The  UIView class is a concrete class that you can ... Read More

How can I find the percentage of my users whose birth date is between 1980 and 1996 in MySQL?

Kumar Varma

Kumar Varma

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

121 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> DateOfBirth varchar(100)    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019/01/31'); Query OK, 1 row affected (0.19 sec) mysql> insert ... Read More

How can I set an icon for my iOS application?

Kumar Varma

Kumar Varma

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

191 Views

Every app needs a beautiful and memorable icon that attracts attention in the App Store and stands out on the Home screen. Your icon is the first opportunity to communicate, at a glance, your app’s purpose. It also appears throughout the system, such as in Settings and search results.Here we ... Read More

Advertisements