Click here to download MySQL Community Server - DB
Click here to download MySQL Workbench - UI
Click here to download MySQL Shell
AWS RDS MYSQL import db Access Denied
To create database
$ CREATE DATABASE test;
To drop database
$ DROP DATABASE test;
To create database
$ CREATE DATABASE record_company;
Selecting database o make CRUD queries run
$ USE record_company;
To create table in database
$ CREATE TABLE test(
test_column INT
);
To modify the table in database
$ ALTER TABLE test
ADD another_column VARCHAR(255);
To delete/drop the table in database
$ DROP TABLE test;
To create table with primary key in database
$ CREATE TABLE bands (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY(id)
);
To create table with foriegn key in database
$ CREATE TABLE albums (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
release_year INT,
band_id INT NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY(band_id) REFERENCES bands(id)
);
To add rows to the table
$ INSERT INTO bands (name)
VALUES ('Iron Maiden');
To add multiple rows to the table
$ INSERT INTO bands (name)
VALUES ('Deuce'), ('Avenged Sevenfold'), ('Ankor');
Fetching all the data from table
$ SELECT * FROM bands;
Fetching all the data which has only distinct (different) values from table
$ SELECT DISTINCT column1 FROM bands;