clear markdown help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1044276 fiddles created (9440 in the last week).

select @@version;
@@version
8.0.13
@@version
8.0.13
 hidden batch(es)


CREATE TABLE IF NOT EXISTS USER_PROFILE ( id BIGINT NOT NULL AUTO_INCREMENT, user_id BIGINT NOT NULL, name VARCHAR(100) NOT NULL, username VARCHAR(100) NOT NULL, mobile BIGINT NOT NULL, description VARCHAR(100), created_date DATETIME, modified_date DATETIME, PRIMARY KEY (id), UNIQUE (user_id) );
 hidden batch(es)


CREATE TABLE IF NOT EXISTS USER_DESCRIPTION_HISTORY ( id BIGINT NOT NULL AUTO_INCREMENT, user_id BIGINT NOT NULL, description VARCHAR(100), dt_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY(id), CONSTRAINT FOREIGN KEY (user_id) REFERENCES USER_PROFILE (user_id) );
 hidden batch(es)


show create table USER_DESCRIPTION_HISTORY ;
Table Create Table
USER_DESCRIPTION_HISTORY CREATE TABLE `USER_DESCRIPTION_HISTORY` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) NOT NULL, `description` varchar(100) DEFAULT NULL, `dt_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), CONSTRAINT `USER_DESCRIPTION_HISTORY_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `USER_PROFILE` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Table Create Table
USER_DESCRIPTION_HISTORY CREATE TABLE `USER_DESCRIPTION_HISTORY` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `user_id` bigint(20) NOT NULL, `description` varchar(100) DEFAULT NULL, `dt_datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `user_id` (`user_id`), CONSTRAINT `USER_DESCRIPTION_HISTORY_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `USER_PROFILE` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
 hidden batch(es)