Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 75 of 81

Add 30 days to a value in a MySQL table?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 700 Views

To add 30 days to a value in the table, you can use ADDDATE() function with UPDATE command. The syntax is as follows:UPDATE yourTableName SET yourDateColumnName=ADDDATE(yourDateColumnName, INTERVAL 30 DAY);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table Add30DayDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> ShippingDate date,    -> PRIMARY KEY(ID)    -> ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into Add30DayDemo(ShippingDate) values('2019-02-04'); Query OK, 1 row affected ...

Read More

Can MySQL INT type be non-zero NULL?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 341 Views

You can set the INT column to value NULL.The column INT type a nullable column. The syntax is as follows:INSERT INTO yourTableName(yourIntColumnName) values(NULL);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table nullableIntDemo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Price int,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.80 sec)Insert the record as NULL for a int column ‘Price’. The query is as follows:mysql> insert into nullableIntDemo(Price) values(NULL); Query OK, 1 row affected (0.11 sec) mysql> insert into ...

Read More

What are the headers used in a Data Link Layer?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

Data Link Layer FrameA frame is a unit of communication in the data link layer. Data link layer takes the packets from the Network Layer and encapsulates them into frames. If the frame size becomes too large, then the packet may be divided into small sized frames. At receiver’ end, data link layer picks up signals from hardware and reassembles them into frames.Frame Structure and Frame HeaderA frame is composed of four types of fields, namely kind, seq, 𝑎𝑐𝑘 and info. The first three fields contain control information about the frame and collectively form the frame header. Besides, the frame ...

Read More

A Simplex Stop-and-Wait Protocol for an Error-Free Channel

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 15K+ Views

Stop – and – Wait protocol is data link layer protocol for transmission of frames over noiseless channels. It provides unidirectional data transmission with flow control facilities but without error control facilities.This protocol takes into account the fact that the receiver has a finite processing speed. If data frames arrive at the receiver’s end at a rate which is greater than its rate of processing, frames be dropped out. In order to avoid this, the receiver sends an acknowledgement for each frame upon its arrival. The sender sends the next frame only when it has received a positive acknowledgement from ...

Read More

Are quotes around tables and columns in a MySQL query really necessary?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 490 Views

If your table name or column name are any reserved words then you need to use quotes around table name and column name in a MySQL query. You need to use backticks around table name and column name. The syntax is as follows:SELECT *FROM `table` where `where`=condition;Here is the query to create a table without quotes with reserved words. You will get an error since they are predefined reserved words. The error is as follows:mysql> create table table    -> (    -> where int    -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check ...

Read More

How to verify enter number is phone number or not using regex in android?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

This example demonstrates how to verify enter number is phone number or not, using regex in android.Step 1 - Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 - Add the following code to res/layout/activity_main.xml.         In the above code, we have taken Edit text and text view. when the user clicks on text view, it will take data from edit text and valid the data.Step 3 - Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; ...

Read More

Arithmetic of Number Systems\\n

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 9K+ Views

A number system is a set of symbols used to represent values derived from a common base or radix. In a number, the value of each digit can be determined using digit, position of the digit in the number, and the base of the number system. The base is defined as the total number of digits are available in the number system. This is known as positional number system.Number SystemBaseDigit UsedBinary20, 1Octal80, 1, 2, 3, 4, 5, 6, 7Decimal100, 1, 2, 3, 4, 5, 6, 7, 8, 9Hexadecimal160, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, ...

Read More

How to create NSIndexPath for TableView in iOS?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 959 Views

Index path is generally a set of two values representing row and section of a table view. Index path can be created in objective C as well as Swift as both are native language of iOS Development.IndexPathForRow is a class method in iOS. To create a index path we need to be sure about the section and row we need to create. Below are the methods of creating an Indexpath.To create an IndexPath in objective C we can use.NSIndexPath *myIP = [NSIndexPath indexPathForRow: Int inSection:Int] ;ExampleNSIndexPath *myIP = [NSIndexPath indexPathForRow: 5 inSection: 2] ;To create an IndexPath in Swift we ...

Read More

Why MySQL NOT NULL shouldn’t be added to primary key field?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 915 Views

You do not need to add NOT NULL to primary key field because it gets NOT NULL automatically. Primary key is combination of both NOT NULL and Unique Key.Here is the demo of primary key field. Let us first create a table. The query to create a table is as follows:mysql> create table NotNullAddDemo    -> (    -> Id int AUTO_INCREMENT,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.81 sec)In the above table, you do not need to add NOT NULL to primary key field because MySQL internally converts it into NOT NULL. To ...

Read More

How can I see global locks in MySQL (innodb)?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 668 Views

In order to see the global locks in MySQL (Innodb), use the SHOW command. The below query shows the global locks as well owner of locks and waiters. The following query will also show transaction id and more related to Innodb.The query is as follows:mysql> SHOW ENGINE INNODB STATUS\GThe following is the output:*************************** 1. row *************************** Type: InnoDB Name: Status: ===================================== 2019-01-23 14:46:58 0x2914 INNODB MONITOR OUTPUT ===================================== Per second averages calculated from the last 23 seconds ----------------- BACKGROUND THREAD ----------------- srv_master_thread loops: 87 srv_active, 0 srv_shutdown, 51953 srv_idle srv_master_thread log flush and writes: 0 ---------- SEMAPHORES ---------- OS WAIT ...

Read More
Showing 741–750 of 810 articles
« Prev 1 73 74 75 76 77 81 Next »
Advertisements