Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: database-assignment-1
Choose a base branch
from

Conversation

AnNguyenLe
Copy link

No description provided.


-- đ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
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

-- 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
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

prof_id int not null,
prof_lname varchar(50),
prof_fname varchar(50),
primary key (prof_id)
Copy link
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