Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
SQL Assignment Table: student _ info Table: course _ infoQuestions: Create the student _ course _ enrollment table using SQL . ( 1 . 0
SQL Assignment Table: studentinfo Table: courseinfoQuestions: Create the studentcourseenrollment table using SQL Marks Insert the studentcourseenrollment data from the above picture. Marks Retrieve the names and ages of students majoring in "Biology" Marks Calculate the average age of students majoring in "Physics" Marks Retrieve the unique names of the courses from the courseinfo table Marks Instructions: Go to https:sqliteonlinecom and connect MS SQL to start writing queries. File Format: You must have to include the SQL Query and Output of that query Like this format. SQLASSIGNMENTQUERY.SQL File with Question Number, Query and Query Output Screenshot of the Query and Output in Word Document Table: studentcourseenrollment The creation of the studentinfo and courseinfo tables, along with the data insertion queries, can be found in the attached SQL file named studentandcoursetablecreateanddatainsert.sql or in the code snapshot. Create the studentinfo table CREATE TABLE studentinfo StudentID INT PRIMARY KEY, Name VARCHAR Age INT, Major VARCHAR ; Insert data into the studentinfo table INSERT INTO studentinfo StudentID Name, Age, Major VALUES 'Alice', 'Biology' 'Bob', 'History' 'Carol', 'Math' 'David', 'Physics' 'Emily', 'Biology' 'Frank', 'Physics'; Create the courseinfo table CREATE TABLE courseinfo CourseID INT PRIMARY KEY, CourseName VARCHAR Instructor VARCHAR ; Insert data into the courseinfo table INSERT INTO courseinfo CourseID CourseName, Instructor VALUES 'Biology Dr Smith' 'History 'Prof. White' 'Math 'Prof. Green' 'Physics Dr Brown';
SQL Assignment
Table: studentinfo
Table: courseinfoQuestions:
Create the studentcourseenrollment table using
SQL
Marks
Insert the studentcourseenrollment data from the above
picture.
Marks
Retrieve the names and ages of students majoring in "Biology"
Marks
Calculate the average age of students majoring in
"Physics"
Marks
Retrieve the unique names of the courses from the courseinfo
table
Marks
Instructions:
Go to
https:sqliteonlinecom and connect MS SQL to start writing
queries.
File Format:
You must have to include the SQL Query and Output of that query
Like this format.
SQLASSIGNMENTQUERY.SQL File with Question
Number, Query and Query Output
Screenshot of the Query and Output in Word Document
Table: studentcourseenrollment
The creation of the studentinfo and courseinfo tables, along with the
data insertion queries, can be found in the attached SQL file named
studentandcoursetablecreateanddatainsert.sql or in the code
snapshot.
Create the studentinfo table
CREATE TABLE studentinfo
StudentID INT PRIMARY KEY,
Name VARCHAR
Age INT,
Major VARCHAR
;
Insert data into the studentinfo table
INSERT INTO studentinfo StudentID Name, Age, Major
VALUES
'Alice', 'Biology'
'Bob', 'History'
'Carol', 'Math'
'David', 'Physics'
'Emily', 'Biology'
'Frank', 'Physics';
Create the courseinfo table
CREATE TABLE courseinfo
CourseID INT PRIMARY KEY,
CourseName VARCHAR
Instructor VARCHAR
;
Insert data into the courseinfo table
INSERT INTO courseinfo CourseID CourseName, Instructor
VALUES
'Biology Dr Smith'
'History 'Prof. White'
'Math 'Prof. Green'
'Physics Dr Brown';
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started