Which of the following statements is true about database views?
💻 sql Snippet
CREATE VIEW Sales_View AS
SELECT empId, empName, Salary
FROM EMPLOYEE
WHERE Dept = 'Sales';
A.A view is always a complete set of all the tables in a database.
B.A view cannot be used for retrieving data.
C.The results of using a view are not permanently stored in the database.
D.Rows cannot be updated or deleted in any view.
Write five advantages of using VIEWS.
💻 sql Snippet
CREATE VIEW Sales_Staff_View AS
SELECT EmpID, EmpName, Dept
FROM EMPLOYEE
WHERE Dept = 'Sales';
Define the concept of Database Views and write down five major advantages of utilizing views in a relational database management system.
💻 sql Snippet
CREATE VIEW Employee_Security_View AS
SELECT empId, empName, empDept
FROM EMPLOYEE
WHERE empDept = 'Sales';
Under standard relational database architectural guidelines, which of the following statements is strictly true about database views?
💻 sql Snippet
CREATE VIEW Active_Teachers AS
SELECT TeacherID, Name, Email
FROM Teacher
WHERE Office = 'F001';
A.A view is always a complete, horizontally and vertically identical replica of all physical tables in a database.
B.A view represents a virtual schema structure and cannot be used by end-users or applications to retrieve data.
C.The data results retrieved using a standard view are not permanently stored as independent tuples in the database.
D.Under no circumstances can individual rows (tuples) be updated, inserted, or deleted through any view structure.
In relational SQL databases, a View is a logical virtual table defined by an underlying SELECT query. Write a SQL DDL command to create a view named 'CS_Students_View' that displays 'stId', 'stName', and 'cgpa' for students whose 'prName' (program name) is 'BSCS' and whose 'cgpa' is greater than or equal to 3.0.
💻 sql Snippet
CREATE VIEW CS_Students_View AS
SELECT stId, stName, cgpa
FROM STUDENT
WHERE prName = 'BSCS' AND cgpa >= 3.0;
Write an SQL Data Definition Language (DDL) command to create a simple database view named 'A_Block_Classes' on the 'Class' table that displays only the 'ClassID', 'CourseCode', and 'Venue' columns, filtering the output specifically for classes scheduled in 'A Block'.
💻 sql Snippet
CREATE VIEW A_Block_Classes AS
SELECT ClassID, CourseCode, Venue
FROM Class
WHERE Venue = 'A Block';
A.CREATE VIEW A_Block_Classes AS SELECT ClassID, CourseCode, Venue FROM Class WHERE Venue = 'A Block';
B.CREATE VIEW A_Block_Classes SELECT ClassID, CourseCode, Venue FROM Class WHERE Venue = 'A Block';
C.SELECT ClassID, CourseCode, Venue INTO VIEW A_Block_Classes FROM Class WHERE Venue = 'A Block';
D.CREATE VIEW A_Block_Classes AS SELECT * FROM Class HAVING Venue = 'A Block';