AmitDiwan has Published 10744 Articles

HTML disabled Attribute

AmitDiwan

AmitDiwan

Updated on 16-Sep-2019 11:07:23

257 Views

The disabled attribute of the element is used to disable element. When an element is disabled, it becomes unclickable. For obvious reasons, the disabled input element won’t get submitted.SyntaxFollowing is the syntax −Let us now see an example to implement the disabled attribute of the element −Example Live ... Read More

HTML Block and Inline Elements

AmitDiwan

AmitDiwan

Updated on 16-Sep-2019 09:19:06

412 Views

Block ElementsThe block elements appear on a screen as if they have a line break before and after them. They also take up the entire available width. Some of the block elements include, to , , , , , , , , etc.ExampleLet us see an example of one ... Read More

Can 'false' match some string in MySQL?

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:11:53

85 Views

Yes, you can use false as 0 to match.Let us first create a table −mysql> create table DemoTable804 ( Id varchar(100) ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable804 values('101John'); Query OK, 1 row affected ... Read More

Set DEFAULT values for columns while creating a table in MySQL

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:10:32

2K+ Views

To set default values for columns while creating a table, DEFAULT. Let us first see an example and create a table. As you can see below, while creating the table, we have set DEFAULT −mysql> create table DemoTable803 ( UserId int DEFAULT 101, UserName ... Read More

Display and concatenate records ignoring NULL values in MySQL

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:08:45

790 Views

Use CONCAT() to concatenate records whereas IFNULL() to check for NULL values.Let us first create a table −mysql> create table DemoTable802 ( FirstName varchar(100), LastName varchar(100) ); Query OK, 0 rows affected (1.01 sec)Insert some records in the table using insert command −mysql> insert ... Read More

MySQL query to perform sort order on same field

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:06:18

166 Views

For this, use ORDER BY IF().Let us first create a table −mysql> create table DemoTable801 ( Score int ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable801 values(30); Query OK, 1 row affected (0.19 sec) mysql> insert into ... Read More

MySQL select only a single value from 5 similar values?

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:04:29

205 Views

Let us first create a table −mysql> create table DemoTable800 ( Value int ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command. Here, we have inserted 5 similar values −mysql> insert into DemoTable800 values(10); Query OK, 1 row affected (0.18 ... Read More

How to concatenate strings using both GROUP_CONCAT() and CONCAT() in the same MySQL query?

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:03:15

465 Views

The CONCAT() method is used to concat, whereas GROUP_CONCAT() is used to concatenate strings from a group in a single string.Let us first create a table −mysql> create table DemoTable799 ( UserId int, UserName varchar(100), UserAge int ); Query OK, 0 ... Read More

Why the #1054 - Unknown column error occurs in MySQL and how to fix it?

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 09:01:35

3K+ Views

Let’s see when the #1054 error occurs in MySQL. While inserting a varchar value, if you will forget to add single quotes, then this error will arise. Following is the error −mysql> insert into DemoTable798 values(100, Adam); ERROR 1054 (42S22): Unknown column 'Adam' in 'field list'You need to use single ... Read More

What is the correct DateTime format for a MySQL Database?

AmitDiwan

AmitDiwan

Updated on 09-Sep-2019 08:59:55

252 Views

The correct datetime format for MySQL database is as follows −‘YYYY-MM-DD HH:M:SS’Let us first create a table −mysql> create table DemoTable797 ( ArrivalDatetime datetime ); Query OK, 0 rows affected (0.68 sec)Insert some records in the table using insert command −mysql> insert into DemoTable797 values(NOW()); Query OK, ... Read More

Advertisements