George John has Published 1167 Articles

Dropping Unique constraint from MySQL table?

George John

George John

Updated on 30-Jul-2019 22:30:23

340 Views

First, let us create a table with the UNIQUE constraint. It suggests that we cannot add duplicate values. Creating a table. mysql> create table UniqueConstraintDemo -> ( -> Name varchar(200) unique -> ); Query OK, 0 rows affected (1.05 sec) ... Read More

What does the KEY keyword mean in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:23

1K+ Views

Key is synonymous to an index. If you want to create an index for a column, then use ‘Key’. As stated in the official docs: KEY is normally a synonym for INDEX. The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition. ... Read More

Cable Modem Termination System (CMTS)

George John

George John

Updated on 30-Jul-2019 22:30:23

2K+ Views

Cable modem termination system (CMTS) is a hardware device at the headend of a cable TV network that is used to connect cable subscribers to the Internet Service Provider (ISP). They provide high speed data services like Internet or Voice over Internet Protocol (VoIP) over the cable TV network. ... Read More

How to disable ONLY_FULL_GROUP_BY in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:23

1K+ Views

You can enable ONLY_FULL_GROUP_BY in MySQL as shown in the following query − mysql> SET sql_mode = 'ONLY_FULL_GROUP_BY'; Query OK, 0 rows affected (0.01 sec) As shown above, we can enable ONLY_FULL_GROUP_BY with the help of SET command. To disable ONLY_FULL_GROUP_BY with the help of the following query ... Read More

How to convert MyISAM to InnoDB storage engine in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:23

235 Views

To convert the MyISAM Engine to InnoDB, we can use the ALTER command. Let us now create a table with the help of engine MyISAM. mysql> create table MyISAMToInnoDBDemo -> ( -> id int, -> Name varchar(100) ... Read More

How to get a list of MySQL indexes?

George John

George John

Updated on 30-Jul-2019 22:30:23

377 Views

Let us first see how we can display an index from MySQL. For that, use the SHOW command. The query to show an index is as follows − mysql> SHOW INDEX FROM indexingdemo; Here is the output. +--------------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+ | Table ... Read More

How to copy a table from one MySQL database to another?

George John

George John

Updated on 30-Jul-2019 22:30:23

5K+ Views

The following is the syntax to copy a table from one database to another. INSERT INTO yourDestinationDatabaseName.yourTableName SELECT * from yourSourceDatabaseName.yourtableName; Let us see an example. The CREATE command is used to create a table in the database ‘business’. We are creating a new table here. ... Read More

Python program to reverse each word in a sentence?

George John

George John

Updated on 30-Jul-2019 22:30:23

3K+ Views

Here we use python built in function. First we split the sentence into a list of word. Then reverse each word and creating a new list ,here we use python list comprehension technique and last joining the new list of words and create an new sentence. Example Input :: ... Read More

How to get a list of MySQL views?

George John

George John

Updated on 30-Jul-2019 22:30:23

3K+ Views

To get a list of MySQL views, we can use the SELECT command with LIKE operator. Let us see the syntax first. mysql> SELECT TABLE_SCHEMA, TABLE_NAME -> FROM information_schema.tables -> WHERE TABLE_TYPE LIKE 'VIEW'; The following is the output that displays the ... Read More

How to use union and order by clause in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:23

5K+ Views

Union is a type of operator in MySQL. We can use ORDER BY with this to filter records. Use UNION if you want to select rows one after the other from several tables or several sets of rows from a single table all as a single result set. Let us ... Read More

Advertisements