I have question regarding creating views as follow this the view of studentflatt
ID: 3730935 • Letter: I
Question
I have question regarding creating views as follow
this the view of studentflatten
this is the view cloumin
USE collage and this the SQL for student
CREATE VIEW StudentFlatten AS
SELECT LastName, FirstName , Email, Sex, DateOfBirth, EnrolledDate, Scholarship, MajorID
FROM student;
Text of your SQL statement
-- ('Ali', 'Alrahem', 'S00879581@acad.tri-c.edu', 'M)
USE college;
SELECT
ID,
CONCAT(LastName, ', ', FirstName) AS 'Name',
department.Name AS 'Major',
Email,
Sex,
DateOfBirth,
EnrolledDate AS 'Enroled',
Scholarship,
MajorID
FROM
studentflatten
LEFT JOIN
department ON studentflatten.MajorID = department.ID
ORDER BY Name
[5] Create a view named NursingStudents that lists all the students who are majoring in Nursing Base this view on the StudentFlatten view. Do not select on the field named Maior,instead,select on the MajorlD. Return all the columns from the StudentFlatten view. Show the view in the Schema window with its columns expanded. Then write a SQL statement to run the view and select only the nursing student with scholarship. Paste it's results into the homework. Then write one or two sentences on why you shouldn't select on name of the major. 5.Explanation / Answer
1. View NursingStudents
*************************************
CREATE VIEW NursingStudents AS
SELECT ID, LastName, FirstName , Email, Sex, DateOfBirth, EnrolledDate, Scholarship, MajorID
FROM
StudenFlatten LEFT JOIN Department ON StudenFlatten.MajorID = Department.ID WHERE Department.Name = 'Nursing';
2. Run StudentFlatten View
******************************************
SELECT * FROM StudentFlatten;
3. Select NursingStudents with Scholarship
*********************************************************
SELECT * FROM NursingStudents WHERE Scholarship != 0;