Skip to content

Sehbeom/2021DB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DATABASE 설계_11.13

Week_2

1. 실행 방법

  • 원하는 디렉토리 위치에 Repository clone

    // HTTPS
    git clone https://github.com/Sehbeom/2021DB.git
    
    // SSH
    git clone git@github.com:Sehbeom/2021DB.git
  • VSCode 실행 -> week_2/hw/homework.html 실행

image

2. 사용 방법

(1) Range Bar 설정

image

(2) 'Guess the number' input 숫자 입력

image

(3) 'Play!'
  • 0부터 Range Bar로 설정된 숫자 사이의 숫자 랜덤으로 출력
  • 입력한 숫자>=출력된 숫자 : Win, 입력한 숫자<출력된 숫자 : Lose

image

image

Week_3

1. 실행 방법

  • 원하는 디렉토리 위치에 Repository clone

    // HTTPS
    git clone https://github.com/Sehbeom/2021DB.git
    
    // SSH
    git clone git@github.com:Sehbeom/2021DB.git
  • week_3 디렉토리로 이동

    cd week_3
  • express 설치 및 view 설정(hbs)

    npm install -g express-generator
    express --view=hbs .
  • npm package 설치 후 실행

    npm install
    npm run start
  • localhost 접속

    localhost:3000
  • Student Table 생성 쿼리문

    create table student(
        -> studentID int(8) NOT NULL,
        -> name char(5) not null,
        -> grade tinyint(1) not null,
        -> major varchar(20) not null,
        -> admissionDate date not null,
        -> email varchar(30) not null,
        -> primary key(studentID));

2. 실행 결과

image

image

  • Database 내 Student Table의 Data 출력.

Week8

1. 실행 방법

  • 원하는 디렉토리 위치에 Repository clone

    // HTTPS
    git clone https://github.com/Sehbeom/2021DB.git
    
    // SSH
    git clone git@github.com:Sehbeom/2021DB.git
  • week8 디렉토리로 이동

    cd week8
  • npm package 설치 후 실행

    npm install
    npm run start
  • localhost 접속

    localhost:3000
  • MySQL 쿼리문

    • Employee Table

      create table employee(
      	Fname varchar(10) not null,
          Minit char(1) null,
          Lname varchar(20) not null,
          Ssn char(9) not null,
          Bdate date null,
          Address varchar(30) null,
          Sex char(1) null,
          Salary decimal(5,0) null,
          Super_ssn char(9) null,
          Dno int not null,
          primary key(Ssn)
      );
    • Department Table

      create table department(
      	Dname varchar(15) not null unique,
          Dnumber int not null,
          Mgr_ssn char(9) not null,
          Mgr_start_date date null,
          primary key(Dnumber)
      );
    • Contraints

      • FK : Employee(Dno) -> Department(Dnumber)

        alter table employee add constraint Dno_Dnum foreign key(Dno) references department(Dnumber);
      • FK : Department(Mgr_ssn) -> Employee(Ssn)

        alter table department add constraint Mgrssn_Ssn foreign key(Mgr_ssn) references employee(Ssn);

2. 사용 방법

(1) path : '/'

  • Employee, Department Data 삽입

image

(2) path : '/select'

  • Employee, Department Data 출력 image image

(3) path : '/update'

  • '/update/employee' : Employee Data 수정

image

  • 'update/department' : Department Data 수정

image

Week10

1. 실행 방법

  • 원하는 디렉토리 위치에 Repository clone

    // HTTPS
    git clone https://github.com/Sehbeom/2021DB.git
    
    // SSH
    git clone git@github.com:Sehbeom/2021DB.git
  • week10 디렉토리로 이동

    cd week10
  • npm package 설치 후 실행

    npm install
    npm run start
  • localhost 접속

    localhost:3000
  • MySQL 쿼리문

    • Department Table

      create table department(
      	Dname varchar(15) not null unique,
          Dnumber int not null,
          primary key(Dnumber)
      );
    • Subject Table

      create table subject(
      	subject_name varchar(30) not null,
          subject_id int not null,
          primary key(subject_id)
      );
    • User Table

      create table user(
      	Id varchar(20) not null,
          Password varchar(20) not null,
          Role varchar(5) not null,
          primary key(Id)
      );

2. 사용 방법

(1) path : '/'

  • User Table의 Id, Password Data를 토대로 로그인
  • Id 가 'admin' 일 경우, 삭제 가능 페이지로 연결 : '/delete'
  • Id 가 'admin'이 아닐 경우, Data 출력 페이지로 연결 '/select'

image

(2) path : '/delete'

  • admin 계정으로 로그인 시 접속 가능
  • Data 삭제 가능

image

(3) path : '/select'

  • admin 계정이 아닌 계정으로 로그인 시 접속
  • 단순 Data 출력 페이지

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published