• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/16

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

16 Cards in this Set

  • Front
  • Back

Installing mysql on Red Hat

1. yum install mysql


2. service mysqld start


3. mysqladmin -uroot password "new password"

Installing mysql on Debian/Ubuntu

apt-get install mysql

Accessing mysql

Type mysql -u root -p and type in the password to access mysql.

Creating a Database in mysql

CREATE DATABASE {database_name};

List all Created Databases in mysql

SHOW DATABASES;

Move Into a Database in mysql

USE {database_name};

List all Tables Inside of a Database

Once inside/moved into database: SHOW TABLES;

Create a Table

CREATE TABLE {table_name} ( {field1} {field type}, {field2} {field type} );

Insert Data Into a Table

INSERT INTO {table name} ( {field1}, {field2} ) VALUES ( "field1" , "field2" );

Update Data in a Row/Table

UPDATE {table name} SET {field}="{VALUE}" WHERE {field}="{VALUE}";

Delete Row

DELETE FROM {table name} WHERE {field}="{value}"

Return All Data From a Table

SELECT * FROM {table};

Return A Single Column From a Table

SELECT {column} FROM {table};

Sorting Using Order By

SELECT * FROM {table} ORDER BY {field};




To sort in ascending (ASC) order:


SELECT * FROM {table} ORDER BY {field} ASC;




To sort in descending (DESC) order:




SELECT * FROM {table} ORDER BY {field} DESC;

Select Statement Using Multiple Fields

SELECT * FROM {table} WHERE {field}="value" AND {field}="value";

Left Join Statement

SELECT * FROM {table1} LEFT JOIN {table2} ON {table1}.{field}={table2}.{field};