3.1 Overview of the SQL Query Language
SQL language의 종류
- Data-Definition Language :Defining, deleting, modifying relation schemas 데이터 정의언어
- Data-Manipulation Language : ability to query information from the database 테이터정의언어
- Integrity
- View definition
- Transaction control
- Embedded SQL
- Authorization
- Basic Types in SQL DDL
- Basic Schema Dfinition - Create Table
- Integrity Constraint in Create Table
- Drop and Alter Table Constructs
3.3 Basic Structure of SQL Queries
SQL DML은 Query 정보를 넣고 지우고 업데이트할 수 있게 해준다.
** SQL에서는 대문자 소문자 구별이 없다!! ex) NAME = name = NaMe
- The Select Clause
SELECT cluased에는 + - / * 를 다 쓸수 있다. (*은 전체라는 뜻이다)
- The From Clause
- The Where Clause
- Joins
- Natural Join
3.4 Additional Basic Operations -Rename Operation
SQL allows renaming relations and attributes using the as clause ex) old-name as new-name
*instructor as T == instructor T
String Operations
SQL includes a string-matching operator for comparisons on character strings. "like"랑 같이 쓰인다ㅡ
-Percent (%) : The % character matches any substring.
-Underscore (_) : The _ character matches any character.
고급 표현
-intro% : intro로 시작하는 모든 String
-%Comp% : Comp가 들어가는 모든 String
-___ : 정확히 3글자인 String
-___% : 최소 3글자인 String
차순
Default : 오름차순
-오름 차순 : asc
-내림 차순 : desc
ex)Order by **** asc
Between
*not Between도 있음
Union
Intersect
Except
문제!!! 풀어보기
'일상 > DataBase' 카테고리의 다른 글
SQL 소개 (2) (0) | 2017.09.28 |
---|---|
SQL 공부 1 (0) | 2017.09.27 |
2. Relational Model이란 (0) | 2017.09.27 |
1.데이터베이스(DataBase)란 (0) | 2017.09.27 |