AmitDiwan has Published 10744 Articles

MySQL query to update all records to capitalize only the first letter and set all others in lowercase

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 13:07:21

872 Views

Let us first create a table −mysql> create table DemoTable2017    -> (    -> Name text    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2017 values('JOHN SMITH, MYSQL'); Query OK, 1 row affected (0.13 sec) ... Read More

How to create a full-page background image with CSS?

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 13:04:49

623 Views

Following is the code to create a full-page background image with CSS −Example Live Demo body, html {    height: 100%;    margin: 0; } .background {    background-image: url("https://images.pexels.com/photos/1424246/pexels-photo-1424246.jpeg?         auto=compress&cs=tinysrgb&dpr=1&w=1000");    height: 100%;    background-position: center;    background-repeat: no-repeat;    background-size: cover; ... Read More

MySQL query to concatenate records with similar corresponding ids in a single row separated by a special character

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 13:04:16

269 Views

For this, you can use CONCAT_WS() along with GROUP_CONCAT(). Let us first create amysql> create table DemoTable2016    -> (    -> UserId int,    -> UserName varchar(20)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2016 ... Read More

Set 'alias' for all the column names in a single MySQL query

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 12:55:44

325 Views

To set alias for column names, the syntax is as follows −select yourColumnName1 anyAliasName1, yourColumnName2 anyAliasName2 from yourTableName anyAliasName;To understand the above syntax, let us create a table −mysql> create table DemoTable2014    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query ... Read More

Set MySQL select in a custom variable

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 12:51:59

375 Views

Let us first create a table −mysql> create table DemoTable2013    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2013 values('Chris'); Query OK, 1 row affected (0.13 sec) mysql> insert ... Read More

Format date while inserting records in MySQL

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 12:50:12

562 Views

To format date while inserting records, use DATE_FORMAT() in the MySQL INSERT statement. Let us first create a table −mysql> create table DemoTable2012    -> (    -> ShippingDate varchar(20)    -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert ... Read More

MySQL stored procedure to execute SHOW CREATE TABLE?

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 12:48:14

477 Views

To execute SHOW CREATE TABLE in a stored procedure, use SHOW CREATE TABLE. Let us first create a table −mysql> create table DemoTable2011    -> (    -> StudentId int NOT NULL AUTO_INCREMENT,    -> StudentName varchar(20),    -> StudentAge int,    -> StudentCountryName varchar(20),    -> PRIMARY KEY(StudentId)   ... Read More

How to create a modal image gallery with CSS and JavaScript?

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 12:10:49

3K+ Views

Following is the code to create modal image gallery with CSS and JavaScript −Example Live Demo

How to create a fixed social media icon bar with CSS?

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 11:48:03

533 Views

Following is the code to produce a fixed social media icon bar with CSS −Example Live Demo *, *::before, *::after {    box-sizing: border-box; } main {    margin-left: 300px; } .SocialBar {    position: fixed;    display: block;    top: 30%;    font-size: 0;    width: ... Read More

How to create a dropup menu with CSS?

AmitDiwan

AmitDiwan

Updated on 06-Apr-2020 11:11:29

808 Views

Following is the code to create a dropup menu with CSS −Example Live Demo .menu-btn {    background-color: #7e32d4;    color: white;    padding: 16px;    font-size: 20px;    font-weight: bolder;    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;    border: none; } .dropdown-menu {   ... Read More

Advertisements