Arjun Thakur

Arjun Thakur

749 Articles Published

Articles by Arjun Thakur

Page 64 of 75

PHP and MYSQL database connection and table creation only once if it does not already exist?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

To create database only once, use the below syntax.CREATE DATABASE IF NOT EXISTS yourDatabaseName;To create table only once, use the below syntax −CREATE TABLE IF NOT EXISTS yourTableName (    yourColumnName yourDatatype,    .    .    .    N );Let us implement both the above syntaxes to create database and table only once if does not already exist −mysql> CREATE DATABASE IF NOT EXISTS login; Query OK, 1 row affected (0.23 sec)Above query creates a database successfully.Following is the query to create a table −mysql> CREATE TABLE IF NOT EXISTS DemoTable (    Id int ); Query OK, 0 rows affected (0.56 sec)Above query creates a table successfully.

Read More

Decimal counter using logic controller

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 389 Views

We write a program in the 8085 which is written in assembly language just for the implementation of a decimal counter which is used by the logic controller interface. The input of the starting count must be the input through the complete interface and moreover we display the count on the interface.Let us consider a sample program on this –The program which follows it should always contain an infinite loop until the inputs of the user contains a valid value of two-digit Binary Coded Decimal value just only to the Port B. After that the initial count gets displayed by ...

Read More

Check if value exists in a comma separated list in MySQL?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 12K+ Views

To check if value exists in a comma separated list, you can use FIND_IN_SET() function.The syntax is as followsSELECT *FROM yourTablename WHERE FIND_IN_SET(‘yourValue’, yourColumnName) > 0;Let us first create a table. The query to create a table is as followsmysql> create table existInCommaSeparatedList - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > Name varchar(200) - > ); Query OK, 0 rows affected (0.68 sec)Now you can insert some records in the table using insert command.The query is as followsmysql> insert into existInCommaSeparatedList(Name) values('John, ...

Read More

C++ Program to Print the Kind of Rotation the AVL Tree is Undergoing When you Add an Element or Delete an Element

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 229 Views

AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than one for all nodesTree rotation is an operation that changes the structure without interfering with the order of the elements on an AVL tree. It moves one node up in the tree and one node down. It is used to change the shape of the tree, and to decrease its height by moving smaller subtrees down and larger subtrees up, resulting in improved performance of many tree operations. The direction of a rotation depends on the side which ...

Read More

Successive approximation ADC interface

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 723 Views

The Model ALS-NIFC-07 which on approximating successfully ADC is clearly described in this topic. It consists of a programmable timer interface which connects to the kit of ALS-SDA-85M by using a flat cable of 26 crores. The connector C1 gets connected to the interface by the Input Output connector P3 in the kit for the ALS, which is implemented on a flat cable. The power supply of +12V, -12V, +5V, and GND gets connected to the interface. The circuit description is shown below –C1 is connected to connector P3 (or P4) on ALS kit, for ADC interface purposeC2 is connected ...

Read More

Rotation of stepper motor in forward and reverse directions

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 3K+ Views

Let us consider ALS-NIFC-01, which is a stepper motor interface. Using 26-core flat cable, it is connected to ALS kit. It will be used for interfacing two stepper motors. In our current experiment, we use only one stepper motor. The motor has a step size of 1.8°. The stepper motor works on a power supply of +12V. Power supply of +5V (white wire), GND (black), and +12V (red) is provided to the interface. Note that -12V supply is not used by the interface. We shall have to make sure that the +12V supply has adequate current rating to drive the ...

Read More

Is there an operator in MySQL to implement multiple NOT conditions like WHERE id != 5 AND id != 10 AND id != 15?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 599 Views

Yes, for this MySQL comes with a NOT IN.The syntax is as followsSELECT *FROM yourTableName WHERE yourColumnName NOT IN(1, 2, 7);To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table User_informations    - > (    - > UserId int,    - > UserName varchar(20)    - > ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into User_informations values(12, 'Maxwell'); Query OK, 1 row affected (0.17 sec) mysql> insert into User_informations values(7, 'David'); Query OK, 1 ...

Read More

Where is the MySQL database gets saved when it is created?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 574 Views

If you want the database location i.e. where it is created in MySQL, you can use system variable @@datadir.The syntax is as followsSELECT @@datadir;The following is the querymysql> select @@datadir;Here is the output. The above query returns the location+---------------------------------------------+ | @@datadir | +---------------------------------------------+ | C:\ProgramData\MySQL\MySQL Server 8.0\Data\ | +---------------------------------------------+ 1 row in set (0.00 sec)Now reach the above directory in your system. The screenshot of the ...

Read More

How to implement GROUP by range in MySQL?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 1K+ Views

To group by range in MySQL, let us first create a table. The query to create a table is as followsmysql> create table GroupByRangeDemo    - > (    - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    - > YourRangeValue int    - > ); Query OK, 0 rows affected (0.78 sec)Now you can insert some records in the table using insert command.The query is as followsmysql> insert into GroupByRangeDemo(YourRangeValue) values(1); Query OK, 1 row affected (0.14 sec) mysql> insert into GroupByRangeDemo(YourRangeValue) values(7); Query OK, 1 row affected (0.15 sec) mysql> insert into GroupByRangeDemo(YourRangeValue) values(9); Query OK, 1 ...

Read More

C++ Program to Check whether Graph is a Bipartite using 2 Color Algorithm

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 351 Views

A bipartite graph is a graph in which if the graph coloring is possible using two colors i.e.; vertices in a set are colored with the same color. This is a C++ program to Check whether a graph bipartite or not using 2 color algorithm.Functions and pseudocodesBegin    1. Develop function isSafe() to check if the current color assignment       is safe for vertex v, i.e. checks whether the edge exists or not.       If it exists, then next check whether the color to be filled in       the new vertex is already used ...

Read More
Showing 631–640 of 749 articles
« Prev 1 62 63 64 65 66 75 Next »
Advertisements