MySQL: Does the default value checked by the `CHECK` constraint? Say I have the following schema, would the default value https://sample.com be checked by the CHECK (Website LIKE &quot;https://%&quot;)?
CREATE TABLE Company (
    AccountID varchar(25),
    Name varchar(20)        NOT NULL,
    Website varchar(255)    DEFAULT 'https://sample.com',
    Categories varchar(255) NOT NULL
                            DEFAULT '[]',
    PRIMARY KEY(AccountID),
    
    CHECK                   (CHAR_LENGTH(AccountID) BETWEEN 4 AND 25),
    CHECK                   (CHAR_LENGTH(Name) BETWEEN 2 AND 20),
    CHECK                   (Website LIKE &quot;https://%&quot;)
);
Checking default value doesn't make sense, as you have declared the static value which must be correct only. But the values which are going to be inserted manually are not checked using CHECK constrainst.
CREATE TABLE Company (
    AccountID varchar(25),
    Name varchar(20)        NOT NULL,
    Website varchar(255)    DEFAULT 'https://sample.com',
    Categories varchar(255) NOT NULL
                            DEFAULT '[]',
    PRIMARY KEY(AccountID),
    
    CHECK                   (CHAR_LENGTH(AccountID) BETWEEN 4 AND 25),
    CHECK                   (CHAR_LENGTH(Name) BETWEEN 2 AND 20),
    CHECK                   (Website LIKE &quot;https://%&quot;)
);

See here : the value like  hps://sdfs.com , asdfas://sdfs.com are not supposed to insert but they are inserted successfully.
insert into Company(ACCOUNTID , Name )  values ('12','asdf');
insert into Company(ACCOUNTID , Name , Website)  values ('13','asdf',&quot;hps://sdfs.com&quot;);
insert into Company(ACCOUNTID , Name , Website)  values ('1','asdf4',&quot;asdfas://sdfs.com&quot;);

select * from Company ; 

Output : 

# AccountID, Name, Website, Categories
1, asdf4, asdfas://sdfs.com, []
12, asdf, https://sample.com, []
13, asdf, hps://sdfs.com, []

Apart from using CHECK constraint I would suggest to use Triggers for validating this values or using JAVASCRIPT to valid this values.