SQL Multiple choices


Total available count: 51
Subject - Databases
Subsubject - SQL

What is a View in SQL?


 

 

 

 



B


Solution:-

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. You can add SQL functions, WHERE, and JOIN statements to a view and present the data as if the data were coming from one single table.

The basic CREATE VIEW syntax is as follows:

CREATE VIEW view_name AS SELECT column1, column2.....FROM table_nameWHERE [condition];

Following is an example to create a view from the SLIGHTBOOK table. This view would be used to have a SLIGHTBOOK courseid, course, and duration from the SLIGHTBOOK table.

CREATE VIEW SLIGHTBOOK_VIEW AS SELECT courseid, course, duration FROM ?SLIGHTBOOK;


Now, you can query SLIGHTBOOK_VIEW in a similar way as you query an actual table. Following is an example of the same,

SELECT * FROM SLIGHTBOOK_VIEW;

 




Next 5 multiple choice(s)

1

What is the use of Cross Join in SQL?

2

What is the use of Full Join in SQL?

3

What are the properties of a transaction in SQL?

4

Which is not the properties of a transaction in SQL?

5

What is the use of Session Control Statement(SCS) in SQL?

Comments