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

  1. Create a script called database.sql
  2. 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 |

+--------------------+

  1. Create a script called tables.sql

  1. 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 |

+------------------------------------+

  1. 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 | |

+----------------------+--------------+------+-----+---------+------+

  1. Create the following scripts countries.sql, athletes.sql** and sports.sql
  2. Each script will populate the corresponding table with the data from your CSV.
  3. Data needs to be sorted alphabetically and can not contain duplicates.
  4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!