SQLs DML And DDL Flashcards

1
Q

How do we insert data in SQL?

A

INSERT
Add list of attributes to relation name
Can insert entire result of query into relation

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

How do we delete data in SQL?

A

DELETE

Deletes tuples satisfying condition or deletes all

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

How do we update data in SQL?

A

UPDATE

Change certain attributes in certain tuples

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

How does the DDL of SQL work?

A

Database schema comprises declarations for relations of database

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

What are the elements of the table declaration in DDL for SQL?

A

Integer
Float
Char
Varchar

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

How do we view data in SQL?

A

View = virtual table = relation defined in terms of other tables

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

What is a base table?

A

Relation whose value is really stored in the database

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

How do you use a VIEW?

A

Interprets query as if base table

Definition of VIEWS used by a query are replaced by algebra

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

What is DMBS optimisation?

A

Optimises algebraic expression
Pushes selections down tree
Eliminates unnecessary projections

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