0% found this document useful (0 votes)
27 views3 pages

DBMS Lab Report 08 - Ankit Pangeni

Uploaded by

sabin Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

DBMS Lab Report 08 - Ankit Pangeni

Uploaded by

sabin Bhandari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

B.Sc.

CSIT
4 Semester
th

Database Management System: CSC260


Lab-08

OBJECTIVE

TO STUDY AND IMPLEMENT VIEWS

REQUIRED THEORY
In SQL, a view is a virtual table based on the result-set of an SQL statement. A view contains rows and
columns, just like a real table. The fields in a view are fields from one or more real tables in the database.
You can add SQL statements and functions to a view and present the data as if the data were coming from
one single table. A view is created with the CREATE VIEW statement. CREATE VIEW Syntax

CREATE VIEW view_name AS SELECT column1, column2, ... FROM table_name WHERE condition;

Note: A view always shows up-to-date data! The database engine recreates the view, every time a user queries
it.

QUESTIONS
1. Create following table.

i. Department(Did, Dname)

ii. Employee(Eid, Ename, Address, Did)

2. Insert 5 records in above tables.

3. Create a view Location that stores the record of employee who are from Pokhara.

4. Create a view Search_Eid that retrives the record of employee with Eid 13.

5. Create a view Emp_Dept that stores record of EName and DName.

6. Delete the view Emp_Dept.

COMMANDS AND OUTPUTS

Question 1:

Submitted by: Ankit Pangeni, Roll : 04


Question 2:

Question 3:

Question 4:

Submitted by: Ankit Pangeni, Roll : 04


Question 5:

Question 6:

CONCLUSION

Hence, Using MariaDB in Lab, We studied and implemented Views in DBMS.

Submitted by: Ankit Pangeni, Roll : 04

You might also like