SQLAlchemy에서 relationship 사용 차이

오픈소스·2023년 3월 29일
0
왼쪽 코드오른쪽 코드
Lecture만 조회Inner Join, Outer Join 등을 통해 각 테이블의 컬럼을 조회
테이블에 relationship 설정 O테이블에 relationship 설정 X

[
    {
        "category": "앱",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 3,
        "name": "Athena Snider",
        "number_of_students": 0,
        "price": 7019,
        "teacher": "Keane Hogan"
    },
    {
        "category": "게임",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 4,
        "name": "Colin Murray",
        "number_of_students": 2,
        "price": 2260,
        "teacher": "Clark Hahn"
    },
    {
        "category": "게임",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 8,
        "name": "Sonia Scott",
        "number_of_students": 2,
        "price": 3091,
        "teacher": "Keane Hogan"
    },
    {
        "category": "게임",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 9,
        "name": "Armand Newman",
        "number_of_students": 2,
        "price": 2859,
        "teacher": "Indira Ramirez"
    },
    {
        "category": "앱",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 13,
        "name": "Nayda Mcconnell",
        "number_of_students": 2,
        "price": 1139,
        "teacher": "Indira Ramirez"
    },
    {
        "category": "알고리즘",
        "created_at": "Mon, 27 Mar 2023 04:39:44 GMT",
        "id": 14,
        "name": "Miranda Whitehead",
        "number_of_students": 1,
        "price": 7387,
        "teacher": "Kibo Keith"
    }
]

0개의 댓글