Join Symon

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Name: Paguyo Symon Russel L.

BSIT: 2C

CREATE TABLE Course (

Course_ID INT PRIMARY KEY,

Instructor_Name VARCHAR(255),

AY_Term VARCHAR(256),

Subject_Code VARCHAR(256),

Schedule VARCHAR(256),

SubjectDescription VARCHAR(255),

Course_Section VARCHAR(256),

Number_Units INT

);

CREATE TABLE Student(

Seq_No INT PRIMARY KEY,

Student_No VARCHAR(50) UNIQUE,

Student_Name VARCHAR(256)

);

CREATE TABLE Grades (

Grade_ID INT PRIMARY KEY,

Course_ID INT,

Seq_No INT,

Prelim FLOAT,

Midterm FLOAT,

Pre_Final FLOAT,

Final FLOAT,

SubjectGrade DECIMAL(5, 2),

FOREIGN KEY (Course_ID) REFERENCES Course(Course_ID),


FOREIGN KEY (Seq_No) REFERENCES Student(Seq_No)

);

SELECT

Course.Instructor_Name, Course.Subject_Code, Course.AY_Term, Course.Schedule,

Course.Subject_Description, Course.CourseSec, Course.Number_Units,

Student.SeqNo, Student.StudentNo, Student.Student_Name, Grade.Prelim,

Grade.Midterm, Grade.Pre_Final, Grade.Final,

Grade.Subject_Grade

FROM

Course

INNER JOIN

Grades ON Course_ID = Grade.Course_ID

INNER JOIN

Students ON Grade.Student_ID = Student.Student_ID

WHERE

Course.Subject_Code = 'CB650RR AND Coues.Course_Section = 'BSIT 1C'

ORDER BY

g.SeqNo;

You might also like