DB) SQL

jjjjjju·2025년 3월 6일

DB

목록 보기
2/2
post-thumbnail

SQL

  • relational data를 표현 & 조작하기 위한

  • High-level !!!

    • 굉장한 high level 언어
    • DBMS는 query들을 표현하는데 가장 좋은 방법을 찾음
      • “query optimization” : 내가 보내는 query가 더 효율적으로 변형돼서 실행 됨
  • Two aspects to SQL

    1. Data definition : for declaring database schemas (DDL)
      1. database schemas = Table structure
      2. definition 대상 = Table
        1. CREATE, DROP, ALTER
    2. Data manipulation : for querying databases and for modifying the databases (DML)
      1. DML : 내가 원하는 data를 찾기 위해 질문하는 것 + 수정하기 위해 명령 & 처리
      2. manipilation (대상 = records)
      3. SELECT, INSERT, DELETE, UPDATE

SQL PART

  • DML : 어떻게 access를 할 것인가 ! → operaton을 다 처리해주는 것
  • Integrity : the DDL includes commands for specifying integrity(조건들을 통칭) constaraints
  • View definition : 테이블을 내가 원하는 형태로 조회할 수 있음
  • Transaction control
  • Embedded SQL and dynamic SQL : important skill
    • IF : 내 프로그램이 DB위에 있게 하고 싶을 때 사용
  • Authorization : 권한 설정 (로그인 이런 것이 아니라, 상세하게 설정 가능!!)

Basic Query Structure

  • 맥락 : SQL이 결국에는 relational algebra의 implementation이다.

  • typical SQL query - 많이 쓰이는 구조들

    • SELECT + attribute → col
    • FROM + relations → Table
    • WHERE + predicates (conditions)
  • The result(output)

    • relational algebra
      • input : relation
      • output : relation
    • SQL
      • input : FROM 뒤에 있는 relation들
      • output : relation
profile
안녕하세요. 코딩의 습관화를 목표로 삼아 살고 있는 대학생입니다. 시리즈에 학교 수업 및 코딩 관련한 글들을 정리해두었습니다. 감사합니다 :)

0개의 댓글