Question
Help me with SQL commands please Create a script called database.sql This script will create a database with the following naming convention USERNAME_NODE i.e roary001_node001
Help me with SQL commands please
- Create a script called database.sql
- This script will create a database with the following naming convention USERNAME_NODE i.e roary001_node001
MariaDB> show databases; +--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| roary001_node001 |
+--------------------+
- Create a script called tables.sql
- This script will create the following tables [ countries, sports, athletes ] with the following naming convention USERNAME_NODE_TABLE_NAME i.e roary001_countries MariaDB> show tables; +------------------------------------+
| Tables_in_roary001_node001 |
+------------------------------------+
| roary001_node001_athletes |
| roary001_node001_countries |
| roary001_node001_sports |
+------------------------------------+
- Each of the tables must contain a single column with the following convention USERNAME_name i.e roary001_name. You must configure column USERNAME_name data type to be varchar(50). No additional requirements or indexes are to be added to the table. The command below shows the end product of the countries table. MariaDB> describe roary001_countries; +----------------------+--------------+------+-----+---------+------+
| Field | Type | Null | Key | Default | Extra|
+----------------------+--------------+------+-----+---------+------+
| roary001_sports_name | varchar(50) | YES | | NULL | |
+----------------------+--------------+------+-----+---------+------+
- Create the following scripts countries.sql, athletes.sql** and sports.sql
- Each script will populate the corresponding table with the data from your CSV.
- Data needs to be sorted alphabetically and can not contain duplicates.
- Data will be broken by the following filter so that each node contains different records.
CentOS | olympic |
Ubuntu | All 1k Users |
Fedora | paralympic |
* For the athletes.sql script make sure to combine firstname+' '+lastname into the roary001_atheletes_name column
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started