test

Tables (10)

announcements

  • announcement_id — Primary key — NOT NULL
  • user_id — INT — NOT NULL — 작성자 ID
  • course_id — INT — 강좌 ID (NULL=전체)
  • title — VARCHAR(100) — NOT NULL — 제목
  • content — TEXT — NOT NULL — 내용
  • post_date — DATETIME — NOT NULL — 게시일

attendance

  • attendance_id — Primary key — NOT NULL
  • 1 — INT — 출결 고유 ID
  • enrollment_id — INT — NOT NULL — 신청 ID
  • attendance_date — DATE — NOT NULL — 출석일
  • status — ENUM('present', 'late', 'early_leave', 'absent') — NOT NULL — 출결 상태

courses

  • course_id — INT — Primary key — NOT NULL
  • Key (teacher_id2) — Foreign key → teachers.Key — NOT NULL
  • user_id (user_id2) — int — Foreign key → teachers.user_id — NOT NULL
  • Key (enrollment_id) — Foreign key → enrollments.Key — NOT NULL
  • attendance_id — Foreign key → enrollments.attendance_id — NOT NULL
  • announcement_id — Foreign key → announcements.announcement_id — NOT NULL
  • announcement_id (announcement_id2) — Foreign key → teachers.announcement_id — NOT NULL
  • survey_id — Foreign key → teachers.survey_id — NOT NULL
  • survey_id (survey_id2) — Foreign key → surveys.survey_id — NOT NULL
  • response_id — Foreign key → surveys.response_id — NOT NULL
  • inquiry_id — INT — Foreign key → teachers.inquiry_id — 문의 고유 ID
  • teacher_id — INT — NOT NULL — 담당 교사 ID
  • course_name — VARCHAR(100) — NOT NULL — 강좌명
  • category — VARCHAR(50) — 카테고리
  • day_of_week — VARCHAR(50) — NOT NULL — 수업 요일
  • time — VARCHAR(50) — NOT NULL — 수업 시간
  • max_capacity — INT — NOT NULL — 정원
  • current_enroll — INT — 현재 신청 인원
  • status — ENUM('pending', 'approved', 'rejected') — NOT NULL — 강좌 개설 상태
  • create_date — DATETIME — NOT NULL — 개설 신청일

enrollments

  • Key (enrollment_id) — Primary key — NOT NULL
  • attendance_id — Foreign key → attendance.attendance_id — NOT NULL
  • student_id — INT — NOT NULL — 학생 ID
  • course_id — INT — NOT NULL — 강좌 ID
  • enroll_date — DATETIME — NOT NULL — 신청일
  • status — ENUM('active', 'canceled') — NOT NULL — 신청 상태

inquiries

  • inquiry_id — INT — Primary key — 문의 고유 ID
  • student_id — INT — NOT NULL — 학생 ID
  • admin_id — INT — 관리자 ID
  • title — VARCHAR(100) — NOT NULL — 제목
  • content — TEXT — NOT NULL — 내용
  • status — ENUM('pending', 'answered', 'closed') — NOT NULL — 처리 상태
  • inquiry_date — DATETIME — NOT NULL — 문의일
  • answer_content — TEXT — 답변 내용
  • answer_date — DATETIME — 답변일

students

  • student_id — Primary key — NOT NULL
  • user_id (user_id2) — int — Foreign key → users.user_id — NOT NULL
  • Key (enrollment_id) — Foreign key → enrollments.Key — NOT NULL
  • attendance_id — Foreign key → enrollments.attendance_id — NOT NULL
  • announcement_id — Foreign key → users.announcement_id — NOT NULL
  • survey_id — Foreign key → users.survey_id — NOT NULL
  • response_id — Foreign key → users.response_id — NOT NULL
  • response_id (response_id2) — Foreign key → survey_responses.response_id — NOT NULL
  • inquiry_id — INT — Foreign key → inquiries.inquiry_id — 문의 고유 ID
  • inquiry_id (inquiry_id2) — INT — Foreign key → users.inquiry_id — 문의 고유 ID
  • user_id — INT — NOT NULL — 사용자 ID
  • student_number — VARCHAR(20) — NOT NULL — 학번
  • grade — INT — NOT NULL — 학년
  • class — INT — NOT NULL — 반

survey_responses

  • response_id — Primary key — NOT NULL
  • survey_id — INT — NOT NULL — 설문 ID
  • student_id — INT — NOT NULL — 학생 ID
  • answers — JSON — NOT NULL — 응답 내용
  • submitted_at — DATETIME — NOT NULL — 제출일

surveys

  • survey_id — Primary key — NOT NULL
  • response_id — Foreign key → survey_responses.response_id — NOT NULL
  • user_id — INT — NOT NULL — 작성자 ID
  • course_id — INT — 강좌 ID (NULL=전체)
  • title — VARCHAR(100) — NOT NULL — 제목
  • questions — JSON — NOT NULL — 질문 목록
  • is_active — BOOLEAN — NOT NULL — 활성 여부
  • created_at — DATETIME — NOT NULL — 생성일

teachers

  • Key (teacher_id) — Primary key — NOT NULL
  • user_id (user_id2) — int — Foreign key → users.user_id — NOT NULL
  • announcement_id — Foreign key → users.announcement_id — NOT NULL
  • survey_id — Foreign key → users.survey_id — NOT NULL
  • response_id — Foreign key → users.response_id — NOT NULL
  • inquiry_id — INT — Foreign key → users.inquiry_id — 문의 고유 ID
  • user_id — INT — NOT NULL — 사용자 ID
  • department — VARCHAR(50) — 담당 부서/과목
  • memo — TEXT — 교사용 메모

users

  • user_id — int — Primary key — NOT NULL
  • announcement_id — Foreign key → announcements.announcement_id — NOT NULL
  • survey_id — Foreign key → surveys.survey_id — NOT NULL
  • response_id — Foreign key → surveys.response_id — NOT NULL
  • inquiry_id — INT — Foreign key → inquiries.inquiry_id — 문의 고유 ID
  • email — VARCHAR(255) — NOT NULL — 로그인 이메일
  • password — VARCHAR(255) — NOT NULL — 비밀번호(암호화)
  • name — VARCHAR(50) — NOT NULL — 이름
  • role — ENUM('admin', 'teacher', 'student') — NOT NULL — 사용자 권한
  • reg_date — DATETIME — NOT NULL — 가입일