Style the Active Link with CSS

Ankith Reddy
Updated on 30-Jun-2020 09:43:02

913 Views

To style the active links, use the CSS :active selector. You can try to run the following code to style the active linksExampleLive Demo                    a:active {             background-color: green;          }                     Welcome to Qries       Click on the above link to see the effect.    

Role of CSS :disabled Selector

Chandu yadav
Updated on 30-Jun-2020 09:42:34

231 Views

Use the CSS :disabled selector to style every disabled element. You can try to run the following code to implement the :disabled selectorExampleLive Demo                    input:enabled {             background: blue;          }          input:disabled {             background: red;          }                              Subject          Student:          Age:          

Set Format Specifier in MySQL STR_TO_DATE

karthikeya Boyini
Updated on 30-Jun-2020 09:39:31

284 Views

Specify format specifier in STR_TO_DATE() method that convertes string to date. Following is the syntax −select STR_TO_DATE(yourColumnName, 'yourFormatSpecifier') from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> AdmissionDate varchar(100) -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('01-12-2019'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('15-06-2019'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('21-01-2016'); Query OK, 1 row affected (0.19 sec)Display all records from the table using select statement −mysql> select *from ... Read More

Use Special Characters in Column Names with MySQL

karthikeya Boyini
Updated on 30-Jun-2020 09:38:05

2K+ Views

Using backticks around the column name will allow you to use special characters. Let us first create a table −mysql> create table DemoTable    -> (    -> `Student-Id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> `Student-Name` varchar(100),    -> `Student-Age` int    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(`Student-Name`, `Student-Age`) values('Chris', 21); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(`Student-Name`, `Student-Age`) values('Mike', 19); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable(`Student-Name`, `Student-Age`) values('Bob', 18); Query OK, ... Read More

Fetch Middle Part of a String Surrounded by Slash in MySQL

Sharon Christine
Updated on 30-Jun-2020 09:36:30

510 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Code varchar(100)    -> ); Query OK, 0 rows affected (1.07 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('/101/102/106'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('/110/111/101'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('/111/114/201'); Query OK, 1 row affected (0.47 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+--------------+ | Code         | +--------------+ | ... Read More

Can We Use Semicolon as a MySQL Delimiter?

karthikeya Boyini
Updated on 30-Jun-2020 09:33:49

121 Views

No, we cannot. If you still did it, then stored procedure won’t get created. Therefore, first you need to change your DELIMITER from semicolon(;) to others like (// ,??..etc). Following is the syntax −DELIMITER // CREATE PROCEDURE yourProcedureName() BEGIN yourStatement1, . . . . N END // DELIMITER ;Let us implement the above syntax in order to create a stored procedure −mysql> DELIMITER // mysql> CREATE PROCEDURE get_Message()    -> BEGIN    -> SELECT CONCAT("HELLO", " ", "MYSQL USERS");    -> END    -> // Query OK, 0 rows affected (0.23 sec) mysql> DELIMITER ;Now you can call the stored ... Read More

Use Primary Key Column Pairs in MySQL

karthikeya Boyini
Updated on 30-Jun-2020 09:33:04

179 Views

Yes, you can use below syntax. Following is the syntax −PRIMARY KEY(yourColumnName1, yourColumnName2);Let us first create a table −mysql> create table DemoTable    -> (    -> StudentFirstName varchar(100),    -> StudentLastName varchar(100),    -> StudentAge int,    -> StudentCountryName varchar(100),    -> PRIMARY KEY(StudentFirstName, StudentLastName)    -> ); Query OK, 0 rows affected (0.74 sec)Let us check the description of the table −mysql> desc DemoTable;OutputThis will produce the following output −+--------------------+--------------+------+-----+---------+-------+ | Field              | Type         | Null | Key | Default | Extra | +--------------------+--------------+------+-----+---------+-------+ | StudentFirstName   | ... Read More

CSS Child Selector

Chandu yadav
Updated on 30-Jun-2020 09:31:25

403 Views

Use the child selector, if you want to select all elements immediate children of a specified element.div > pExampleYou can try to run the following code to implement CSS Child SelectorLive Demo                    div > p {             background-color: orange;          }                              Para 1 in the div.                    Para 2 in the div.             Para 3 outside the div.     Output

Implement Multiple COUNT in a Single MySQL Query

karthikeya Boyini
Updated on 30-Jun-2020 09:31:00

769 Views

For this, use CASE statement. Let us first create a table −mysql> create table DemoTable    -> (    -> LastName varchar(100)    -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Smith'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('Brown'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values('Brown'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Smith'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('Taylor'); Query OK, 1 ... Read More

Read and Write AIFF and AIFC Files Using Python

Chandu yadav
Updated on 30-Jun-2020 09:30:50

869 Views

Various functions in aifc module provide support for reading and writing AIFF (Audio Interchange File Format) and AIFF-C files. AIFF format is for storing digital audio samples in a file. Its newer version AIFF-C has the ability to compress the audio dataAudio file has number of parameters describing the audio data.The sampling rate or frame rate: number of times per second the sound is sampled.The number of channels: indicate if the audio is mono, stereo, or quadro.frame : consists of one sample per channel.The sample size: size in bytes of each sample.Thus a frame consists of channels * samplesize bytes. ... Read More

Advertisements