8000 GitHub - alexeyknyshev/mysql-labs: Environment for that stupid labs
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

alexeyknyshev/mysql-labs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlabs

Environment for doing sql labs. Includes:

  • script to initialize a container with mysql;
  • script to run a command promt in this container;
  • scripts for filling database with data (creating tables and records).

Creating Container

NB: you need docker for using this environment

NB: don't forget to chmod +x for scripts

. create

This command will create a docker container named sqlab with latest mysql server inside.

Running SQL Promt

. run

This will run a SQL command promt in your terminal. It assumes that sqlab container was already created before. This container is stopped and started automatically inside the script.

Filling Database

./files directory containes needed scripts and is mounted into container as /files. To test that all is mounted correctly, type:

source /files/test.sql

It should print that 2*2 == 4.

To create database, then tables and then records type:

create database lab;
use lab;
source /files/tables.sql
source /files/dump.sql
# test that everything is ok:
select * from P;

Type exit to exit sql command promt, stop sqlab container and than exit the run script.

About

Environment for that stupid labs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%
0