Create the following queries on the ITCO630_A database used in Unit 3 and save t
ID: 3907345 • Letter: C
Question
Create the following queries on the ITCO630_A database used in Unit 3 and save them all in a file called ITCO630_P5.SQL. Please note that you can execute individual queries in a query file by highlighting the lines that you want to execute before running the script. Remember to define what database to use with a USE statement. Complete the following: Using a join, get the full details of all the students who work on the mid-term exam assignment. Get the assignment names (duplicates eliminated) being worked on by students at Central University. Get the last names of all the students who are working on assignment A1. Get the student numbers and start dates of all the students with start dates equal to the earliest date. Insert yourself into the student table using the last five digits of your phone number as the student number and show yourself as attending Central University. Then show all the records in the student table. Delete yourself from the student table by matching your student number, and then show all the records in the student table. You should create a zip file called ITCO630_P5.ZIP with your query file (ITCO630_P5.SQL) included.
Explanation / Answer
If you have any doubts, please give me comment...
-- get the full details of all the students who work on the mid-term exam assignment.
SELECT S.*
FROM Student S, Summary S1, Assignment A
WHERE S.student_no = S1.student_no AND S1.assignment_no = A.assignment_no AND assignment_no = 'Mid-term Exam';
-- Get the assignment names (duplicates eliminated) being worked on by students at Central University.
SELECT assignment_name
FROM Assignment;
-- Get the last names of all the students who are working on assignment A1.
SELECT S.student_lname
FROM Student S, Summary S1
WHERE S.student_no = S1.student_no AND S1.assignment_no = 'A1';
-- Get the student numbers and start dates of all the students with start dates equal to the earliest date.
SELECT S.student_no, start_date
FROM Student S, Summary S1
WHERE S.student_no = S1.student_no AND S1.start_date = (
SELECT MIN(start_date)
FROM Summary S1
);
-- Insert yourself into the student table using the last five digits of your phone number as the student number and show yourself as attending Central University. Then show all the records in the student table.
INSERT INTO Student Values(25348, 'John', 'Doe', 'S3');
SELECT * FROM Student;
-- Delete yourself from the student table by matching your student number, and then show all the records in the student table.
DELETE FROM Student WHERE student_no = '25348';
SELECT * FROM Student;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.