Given the following schemas for a student record: STUDENTS (student_id, student_name, region) COURSES (course_id, course_name, subject_type, lecturer_name) RESULTS (student_id, course_id, score, result_status) STUDENTS relation shows the information of the students. The COURSE relation specifies the course details. The RESULTS relation lists the scores that students obtain for each course taken. *Please execute this SQL codes for creating the table schemas mentioned above, Then execute the tasks in the table accordingly using proper SQL queries and Write your answer into the Answer Template CREATE TABLE STUDENTS (student_id VARCHAR(10) PRIMARY KEY, student_name VARCHAR(150), region VARCHAR(50)); CREATE TABLE COURSES (course_id VARCHAR(10) PRIMARY KEY, course_name VARCHAR(150), subject_type VARCHAR(50), lecturer_name VARCHAR(150)); CREATE TABLE RESULTS (student_id VARCHAR(10), course_id VARCHAR(10), score NUMBER, result_status VARCHAR(20), CONSTRAINT pk_results PRIMARY KEY (student_id, course_id), CONSTRAINT fk_results_student FOREIGN KEY (student_id) references STUDENTS(student_id), CONSTRAINT fk_results_courses FOREIGN KEY (course_id) references COURSES(course_id)); Tasks: ++Insert the data into the three relations STUDENTS, COURSES, and RESULTSaccording to the data given below: Table 1: STUDENTS relation student_id student_name region 67540 Anas Forrest Florida 87543 Edie Johnston Washington 98560 Haley Hibbert Arizona 54870 Lorenzo Whitney Washington 76590 Kate Wood Washington Table 2: COURSES relation course_id course_name subject_type lecturer_name 786 Science Math Maggie 764 Education Drawing Maggie 579 Engineering Digital Mary 787 Engineering Math Jude Hoffman Table 3: RESULTS relation student_id course_id score result_status 76590 579 80 Good 54870 786 76 Good 87543 787 69 Good 76590 787 60 Average 67540 764 90 Good 67540 786 79 Good 87543 764 50 Failed   Question SQL Statement ++Insert the data into the three relations STUDENTS, COURSES, and RESULTS according to the data given   List the course_id and the score   In RESUTLS relation, list only the result_status, student id, and the score for those who get “good” and “average” results.   Show the student id who score more than 75 marks.   A new joint staff Gary will take over the Drawing subject in Education course (course ID: 764). Update the information of the course accordingly   List the lecturer names that teach Engineering course   Show the list of students who originate from Washignton   List the course_id and score from the RESULTS   List the students who get the score between 50 – 70   List the lecturer names that consists of the letter ‘r’ in the third letter   List the information (student_id and course_id) for the students who take the course of Science Math (course_id: 786) and Engineering Math (course_id: 787)

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 5MC
icon
Related questions
icon
Concept explainers
Question
100%

Course: Database

Given the following schemas for a student record:


STUDENTS (student_id, student_name, region)
COURSES (course_id, course_name, subject_type, lecturer_name)
RESULTS (student_id, course_id, score, result_status)

STUDENTS relation shows the information of the students. The COURSE relation specifies the course details. The RESULTS relation lists the scores that students obtain for each course taken.

*Please execute this SQL codes for creating the table schemas mentioned above, Then execute the tasks in the table accordingly using proper SQL queries and Write your answer into the Answer Template

CREATE TABLE STUDENTS (student_id VARCHAR(10) PRIMARY KEY, student_name VARCHAR(150), region VARCHAR(50));

CREATE TABLE COURSES (course_id VARCHAR(10) PRIMARY KEY, course_name VARCHAR(150), subject_type VARCHAR(50), lecturer_name VARCHAR(150));

CREATE TABLE RESULTS (student_id VARCHAR(10), course_id VARCHAR(10), score NUMBER, result_status VARCHAR(20), CONSTRAINT pk_results PRIMARY KEY (student_id, course_id), CONSTRAINT fk_results_student FOREIGN KEY (student_id) references STUDENTS(student_id), CONSTRAINT fk_results_courses FOREIGN KEY (course_id) references COURSES(course_id));

Tasks:

++Insert the data into the three relations STUDENTS, COURSES, and RESULTSaccording to the data given below:

Table 1: STUDENTS relation

student_id student_name region
67540 Anas Forrest Florida
87543 Edie Johnston Washington
98560 Haley Hibbert Arizona
54870 Lorenzo Whitney Washington
76590 Kate Wood Washington

Table 2: COURSES relation

course_id course_name subject_type lecturer_name
786 Science Math Maggie
764 Education Drawing Maggie
579 Engineering Digital Mary
787 Engineering Math Jude Hoffman

Table 3: RESULTS relation

student_id course_id score result_status
76590 579 80 Good
54870 786 76 Good
87543 787 69 Good
76590 787 60 Average
67540 764 90 Good
67540 786 79 Good
87543 764 50 Failed

 

Question

SQL Statement

++Insert the data into the three relations STUDENTS, COURSES, and RESULTS
according to the data given

 

List the course_id and the score

 

In RESUTLS relation, list only the result_status, student id, and the score for those who get “good” and “average” results.

 

Show the student id who score more than 75 marks.

 

A new joint staff Gary will take over the Drawing subject in Education course (course ID: 764). Update the information of the course accordingly

 

List the lecturer names that teach Engineering course

 

Show the list of students who originate from Washignton

 

List the course_id and score from the RESULTS

 

List the students who get the score between 50 – 70

 

List the lecturer names that consists of the letter ‘r’ in the third letter

 

List the information (student_id and course_id) for the students who take the course of Science Math (course_id: 786) and Engineering Math (course_id: 787)

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr