BOOLEAN or TINYINT to store values in MySQL?

Chandu yadav
Updated on 30-Jul-2019 22:30:24

455 Views

The MySQL BOOLEAN and BOOL both are equivalent to TINYINT(1). Whenever you create a column using BOOLEAN and BOOL data type, MySQL implicitly convert the BOOLEAN and BOOL to TINYINT(1). The BOOLEAN and BOOL are equivalents of TINYINT(1), since they are synonyms.Create a table using BOOLEAN data type. The query to create a table.mysql> create table BooleanDemo    -> (    -> IsOn BOOLEAN    -> ); Query OK, 0 rows affected (0.58 sec)Now check internal structure of the above table. The query is as follows −mysql> show create table BooleanDemo;Output+-------------+----------------------------------------------------------------------------------------------------------------------------------+ | Table       | Create Table   ... Read More

Does SQL Server have an equivalent to MySQL's ENUM data type?

Chandu yadav
Updated on 30-Jul-2019 22:30:24

2K+ Views

This works in MySQL version 8.0.12. The syntax is as follows.create table yourTableName ( yourColumnName enum(‘Value1’,Value2’,Value3’,......N) default Value1’ or Value2 or Value3,..N );Set the enum type in MySQL with the following query.mysql> create table EnumInMySQL -> ( -> WebCRUD enum('CREATE','READ','UPDATE','DELETE') -> default 'CREATE' -> ); Query OK, 0 rows affected (0.60 sec)The syntax of enum in SQL Server.create table yourTableName ( yourColumnName varchar(100) CHECK(yourColumnName IN (‘Value1’,Value2’,Value3’,......N)) DEFAULT ‘Value1’ or Value2’ or Value3’,......N );Now the query is as follows for enum in SQL Server.

What is the significance of Charminar in Hyderabad?

Shanmukh Pasumarthy
Updated on 30-Jul-2019 22:30:24

1K+ Views

Charminar is a monument which was constructed in 1591, in Hyderabad, India. The literal translation of Charminar in English is 4 pillars. It is located on the east bank of the Musi River and is listed among the most recognized structures of India. There are many theories regarding the reason for the construction of Charminar but the commonly accepted theory is that it was built to celebrate the elimination of the Plague, which was widespread at that time.Charminar was built by Muhammad Quli Qutb Shah, the fifth ruler of the Qutb Shahi dynasty. After shifting his capital from Golkonda to ... Read More

What is the role of taxonomy in biodiversity conservation?

Knowledge base
Updated on 30-Jul-2019 22:30:24

3K+ Views

The classification of things while describing and naming them can be understood as Taxonomy. This helps to identify any developmental and experimental work that needs to be done.Simply put, why would anyone mix the shoes in shoe rack with the bed sheets in a cupboard? Taxonomy is our inheritance where we define the places to which they belong. In the same way, it provides an easy to identify the categories of the species so as to have an idea of the existing conditions and to plan necessary measures for the biodiversity conservation.What is Bio-diversity Conservation?Bio-diversity is regarded as the foundation ... Read More

Why the G modifier in SELECT * FROM table_nameG?

George John
Updated on 30-Jul-2019 22:30:24

107 Views

The \G modifier gets the result in vertical order. If you use \g modifier, then it won’t affect the result. The \g works likesemi-colon.Let us first create a table. The query to create a table is as follows:mysql> create table DemoOfVertical    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Name varchar(20),    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (3.40 sec)Now you can insert some records in the table using insert command. The query is as follows:mysql> insert into DemoOfVertical(Name) values('Bob'); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More

Website Blocker Using Python

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

1K+ Views

If you are working in a big IT company then you may notice that their couple of websites are blocked especially social networking sites like facebook, youtube, Instagram etc.Instead of using third-party applications to blocks certain website, we can develop our own custom application which will block websites of our choice and developing a website blocker in python is not so difficult too. That’s what we going to do- develop a python script which will block the website we want.Prerequisite:Python 3.x installedBasic knowledge of PythonWhat we are going to do:We are going to develop python application which will block a ... Read More

MySQL LIKE IN()?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24

1K+ Views

You can implement MySQL Like IN() with the help of Regular Expression (regexp) as well. The syntax is as follows −select *from yourTableName where yourColumName regexp ‘value1|value2|value3……|valueN’;To understand the above logic, you need to create a table. Let us first create a table −mysql> create table INDemo -> ( -> Id int, -> Name varchar(100) -> ); Query OK, 0 rows affected (0.90 sec)Insert some records into the table. The query is as follows −mysql> insert into INDemo values(100, 'John'); Query OK, 1 row affected (0.13 sec) mysql> ... Read More

MySQL command for displaying current configuration variables?

George John
Updated on 30-Jul-2019 22:30:24

1K+ Views

To display current configuration variables, you can use show command. The syntax is as follows −show variables;You can further rewrite the above syntax with LIKE operator. The syntax is as follows −show variables like ‘%anyStringValue%’;The query is as follows displaying an example to fetch some of the configuration variables −mysql> show variables like '%max%';Output+------------------------------------------------------+----------------------+ | Variable_name                                        | Value                | +------------------------------------------------------+----------------------+ | binlog_max_flush_queue_time                         ... Read More

NavigableMap size() Method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

47 Views

To get the size of NavigableMap, use the size() method. It returns the count of elements in the NavigableMap.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, get the size −n.size();The following is an example to implement the size() method to get the size of the NavigableMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); ... Read More

8085 program to convert an 8 bit number into Grey number

Anvi Jain
Updated on 30-Jul-2019 22:30:24

185 Views

In this program we will see how to find the gray code from an 8-bit number.Problem StatementWrite 8085 Assembly language program to convert an 8-bit number stored at 8000H to its equivalent gray code. The result will be stored at 8050H.DiscussionIn this program we are converting binary to gray code. The procedure is simple. At first we have to shift the content to the right, then perform XOR operation with the sifted content and the actual content. Thus we will get the gray code. For an example if the number is ABH, then the binary value will be (1010 1011), ... Read More

Advertisements