Skip to content
91d906h4Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HySQL

Website

http://hysql.rf.gd/

Syntax

1. SELECT

The SELECT statement is used to select data from a database.

The data will be returned in json.

FROM <table_name> SELECT <col1, col2, ...>

You can also change the order. For example :

SELECT fun, profit FROM real_world

Using WHERE to filter to result.

FROM <table_name> SELECT <col1, col2, ...>
WHERE <cond1, cond2, ...>

2. UPDATE

The UPDATE statement is used to modify the existing records in a table.

UPDATE <table_name>
SET <col1 = val1, col2 = val2, ...>
WHERE <cond1, cond2, ...>

For example :

UPDATE employee
SET salary = 200000
WHERE name = 'ME'

3. INSERT

The INSERT INTO statement is used to insert new records in a table. You will need to specify both the column names and the values to be inserted:

INSERT INTO <table_name> (col1, col2, ...)
VALUE (val1, val2, ...)

The numbers of column must be same as the numbers of value. For example :

INSERT INTO className (id, name)
VALUE (30, 'Joe')

4. DELETE

The DELETE statement is used to delete existing records in a table.

There is a difference between HySQL and MySQL, in HySQL, you can specify the columns you want to delete.

DELETE <col1, col2, ...>
FROM <table_name>
WHERE <cond1, cond2, ...>

For example :

DELETE id
FROM class
WHERE name = 'Joe'

5. CREATE

The CREATE statement is used to create a new HySQL table.

CREATE <table_name> (
    <col1> <val1>,
    <col2> <val2>,
    ...
)

The columns and values will be the col and val of the first data. For example :

CREATE TABLE tree (
    Name 'Pinus resinosa',
    Kingdom 'Plantae',
    Clade 'Tracheophytes'
)

The database generated :

[
    {
        "Name": "Pinus resinosa",
        "Kingdom": "Plantae",
        "Clade": "Tracheophytes"
    }
]

6. DROP

The `DROP` statement is used to drop an existing HySQL table.

HySQL can drop multiple tables in one time.

DROP TABLE <table_name1, table_name2, ...>

For example :

DROP TABLE tree, class, employee

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages