Question: THIS IS TO BE THE CODE FOR THE BELOW SCRIPT AND QUESTIONS. MYSQL ONLY NOTHING DIFFERENT. I am a beginner and just learning. Thank you

THIS IS TO BE THE CODE FOR THE BELOW SCRIPT AND QUESTIONS. MYSQL ONLY NOTHING DIFFERENT. I am a beginner and just learning. Thank you

1. Type and execute the commands to describe the students, registration and courses tables. Pay attention to the column names. Write a query that displays the student firstname, lastname, course number, and course name for all students taking classes use an INNER Join. Label the output columns Student First, Student Last, Course Number, and Course Name. You should have 7 rows. 17.

2. Modify the query from the previous step to concatenate the student first and last name with a space between and sort the results by lastname, then by coursenumber (both ascending). Change the column names accordingly. Write the query to display the student first and last name, the course number and credit hours. Label the output columns First Name, Last Name, Course , and Credits. Use table aliases.

3. Type and execute the command to display the student last name, and the total number of credits each student is registered for. Use appropriate column headings. You should have 3 rows. 20. (6 points) Modify the previous query to show all students, even if they have not registered for a class. You should have 14 rows. Students who are not registered will show NULL in the output.

Below is the script that goes with the questions that you will find above.

create table students ( Studentid Int not null auto_increment, FirstName varchar( 30 ) not null, LastName varchar( 30 ) not null, Major varchar( 35) null Default 'Undeclared', AdmitDate DateTime null, GradDate DateTime null, Gender char(1) not null, DOB DateTime not null, constraint pk_Students primary key(StudentID) ); create table Courses ( CourseNumber Char(8) not null, CourseName varchar( 40 ) not null, Credits Decimal(2,1) not null, constraint pk_Courses primary key(CourseNumber) ); create table registration ( StudentID Int not null, CourseID char(8) not null, constraint pk_Reg primary key(StudentID, CourseID), constraint fk_Student foreign key(studentid) references students(studentid), constraint fk_courses foreign key(CourseID) references Courses(CourseNumber) ); -- add records to Courses Table Insert into Courses (CourseNumber, CourseName, Credits) values ('INFO1211','Access',2.0), ('INFO1311','Database Concepts', 3.0), ('INFO1511','Advanced Database Concepts',3.0), ('INFO1515','Database Administration', 3.0); -- add records to Students table insert into Students (FirstName, LastName, Major, AdmitDate, GradDate, Gender, DOB) values ('Don','Stark','CIT', '1970-10-04','1979-12-17','m','1939-02-13'), ('Debra Jo','Rupp','Nursing','1968-07-07','1972-12-18','f','1940-05-18'), ('Kurtwood','Smith','CIT','1962-09-15','1967-03-15','m','1935-12-02'), ('Mila','Kunis','broadcast media','1982-09-15',null,'f','1962-06-11'), ('Tanya','Roberts',default,'1973-07-07',null,'f','1941-10-04'), ('Tommy','Chong','pharmacy','1970-10-04','1979-12-17','m','1939-03-28'), ('Lisa Robin','Kelly','cosmotology','1978-03-28',null,'f','1958-10-07'), ('Josh','Meyers','undeclared','1978-10-07','1985-06-28','m','1961-01-05'), ('Danny','Masterson','political science','1981-01-05','1985-09-15','m','1960-04-17'), ('Ashton','Kutcher','criminal justice','1978-04-17','1978-12-19','m','1959-01-15'), ('Topher','Grace','primary education','1980-01-15','1985-06-28','m','1961-08-15'), ('Laura','Prepon','journalism','1980-01-1','1985-06-28','f','1961-11-21'), ('Wilmer','Valderrama','music','1980-01-15','1985-06-30','m','1960-03-17'), ('YourFirst','YourLast','CIT','2008-10-27',null,'x','1987-07-15'); -- add records to the Registration table insert into Registration (StudentID,CourseID) values (1,'INFO1211'), (1,'INFO1311'), (1,'INFO1511'), (2,'INFO1211'), (3,'INFO1211'), (3,'INFO1311'), (3,'INFO1515');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!