π SQL μμ±μ μ¬μ©λλ λ¬Έλ²(CRUD)
- SHOW DATABASES : λ°μ΄ν°λ² μ΄μ€ μ 보 보기
- CREATE DATABASE testDB : λ°μ΄ν°λ² μ΄μ€ testDB λ°μ΄ν° μμ±
- DROP DATABASE testDB : λ°μ΄ν°λ² μ΄μ€ testDB λ°μ΄ν° μμ
- CREATE TABLE Customers : λ°μ΄ν° μ ν
μ΄λΈ μμ±
CREATE TABLE Customers (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
- DROP TABLE Customers : λ°μ΄ν° μ ν
μ΄λΈ μ 체 μμ
- TRUNCATE TABLE Customers
β : λ°μ΄ν° μ ν
μ΄λΈμ μ λ³΄λ§ λͺ¨λ μμ , ν
μ΄λΈμ μ μ§
- ALTER TABLE Customers ADD BirthDay DATE
β : ν
μ΄λΈμ μλ‘μ΄ column μΆκ°, column μ΄λ¦ - BirthDay νμ
- DATE(μ§μ κ°λ₯)
- ALTER TABLE Customers DROP COLUMN BirthDay : ν
μ΄λΈ λ΄ νΉμ column μμ