MySQL
11. Final challenges
Reset challenge database
If you make a mistake while editing the database in this section or just want to reset the database back to its original state, return to this page and click the “Reset Section Database” button below.
RESET CHALLENGE DATABASE
If I have seen further, it is by standing on the shoulders
of giants.
(Bernard of Chartres).
Databases are fun.
Let’s honour some of the most popular scientists of all times by
creating a famous_scientists schema with this 3 sections
challenge.
The database or schema is going to have a scientists table with 5 columns and its datatypes:
| id | name | discovery | year_of_birth | year_of_death |
|---|---|---|---|---|
| INT(4) auto increment from 1 | VARCHAR(255) can’t be NULL | TEXT can’t be NULL | INT(4) can’t be NULL | INT(4) defaults to NULL if the scientist is still alive |
Creating the database
A mysql prompt has been opened for you.
Complete the following tasks:
1 - Create a famous_scientists database



SQL statements to copy:
1) The SQL statement to create a famous_scientists database is as follows:
CREATE DATABASE famous_scientists;
2) The SQL statement to create a scientists table in the famous_scientists database is as follows:
USE famous_scientists;
CREATE TABLE scientists (
id INT(1) NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
discovery TEXT NOT NULL,
year_of_birth INT(4) NOT NULL,
year_of_death INT(4) DEFAULT NULL
);
NOTE:
MySQL 11. Final challenges Reset challenge database If you make a mistake while editing the database...