Database Introduction (Mysql)

Database: It is essentially a collection of data.

Mysql: is a freely available open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). SQL is the most popular language for adding, accessing and managing content in a database. It is most noted for its quick processing, proven reliability, ease and flexibility of use.

Syntex Description Example
Create Used to create initial database or table CREATE DATABASE {database_name};


CREATE TABLE {table_name} (

id INT NOT NULL AUTO_INCREMENT,

{COLUMN_NAME1} VARCHAR(100) NOT NULL,

{COLUMN_NAME2} VARCHAR(40) NOT NULL,

{COLUMN_NAME3} DATE,

PRIMARY KEY ( id )

);

Select The SQL SELECT command is used to fetch data from MySQL database.(The * in example means all columns in the table) Select * from {table_name};
Insert Used to insert data into tables Insert data into table without specifying columnINSERT INTO {table_name}

VALUES (value1,value2,value3,…);


Insert data in table specifying column

INSERT INTO {table_name} (column1,column2,column3,…)

VALUES (value1,value2,value3,…);

Update Update existing data in existing Table UPDATE {table_name}

SET column1=value1,column2=value2,…

WHERE {some_column}={some_value};

Delete Delete a row inside a existing Table DELETE FROM table_name

WHERE {some_column}={some_value};

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s