Question: SQL SERVER 2016 SQL server only plz 1.Create a database called University 2.Create the student table shown in the example, but only specify the StudentName
SQL SERVER 2016 SQL server only plz
1.Create a database called University
2.Create the student table shown in the example, but only specify the StudentName column and dont specify any primary key). Dont add any data yet. Refresh the database so the new table appears. Verify that it only has one column (called Student Name).
3.Add a new column to the Student Table called StudentID withouthaving to delete the table and start from scratch.
4.Add a primary key constraint to the Student table for the newly added StudentID column withouthavingto delete the table and start from scratch.
5.Write the 4 insert statements needed to put the sample data shown in the example into the Studenttable.
6.Change the name of the StudentName column to LastName
.7.Add a column called FirstName to the Student table. Give it the same data type as the LastName column. Refresh the database so the table updates take place. Verify that your changes have been successfullymade.
8.Write 4 record updating statements to give each student in the Student table a first name. Just make up a reasonable (and different) first name for each student. HINT: Dont forget to properly specify yourWHERE clause!
9.Add a new column to the Student table called FullName. It should be at least twice the length of the LastName column.
10.Write ONE update statement that will set the value of the FullName colum to be a combination of the last name and the first name using this type of format: LastName, FirstName (i.e., Polk, Tom). Refresh thedatabase so the table updates take place. Verify that your changes have been successfully made.
11.Create the Faculty table as shown in the example. Specify the primary key as part of your table creation. Dont worry about the data at this point.
12.Create the Course table as shown in the example. Specify the primary key as part of your table creation. Dont worry about the data at this point. Refresh the database so the table updates take place. Verify that your changes have been successfully made.
13.Create the Qualified table as shown in the example. Specify the compound primary key as part of your table creation and also specify the foreign keys. Specify the foreign leys such that, if a faculty member is deleted, any records in this table are also deleted. Dont worry about the data at this point.
14.Create the Section table as shown in the example. Specify the compound primary key as part of your table creation and also specify the foreign key. Dont worry about the data at this point.
15.Create the Registration table as shown in the example. Specify the compound primary key as part of yourtable creation and also specify the foreign keys. Dont worry about the data at this point. Refresh thedatabase.
16.Insert data as shown in the example into all of the tables. You can do this either via INSERT statements or you can use the SQL Server GUI (just right click on a table name and select Edit Top 200 Rows).
17.Type in the following code and execute it:
SELECT Student.FullName, Course.CourseID, Course.CourseName, Section.SectionNo, Section.SemesterFROM Student JOIN Registration ON Student.StudentID = Registration.Student IDJOIN Section ON Registration.SectionNo = Section.SectionNoJOIN Course on Section.CourseID = Course.CourseIDWhat do you see?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
