Skip to content
/ MySQL Public

Repository containing the queries developed in MySQL

License

Notifications You must be signed in to change notification settings

Adath/MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repository containing the queries developed in 👉 MySQL 👈

License License License

Introduction

🌖 DDL - Data Definition Language

🌗 DML - Data Manipulation Language

🌘 DQL - Data Query Language

🌑 DTL - Data Transaction Language

🌒 DCL - Data Control Language

Installation [🚀 Windows]

Connection

Windows
    mysqlsh --user root --host localhost --port 3306 -p
    \sql
Manjaro
    sudo pacman -S mysql
    sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
    sudo pacman -S libsecret

    sudo pacman -S gnome-keyring

    sudo pacman -S mysql-workbench
    mysql -u root -h localhost -p

    USE mysql

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'my_password';

    exit
    sudo systemctl start mariadb
    sudo mysql_secure_installation

    sudo systemctl status mariadb

    sudo mysql -u root -p

    sudo mysql -u root -h localhost -p

    sudo mysql --user root --host localhost -p
SHOW DATABASES
    SHOW DATABASES;
CREATE DATABASE
    CREATE DATABASE mysql_db;
USE DATABASE
    USE mysql_db;
SHOW TABLES AND VIEWS
    SHOW TABLES;
TABLES
Show information about a table called products
    SHOW CREATE TABLE products;
Inserting values in a table called products
    INSERT INTO products (description, brand, price) VALUES ('Notebook', 'LeNovo', 1500);
    INSERT INTO products (description, brand, price) VALUES ('Caneta', 'Bic', 2);
    INSERT INTO products (description, brand, price) VALUES ('Fita', 'Durex', 10);
    INSERT INTO products (description, brand, price) VALUES ('Massa', 'Miojo', 2);
    INSERT INTO products (description, brand, price) VALUES ('Leite', 'Ninho', 12);
    INSERT INTO products (description, brand, price) VALUES ('Cereal', 'Sucrilhos', 20);
TRUNCATE TABLE
    TRUNCATE TABLE products

Pager (Linux)

    pager less -S
YOU CAN TELL MYSQL TO USE THE LESS PAGER ITS `-S` OPTION THAT CHOPS WIDE LINES AND GIVES YOU AN OUTPUT THAT CAN SCROLL WITH THE ARROW KEYS
THIS, NEXT TIME YOU RUN A COMMAND WITH A WIDE OUTPUT, MySQL WILL LET YOU BROWSE THE OUTPUT WITH THE LESS PAGER

About

Repository containing the queries developed in MySQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published