Add Different Styles to Hyperlinks Using CSS

mkotla
Updated on 22-Jun-2020 06:00:28

324 Views

To set different styles to hyperlinks, such as font-size, background color, etc, you can try to run the following code:ExampleLive Demo                    a.first:link {color:#ff0000;}          a.first:visited {color:#0000ff;}          a.first:hover {color:#ffcc00;}          a.second:link {color:#ff0000;}          a.second:visited {color:#0000ff;}          a.second:hover {font-size:150%;}          a.third:link {color:#ff0000;}          a.third:visited {color:#0000ff;}          a.third:hover {background:#66ff66;}                     Mouse over the below given links:       Link changes color       Link changes font-size       Link changes background-color    

Style Last Child

Elements with CSS

George John
Updated on 22-Jun-2020 05:58:52

176 Views

To style every elements that is the last child of its parent, use the CSS :last-child selector. You can try to run the following code to implement the :last-child selectorExampleLive Demo                    p:last-child {             background: orange;          }                     This is demo text1.       This is demo text2.       This is demo text3.     Output

Create MySQL Stored Procedure to Return Multiple Values

Nikitha N
Updated on 22-Jun-2020 05:56:02

2K+ Views

We can create a stored procedure with both IN and OUT parameters to get multiple values from a MySQL table. To make it understand we are taking an example of a table named ‘student_info’ having the following data −mysql> Select * from student_info; +------+---------+------------+------------+ | id   | Name    | Address    | Subject    | +------+---------+------------+------------+ | 101  | YashPal | Amritsar   | History    | | 105  | Gaurav  | Jaipur     | Literature | | 110  | Rahul   | Chandigarh | History    | | 125  | Raman   | Bangalore  | Computers  | ... Read More

Set Min Width and Max Width of an Element using CSS

Ankith Reddy
Updated on 22-Jun-2020 05:55:28

447 Views

To set the minimum and maximum width of an element, you can try to run the following codeExampleLive Demo                    div {             max-width: 300px;             min-width: 100px;             background-color: red;          }                     Below is a div with maximum and minimum width. Resize the web browser to see the effect.       This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text. This is demo text.          This is demo text. This is demo text. This is demo text.           Output

Use User Variables in MySQL Stored Procedures

usharani
Updated on 22-Jun-2020 05:54:47

283 Views

In MySQL stored procedure, user variables are referenced with an ampersand i.e. @, prefixed to the user variable names. For example, @A, @B, etc. are user variables. To demonstrate it, we are creating the following procedure −mysql> DELIMITER // ; mysql> CREATE PROCEDURE Proc_Uservariables()    -> BEGIN    -> SET @A = 100;    -> SET @B = 500;    -> SELECT @A,@B,@A+@B;    -> END // Query OK, 0 rows affected (0.00 sec) mysql> Delimiter ; // mysql> CALL Proc_Uservariables(); +------+------+-------+ | @A   | @B   | @A+@B | +------+------+-------+ |  100 |  500 |   600 | +------+------+-------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.01 sec)

MySQL SUBSTRING_INDEX Function Argument Count Behavior

Ayyan
Updated on 22-Jun-2020 05:54:07

208 Views

MySQL SUBSTRING_INDEX() function will return the same string as output if the argument ‘count’ has the value greater than the total number of occurrences of delimiter. It can be demonstrated with the following example −mysql> Select SUBSTRING_INDEX('My Name is Ram','a',3); +-----------------------------------------+ | SUBSTRING_INDEX('My Name is Ram','a',3) | +-----------------------------------------+ | My Name is Ram                          | +-----------------------------------------+ 1 row in set (0.00 sec)The above query returns the same string because 3 is greater than the total number of occurrences of delimiter provided as argument i.e. ‘a’. There are only two ‘a’ in the string.

Default Rules for Parsing Names of Built-in Functions

Monica Mona
Updated on 22-Jun-2020 05:53:23

180 Views

Actually, when a parser encounters a word that is the name of a built-in function, it must determine whether the name represents a function call or is instead a non-expression reference to an identifier such as a table or column name. consider the following queries −1. Select sum(salary) from employee; 2. Create table sum (i int);In the first query SUM is a reference to a function call and in the second query, it is referencing to table name.Parser follows the following rules to distinguish whether their names are being used as function calls or as identifiers in non-reference context −Rule1 ... Read More

Change Default Parsing Rules for Built-in Functions

Rishi Raj
Updated on 22-Jun-2020 05:52:04

145 Views

The default rules used by the parser for parsing names of built-in-function can be changed by enabling IGNORE_SPACE SQL mode. When we enable this mode, the parser relaxes the requirement that there be no whitespace between the function name and the following parenthesis. For example, after enabling IGNORE_SPACE SQL mode both of the following function calls are legal −Select SUM(Salary) from employee; Select SUM (Salary) from employee;But, in this case, the parser treats the function name as reserved words. It means that a space following the names no longer represents as an identifier.

Using MySQL IF Statement in Stored Procedures

Ramu Prasad
Updated on 22-Jun-2020 05:51:19

555 Views

MySQL IF statement implements a basic conditional construct within a stored procedure. Its syntax is as follows −IF expression THEN Statements; END IF;It must end with a semicolon. To demonstrate the use of IF statement within MySQL stored procedure, we are creating the following stored procedure which is based on the values, as shown below, of the table named ‘student_info’ −mysql> Select * from student_info; +------+---------+------------+------------+ | id   | Name    | Address    | Subject    | +------+---------+------------+------------+ | 101  | YashPal | Amritsar   | History    | | 105  | Gaurav  | Jaipur     | ... Read More

Use of IGNORE_SPACE SQL Mode

Arjun Thakur
Updated on 22-Jun-2020 05:48:58

655 Views

The IGNORE_SPACE SQL mode can be used to modify how the parser treats function names that are whitespace-sensitive. Following are the cases in which we can use IGNORE_SPACE SQL mode −Case-1  − When IGNORE_SPACE SQL mode is disabledAfter disabling the IGNORE_SPACE SQL mode, the parser interprets the name as a function call when there is no whitespace between the name and the following parenthesis. This also occurs when the function name is used in a non-expression context. It can be understood from the following query −mysql> Create table SUM(Id Int); ERROR 1064 (42000): You have an error in your SQL ... Read More

Advertisements