SQL Introduction

Data types

  • TEXT
  • VARCHAR
  • NUMERIC
  • INTEGER
  • REAL
  • BLOB
  • others

Create Table operation

  • CREATE TABLE + name of the table(unique)
  • Types of the attributes

CREATE TABLE users(

    id INTEGER PRIMARY KEY AUTOINCREMENT,

    email VARCHAR(255)

);

Alter operation

ALTER TABLE usesr

RENAME TO users;

 

ALTER TABLE users

ADD COLUMN is_students BOOLEAN;

 

CRUD operations

CRUD

SQL

CREATE

READ

UPDATE

DELETE

INSERT

SELECT

UPDATE

DELETE

==

==

==

==

INSERT Operation

INSERT INTO <table_name> (column1, column2,..., columnN)

SELECT Operation

Subtitle

UPDATE Operation

Subtitle

DELETE Operation

Subtitle

SQL Introduction

By Rositsa Zlateva

SQL Introduction

  • 273