views_flashcards

1
Q

What is a view in SQL?

A

A virtual table based on the result-set of an SQL statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you create a view in SQL?

A

Using CREATE VIEW view_name AS SELECT …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Can a view be used in queries like a regular table?

A

Yes, it can be queried as if it were a table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Are views stored physically in the database?

A

No, views are definitions saved; their result is generated on the fly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the benefits of using views?

A

Security, abstraction, and simplified query expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an un-updatable view?

A

A view that includes joins or aggregates and cannot be directly updated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you update a view?

A

Only simple views on a single table without aggregates are usually updatable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the WITH CHECK OPTION do in views?

A

Ensures that all updates and inserts satisfy the view’s WHERE clause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly