Sharon Christine has Published 433 Articles

In MySQL, without having BOOLEAN data type how can we show TRUE and FALSE values?

Sharon Christine

Sharon Christine

Updated on 20-Jun-2020 13:23:30

146 Views

As we know that there is no BOOLEAN data type in MySQL hence by using TRUE or true, FALSE or false we can enter Boolean values in MySQL statement.Examplemysql> Select TRUE, FALSE; +------+-------+ | TRUE | FALSE | +------+-------+ |    1 |     0 | +------+-------+ 1 row ... Read More

How can we split the name string into three parts by using MySQL SUBSTRING_INDEX() function?

Sharon Christine

Sharon Christine

Updated on 20-Jun-2020 11:49:23

196 Views

To make it understand, we are using the following data from a table named ‘customerdetail’.mysql> Select * from Customerdetail; +----------------------+----------------------+----------+---------------------+ | Name                 | FName                | Address  | Emailid             | ... Read More

How can I eradicate some specific suffix or prefix or both from a MySQL string?

Sharon Christine

Sharon Christine

Updated on 20-Jun-2020 10:32:21

192 Views

MySQL TRIM() function is used to eradicate a specific suffix or prefix or both from the string. The working of TRIM() function can be understood with the help of its syntaxSyntaxTRIM([{BOTH | LEADING | TRAILING} [str_to_remove] FROM] string)Here,  The argument BOTH means the prefixes from both left and right to ... Read More

How can I clone/duplicate the table along with its data, trigger and indexes?

Sharon Christine

Sharon Christine

Updated on 20-Jun-2020 06:06:40

209 Views

For creating a new table just like old one along with its data, trigger, and indexes, we need to run following two queriesCREATE TABLE new_table LIKE old_table; INSERT new_table SELECT * from old_table;Examplemysql> Create table employee(ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(20)); Query OK, 0 rows affected (0.21 ... Read More

What is MySQL DROP command used for?

Sharon Christine

Sharon Christine

Updated on 20-Jun-2020 06:00:45

95 Views

As the name explains, it is used to completely remove the table from the database.SyntaxDrop table table_name;Examplemysql> Drop table Student; Query OK, 0 rows affected (0.09 sec)The query above completely removes the ‘Student’ table from the database. We can observe as MySQL returns an error message after running the following ... Read More

What are unchecked exceptions in Java?

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 12:45:47

2K+ Views

An unchecked exception is the one which occurs at the time of execution. These are also called as Runtime Exceptions. These include programming bugs, such as logic errors or improper use of an API. Runtime exceptions are ignored at the time of compilation. If you have declared an array of size ... Read More

How to process Arrays in Java?

Sharon Christine

Sharon Christine

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

1K+ Views

To process array elements, we often use either for loop or for each loop because all of the elements in an array are of the same type and the size of the array is known. Suppose we have an array of 5 elements we can print all the elements of ... Read More

Z Algorithm

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 08:13:31

405 Views

This algorithm is named Z Algorithm because, in this algorithm, we need to create a Z array. The size of the Z array is the same as the text size. This array is used to store the length of longest possible substring starting from the current character of the main ... Read More

N Queen Problem

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 07:51:36

13K+ Views

This problem is to find an arrangement of N queens on a chess board, such that no queen can attack any other queens on the board.The chess queens can attack in any direction as horizontal, vertical, horizontal and diagonal way.A binary matrix is used to display the positions of N ... Read More

Solving Cryptarithmetic Puzzles

Sharon Christine

Sharon Christine

Updated on 16-Jun-2020 07:16:15

14K+ Views

In the crypt-arithmetic problem, some letters are used to assign digits to it. Like ten different letters are holding digit values from 0 to 9 to perform arithmetic operations correctly. There are two words are given and another word is given an answer of addition for those two words.As an ... Read More

Advertisements