EN
MySQL example tables
0
points
Table 1 - datetime
CREATE TABLE `users` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL,
`registration_time` DATETIME NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `users`
(`username`, `registration_time`)
VALUES
('Tom', '2021-01-01 11:41:31'),
('Chris','2021-01-02 11:42:45'),
('Jack','2021-01-03 15:13:39'),
('Kim','2021-01-03 15:24:51'),
('Marco','2021-01-04 22:35:38'),
('Kate','2021-01-04 22:46:51'),
('Nam','2021-01-04 22:57:37');
Table 2 - date & time
CREATE TABLE `users` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL,
`registration_date` DATE NOT NULL,
`registration_time` TIME NOT NULL,
PRIMARY KEY (`id`)
);
INSERT INTO `users`
(`username`, `registration_date`, `registration_time` )
VALUES
('Tom', '2021-01-01', '11:41:31'),
('Chris','2021-01-02', '11:42:45'),
('Jack','2021-01-03', ' 15:13:39'),
('Kim','2021-01-03', '15:24:51'),
('Marco','2021-01-04', '22:35:38'),
('Kate','2021-01-04', '22:46:51'),
('Nam','2021-01-04', '22:57:37');
Table 3 - int
CREATE TABLE `values` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`min_value` INT,
`max_value` INT,
PRIMARY KEY (`id`)
);
INSERT INTO `values`
(`min_value`, `max_value`)
values
(1000, 1500),
(1500, 2000),
(1400, 2500),
(1200, 3000),
(1800, 3500);