sql intro

Estimated reading time: 1 minute

What is SQL

SQL Stands for Structure Query Language . SQL was initially developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s.[15] This version, initially called SEQUEL (Structured English Query Language).

fun part

create / drop database

/* create database */
create database users;
/* drop / delete database */
drop database users;

create / drop table

create table table_name (
  col_1 datatype,
  col_2 datatype
  ....
)
/* drop / delete table */
drop table table_name
/* alter coulmn / adding new column */
alter table table_name
  add column_name datatype;
/* drop column */
alter table table_name
  drop column col_name;

Most uses command

  • select
  • update
  • delete
  • insert
  • where

important

  • is null
  • is not null
  • min(col_name)
  • max(col_name)
  • count(col_name)
  • avg(col_name)
  • sum(col_name)
  • alias = as

    insert

/* adding row */
insert into table_name (col_1,col_2,......)
  values (value_1,value_2,....);

update

/* updating  row data  */
update table_name
  set col_name = value , col_name = value .....
  where condition;

delete

delete from table_name
  where condition;

resource

gui

sql, dbms, database