Karthikeya Boyini has Published 2545 Articles

Change the column name from StudentName to FirstName in MySQL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:27:02

101 Views

Use CHANGE with ALTER statement. Let us first create a table −mysql> create table DemoTable -> ( -> StudentName varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.84 sec)Now check the description of table −mysql> desc DemoTable;OutputThis will produce the following output −+----------------+--------------+------+-----+---------+-------+ | Field     ... Read More

Fix Drop table view #1051 unknown table error in MySQL

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:23:40

1K+ Views

To correctly drop a view, use the below syntax −drop view yourViewName;Let us first create a table −mysql> create table DemoTable -> ( -> Id int -> ); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1001); Query OK, ... Read More

What is the usage of zerofill in a MySQL field?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:17:39

602 Views

Zerofill pads the displayed value of the field with zeros up to the display width specified in the column definition. For example, if column is set int(8), therefore the width is 8. If the number is let’s say 4376, then zero will be padded on the left for total width ... Read More

MySQL query to conduct a basic search for a specific last name in a column

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:17:00

74 Views

You can use LIKE operator to conduct a basic search for last name. Let us first create a table: −mysql> create table DemoTable    -> (    -> CustomerName varchar(100),    -> CustomerAge int    -> ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using ... Read More

Calling NOW() function to fetch current date records in MySQL?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:15:35

304 Views

Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> ShippingDate datetime -> ); Query OK, 0 rows affected (1.16 sec)Insert some records in the table using insert command. Consider current date “2019-06-28” −mysql> insert into DemoTable(ShippingDate) values('2019-01-31'); Query ... Read More

How to use contains() in android CopyOnWriteArraySet?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:11:52

63 Views

Before getting into example, we should know what CopyOnWriteArraySet is. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrates about How to use contains () in android CopyOnWriteArraySetStep 1 − Create a new project ... Read More

How to use ConcurrentLinkedDeque in android?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:10:10

89 Views

Before getting into example, we should know what ConcurrentLinkedDeque is, it is unbounded deque based on linked nodes. Multiple threads can access deque elements with safety.This example demonstrate about How to clear ConcurrentLinkedDeque in androidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project ... Read More

How to use clear() in android ConcurrentLinkedQueue?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:09:09

86 Views

Before getting into example, we should know what ConcurrentLinkedQueue is, it is unbounded queue based on linked nodes. Multiple threads can access queue elements with safety. Elements travel based on queue strategy as FIFO and elements going to insert from tail. It does not allow null values.This example demonstrate about ... Read More

How to use ArrayBlockingQueue in android?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:06:29

144 Views

Before getting into example, we should know what arrayblockingqueue is, it travels FIFO manner and first element going to live longest period of time and last element of the queue going to live short period of the time.This example demonstrate about How to use ArrayBlockingQueue in androidStep 1 − Create ... Read More

How to use addIfAbsent() in android CopyOnWriteArrayList?

karthikeya Boyini

karthikeya Boyini

Updated on 30-Jun-2020 14:04:14

69 Views

Before getting into example, we should know what CopyOnWriteArrayListis. It is a thread-safe variant of ArrayList and operations add, set, and so on by making a fresh copy of the underlying array.This example demonstrate about How to use addIfAbsent () in android CopyOnWriteArrayListStep 1 − Create a new project in ... Read More

Advertisements