You are given the following tables:CourseCourseID Description CreditsCS101 Computer Science I 3CS201 Elementary Data Structures 3ENGL210 Technical Writing 3RegistrationSID CourseID SemID Instructor Grade282712 ENGL210 201701 H. Zacny B+362112 CS101 201701 K. Ross C652123 CS403 201603 K. Ross AStudentSID Lname Fname Major986223 Smith Janet Chemistry362112 Williams Henry Computer Science282712 Jones John English LiteratureWhat would the following SQL Select statement produce for output?select course.Description,registration.SID,registration.grade, student.lnamefrom registrationinner join courseon registration.courseID = course.courseIDinner join student on registration.sid = student.sidSelect one:a.No output, since this query cannot be performedb.Technical Writing 282712 B+ Jonesc.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams Cd.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams CNull 652123 Null A
Question
You are given the following tables:CourseCourseID Description CreditsCS101 Computer Science I 3CS201 Elementary Data Structures 3ENGL210 Technical Writing 3RegistrationSID CourseID SemID Instructor Grade282712 ENGL210 201701 H. Zacny B+362112 CS101 201701 K. Ross C652123 CS403 201603 K. Ross AStudentSID Lname Fname Major986223 Smith Janet Chemistry362112 Williams Henry Computer Science282712 Jones John English LiteratureWhat would the following SQL Select statement produce for output?select course.Description,registration.SID,registration.grade, student.lnamefrom registrationinner join courseon registration.courseID = course.courseIDinner join student on registration.sid = student.sidSelect one:a.No output, since this query cannot be performedb.Technical Writing 282712 B+ Jonesc.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams Cd.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams CNull 652123 Null A
Solution
The correct answer is c. The SQL Select statement is joining the three tables on the conditions specified (matching CourseID in the Course and Registration tables, and matching SID in the Registration and Student tables). It then selects the Course Description, Student ID (SID), Grade, and Last Name (lname) from the joined tables.
So, the output would be:
Technical Writing 282712 B+ Jones Computer Science I 362112 C Williams
Similar Questions
You are given the following tables:CourseCourseID Description CreditsCS101 Computer Science I 3CS201 Elementary Data Structures 3ENGL210 Technical Writing 3RegistrationSID CourseID SemID Instructor Grade282712 ENGL210 201701 H. Zacny B+362112 CS101 201701 K. Ross C652123 CS403 201603 K. Ross AStudentSID Lname Fname Major986223 Smith Janet Chemistry362112 Williams Henry Computer Science282712 Jones John English LiteratureWhat would the following SQL Select statement produce for output?select course.Description,registration.SID,registration.grade, student.lnamefrom registrationinner join courseon registration.courseID = course.courseIDinner join student on registration.sid = student.sidSelect one:a.No output, since this query cannot be performedb.Technical Writing 282712 B+ Jonesc.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams Cd.Technical Writing 282712 B+ JonesComputer Science I 362112 Williams CNull 652123 Null A
Select the correct answerCourse(course_id,sec_id,semester)Here the course_id,sec_id and semester are __________ and course is a _________.OptionsAttributes, RelationRelations, AttributeTuples, SetTuples, AttributesFinish ClearPrev Next (1)
For the following tables: Student(studentId, studentName, address) ('S01', 'Nguyen Van An', 'Hanoi'), ('S02', 'Pham Tuan Anh', 'Hanoi'), ('S03', 'Nguyen Minh Quan', 'Danang')Result(studentId, subjectId, score) ('S01', 'J01', 8), ('S01', 'S01', 7), ('S02', 'J01', 3)Subject(subjectId, subjectName) ('S01', 'SQL Basics'), ('J01', 'Programming Java'), ('N01', 'Programming C#')and a query: SELECT s.studentName, r.subjectId, r.scoreFROM asql.Student s JOIN asql.Result r ON s.studentId =r.studentIdWhat is the result of the query?Nguyen Van An J01 8Nguyen Van An S01 7Pham Tuan Anh J01 3Nguyen Van An J01 8Nguyen Van An S01 7Pham Tuan Anh J01 3Nguyen Minh Quan NULL NULLNguyen Van An Programming Java 8Nguyen Van An SQL Basics 7Pham Tuan Anh Programming Java 3Nguyen Van An J01 8Pham Tuan Anh J01 3Nguyen Minh Quan NULL NULL
Create a database of students using structures, where in each entry of the database will have the following fields:a name, which is a string with at most 128 characterstheir marks in physics, which is an int between 0 and 100their marks in chemistry, which is an int number between 0 and 100their marks in mathematics, which is an int number between 0 and 100You have to output a list of students in the following order.if a student 'A' has lower marks in physics than a student 'B', then A's data is listed before B.If A and B have the same physics marks and A has lower chemistry marks than B, then A is listed before B.If A and B have the same marks in physics and chemistry, and A has lower marks in mathematics than B, then A is listed before B.If all marks are equal and A's name precedes B's name in the dictionary order, then A is listed before B..Input Format :First line contains the number of students n, where 1<=n<=100.In following n lines each line contains(space separated) a name and their respective marks in physics, chemistry, maths, where 0<=marks<=100.Output Format :Sorted database of n lines.
Identify the command used to retreive all data saved in a table called Student
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.