Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 66 of 81

How do I remove ON UPDATE CURRENT_TIMESTAMP from an existing column in MySQL?

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

The ON UPDATE CURRENT_TIMESTAMP defines that an update without an explicit timestamp would result in an update to the current timestamp value.You can remove ON UPDATE CURRENT_TIMESTAMP from a column using ALTER command.The syntax is as followsALTER TABLE yourTableName CHANGE yourTimeStampColumnName yourTimeStampColumnName timestamp NOT NULL default CURRENT_TIMESTAMP;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table removeOnUpdateCurrentTimeStampDemo    - > (    - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    - > Name varchar(20),    - > UserUpdateTimestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP   ...

Read More

How to make custom dialog with rounded corners in android?

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

This example demonstrate about How to make custom dialog with rounded corners 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 button. When user click on button, it will show custom dialog.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; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; public class MainActivity extends ...

Read More

How do I update the decimal column to allow more digits in MySQL?

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

To update the decimal column to allow more digit, use the MODIFY COLUMN. The syntax is as follows:ALTER TABLE MODIFY COLUMN yourColumnName DECIMAL(yourIntValue, yourIntValue);To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table allowDecimalWithMoreDigit    -> (      -> Id int NOT NULL AUTO_INCREMENT,    -> Salary DECIMAL(3, 2),    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.64 sec)Now you can check the description of table using DESC command. The syntax is as follows:DESC yourTableName;Now you can check the description of table using above ...

Read More

How to get first N characters from a MySQL column?

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

Use SUBSTRING() to get first N characters from a MySQL column. Let us first create a table −mysql>create table DemoTable (    Information text ); Query OK, 0 rows affected (2.63 sec)Insert records in the table using insert command −mysql>insert into DemoTable values('MySQL is a structured query language'); Query OK, 1 row affected (0.13 sec)Following is the query to display all records from the table using select statement −mysql>select *from DemoTable;This will produce the following output −+--------------------------------------+ | Information                         | +--------------------------------------+ | MySQL is a structured query ...

Read More

Description of logic controller interface

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

We use a logic controller and it is used in industry for the process of control done by the software. Multiple inputs are typically accepted which performs a total complete sequence of operations carried out both arithmetic and logically. The outputs generated are used for the maintenance of the process within the specified desired limits. Visual display is provided by the state of process at any instant of time. The logic controller which interfaces and thus provides a buffered output of 12 lines and which is fed to the buffer inputs of 12 lines only specified for the user. The ...

Read More

How to get server_id in MySQL?

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

To get the server_id, use the system defined variable @@server_id. You cannot use only a single @ as user defined variable for server_id.The syntax is as followsSELECT@@ server_idAs an alternate, you can use SHOW VARIABLES command.The syntax is as followsSHOW VARIABLES LIKE ‘server_id’;Case 1The query is as followsmysql> SELECT @@server_id as SERVER_ID;The following is the output+-----------+ | SERVER_ID | +-----------+ |         1 | +-----------+ 1 row in set (0.00 sec)Case 2The query is as followsmysql> show variables like 'server_id';The following is the output+---------------+-------+ | Variable_name | Value | +---------------+-------+ | server_id | ...

Read More

Simulation of 8 to 1 multiplexer

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

We shall write a program in assembly language just for the simulation of a multiplexer 8 to 1 which is used by the logic controller interface.The pins of the 8 to 1 multiplexer to be simulated are assumed to be as shown in the fig.For this multiplexer simulation, 8255 ports as indicated in the following provide the inputs and outputs.Port B used as I7-0 inputs;Pin 7 of Port C used as chip select;Pins 6-4 of Port C used as select inputs;Pin 0 of Port A used as output of multiplexer.Sample CodeFILE NAME Prog_MUX.ASM ORG C100H TABLE DB 01H, 02H, 04H, 08H, ...

Read More

Generation of triangular wave using DAC interface

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

We write an 8085 assembly language program for the generation of triangular waveform using the Digital to Analog Converter (DAC) interface. The display of the waveform is seen on the CRO.Let us consider a problem solution in this domain. The problem states that: To get unipolar output, J1 is shorted to J2 on the interface. To display the waveform on a CRO, connect pin 1 of connector P1 to CRO signal pin, and pin 2 of connector P1 to CRO ground pin.Program; FILE NAME DAC_TO_TRIANG.ASM ORG C100H X DW 00FFH ; the fall of rise and time I proportional directly to ...

Read More

Check how many rows are in a MySQL database table?

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

To know how many rows are in a ySQL database table, you need to use aggregate function COUNT(*).The syntax is as followsSELECT COUNT(*) FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table CountRowsDemo    - > (    - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    - > Name varchar(20)    - > ); Query OK, 0 rows affected (0.78 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into CountRowsDemo(Name) values(NULL); Query OK, 1 row affected (0.15 sec) mysql> ...

Read More

How to add a "created at" column in a table to set the timestamp in MySQL?

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

You need to use ALTER command to add a created at column to an already created table in MySQL.Let us first create a table. The query to create a table is as follows. Here is your table without the “created at” columnmysql> create table formDemo - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > Email varchar(128), - > PhoneNumber varchar(15), - > Country varchar(30), - > Platform varchar(40) - > ); Query OK, 0 ...

Read More
Showing 651–660 of 810 articles
« Prev 1 64 65 66 67 68 81 Next »
Advertisements