Extract Digit Part from String in MySQL

Sharon Christine
Updated on 30-Jun-2020 09:50:34

3K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> StudentId varchar(100)    -> ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John19383'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('Carol9999'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('David123456'); Query OK, 1 row affected (0.15 sec)Display all records from the table using select statement −mysql> select *from DemoTable;OutputThis will produce the following output −+-------------+ | StudentId   | +-------------+ | John19383 ... Read More

Style Every p Element with No Children Using CSS

Ankith Reddy
Updated on 30-Jun-2020 09:50:29

974 Views

To style every element that has no children with CSS, use the: empty selector t. You can try to run the following code to implement the: empty selectorExampleLive Demo                    p.demo {             width: 300px;             height: 20px;             background: gray;          }          p:empty {             width: 150px;             height: 20px;             background: orange;          }                     This is demo text. Below is empty text.          

Role of CSS Empty Selector

usharani
Updated on 30-Jun-2020 09:49:59

213 Views

Use the CSS :empty selector to style every element that has no children with CSS. You can try to run the following code to implement the :empty selector −ExampleLive Demo                    p.demo {             width: 300px;             height: 20px;             background: gray;           }           p:empty {              width: 150px;              height: 20px;              background: orange;          }                     This is demo text. Below is empty text.          

Select Month and Year from Dates in MySQL

Sharon Christine
Updated on 30-Jun-2020 09:49:03

455 Views

To select month and year in MySQL, you can use MONTH() and YEAR() method. Let us first create a table −mysql> create table DemoTable    -> (    -> DueDate datetime    -> ); Query OK, 0 rows affected (0.90 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-21'); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values('2019-06-15'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2018-12-01'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2015-04-01'); Query OK, 1 row affected (0.16 sec) ... Read More

Role of CSS :first-of-type Selector

George John
Updated on 30-Jun-2020 09:48:52

167 Views

Use the CSS :first-of-type selector to style every element that is the first element of its parent with CSS.ExampleYou can try to run the following code to implement the :first-of-type selectorLive Demo                    p:first-of-type {             background: orange;          }                     This is demo text1.       This is demo text2.    

Role of CSS :first-child Selector

Chandu yadav
Updated on 30-Jun-2020 09:48:28

199 Views

Use the CSS :first-child selector to style every elements that is the first child of its parent.ExampleYou can try to run the following code to implement the :first-child selectorLive Demo                    p:first-child {             background-color: orange;          }                     Heading       This is demo text.                This is demo text, with the first child of its parent div.          This is demo text, but not the first child.          

CSS Position Absolute

Prabhas
Updated on 30-Jun-2020 09:47:24

263 Views

The position: absolute; property allows you to position element relative to the nearest positioned ancestor.ExampleYou can try to run the following code to implement CSS position: absolute;Live Demo                    div.one {             position: relative;             width: 500px;            height: 150px;            border: 2px solid blue;          }          div.two {             position: absolute;             top: 70px;             right: 0;             width: 300px;             height: 50px;             border: 2px solid yellow;          }                     position: absolute;       The position: absolute; property allows you to position element relative to the nearest positioned ancestor.       div has position: relative;          div has position: absolute;          

Set a Certain Value First with MySQL ORDER BY

Sharon Christine
Updated on 30-Jun-2020 09:47:00

1K+ Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Number int    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(20); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(12); Query OK, 1 row affected (0.22 sec) mysql> insert into DemoTable values(14); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values(19); Query OK, 1 row affected (0.14 sec) ... Read More

Style Every Enabled Input Element with CSS

Arjun Thakur
Updated on 30-Jun-2020 09:46:17

203 Views

To style every enabled element, use the CSS :enabled selector.ExampleYou can try to run the following code to style enabled elementLive Demo                    input:enabled {             background: blue;          }                              Subject          Student:          Age:          

What is a CSS Selector

mkotla
Updated on 30-Jun-2020 09:45:26

597 Views

The selectors in CSS are patterns to select the element to style.Let us see the key selectors in CSS −SelectorDemoDescription class.demoSelects all elements with class="demo"#id#myidSelects the element with id="myid"**Used to select all the elements

Advertisements