CREATE TABLE table_name( -- Create table
	Id INT NOT NULL,  
  	col VARCHAR(64), 
  	PRIMARY KEY(Id)
);
INSERT INTO table_name(Id, col) VALUES(1,'Volkswagen'), (2,'Toyota'); -- Insert values in the table
UPDATE table_name SET column_name = new_value WHERE condition; -- Updating values of a table
DELETE from table_name [WHERE condition] -- Deleting rows from a table
TRUNCATE TABLE table_name [IMMEDIATE] -- Delete all entries from a table
DROP TABLE table_name; -- Deleting a table
ALTER TABLE old_table_name RENAME TO new_table_name; -- Renaming table
ALTER TABLE table_name ADD column_name data_type; -- Adding column to a table
ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name; -- Rename column
ALTER TABLE table_name DROP COLUMN column_name; -- Deleting column of a table
ALTER TABLE table_name ALTER COLUMN column_name new_data_type; -- Change data type of a column
ALTER TABLE table_name ALTER COLUMN column_name DROP NOT NULL; -- Removing "NOT NULL" constraint
ALTER TABLE table_name MODIFY column_name INT AUTO_INCREMENT; -- Turn on "AUTO INCREMENT" 
ALTER TABLE table_name MODIFY column_name INT; -- Turn off "AUTO INCREMENT" 
ALTER TABLE table_name ADD CONSTRAINT fk_constraint_name FOREIGN KEY (column_name) REFERENCES other_table(other_column); -- Adding foreign key constraint
ALTER TABLE table_name DROP CONSTRAINT fk_constraint_name; -- Removing foreign key constraint

SQL相关代码片段

spring postgresql example

test existence of an SQL table before deleting

sql student form

mysql database structure export

postgresql insert datetime example

relational dbms

brew mysql

is operator sql

What is Partitioned_By in SQL?

for loop pl/sql

oracle change column type

convert sql table to c# class

mysql date time month

SQL create table

show store procedure create process

MISSIng index sql server

postgres update column

pagination in mssql

how to search in myanmar unicode in ssms database

how to get first and last day of month in sql

oracle list foreign keys referencing a table

what is unsigned in mysql

Impala Wildcard Search Query

sql server force parallelism

oracle list of materialized views

ajouter un mot de passer mysql

show view code mssql

Filter window function

oracle get plan_hash_value from "explain plan"

Incorrect syntax near 'RSA_512'.

analyze table oracle

mysql created_at and updated_at add value

supabase "permission denied for schema public"

get age using sql query

phpmyadmin get list of all databases with sizes

how to get scend number row from mysql database

create a sequence in oracle sql

does not contain KQL (Kusto)

how to alter data enum status in postgres

how to alter data enum status

order by sql multiple columns with case

idle connections

create table using existing table bigquery

perform sql inset comand in c#

oracle apex avoid confirmation

mysql ERROR: ASCII '\0' appeared in the statement

oracle date to timestamp with timezone

check what is using sql cpu on sql server

wp secure sql query

list out custom functions cmd in mysql

sql having count is null

find particular column or table name from whole db

EPOCH postgres

MSSQL Work table

float to varchar in sql

sqlplus generate awr

length vs char_length mysql

get last inserted primary key mysqli

alter multiple columns in table sql server

psql check

editeur plSQL en ligne

sql get last 2 month

levenshtein sql mysql 8

CONVERT Date Formats

postgresql root password change

postgresql root password reset

is null and is not null in sql

mysql cli create database with engine and charset

dateformat mysql

creating a tablespace

mysql connection refused docker

reset table mysql

oracle plsql how to print array type

hive insert from select

sql delete all the database tables

sql create command

sql server select if else example

how to make the dump out of database in postgresql

how to save sql_mode in mysql permanently

created_at updated_at mysql