Skip to content

[Assignment 1 - DB] Nguyen Le Thien An#2

Open
AnNguyenLe wants to merge 1 commit into
EngineerProOrg:database-assignment-1from
AnNguyenLe:database-assignment-1
Open

[Assignment 1 - DB] Nguyen Le Thien An#2
AnNguyenLe wants to merge 1 commit into
EngineerProOrg:database-assignment-1from
AnNguyenLe:database-assignment-1

Conversation

@AnNguyenLe

Copy link
Copy Markdown

No description provided.

Comment thread sol-3.sql

-- điểm số trung bình của các course (quy ra lại theo chữ cái)
select t.course_id, t.course_name,
case when t.avg_grade_num = 10 then 'A'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should use >= , <= ... because avg may return float number

Comment thread sol-3.sql
-- những course (distinct) mà 1 professor cụ thể đang dạy
select distinct c.course_id, c.course_name, p.prof_id, p.prof_fname, p.prof_lname
from professor as p join class as cl on p.prof_id = cl.prof_id
join course as c on cl.course_id = c.course_id;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this question meaning that, we already have prof_id, and find all distinct course that he teach

Comment thread sol-2.sql
prof_id int not null,
prof_lname varchar(50),
prof_fname varchar(50),
primary key (prof_id)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add auto increase primary id ( and for all tables too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants