SQL

MySQL

Command Meaning
sudo mysql -u root -p logon
CREATE DATABASE exampledb; Creates Database
CREATE USER 'exampleuser'@'localhost' IDENTIFIED BY 'THisISNotSafe';
use BPDB; GRANT SELECT ON * TO 'bphs'@'localhost';
ALTER USER 'bphs'@'localhost' IDENTIFIED BY 'ThisISNotSafe';
Creates "exampleuser" with pass ThisISNotSafe
Second line selects database and gives read rights.
Change user...
FLUSH PRIVILEGES; Without flushing the privilege table, the new user won’t be able to access the database.
create table Movies(
MovieName_ID INT not null,
ID INT NOT NULL AUTO_INCREMENT,
Rating int not null,
UpdateDate DATETIME default CURRENT_TIMESTAMP(),
CONSTRAINT PK_Movies_ID PRIMARY KEY (ID),
CONSTRAINT CK_Movies_Rating CHECK (Rating>0 AND Rating < 11),
CONSTRAINT FK_Movies_Name_ID FOREIGN KEY (MovieName_ID) REFERENCES MovieNames(ID)
);
Create table statement.
show tables;
describe yourtable;
Shows current tables.
Shows columns of yourtable.
cd D:\www\wamp64\bin\mysql\mysql5.7.26\bin
mysqldump -u root -p BPDB > d:\www\wamp64\www\BPDBdata\backup.sql
source /var/www/html/data/backup.sql
Change dir to run the .exe (or set the dir in path)
Dump database in the script File using above mentioned Directory
Load script from backup.sql
...Under Construction...

Cassandra

Command Meaning
cqlsh -u cassandra logon
show version Show your Cassandra version

My SQL notepad file is located here