SQLs DML And DDL Flashcards
How do we insert data in SQL?
INSERT
Add list of attributes to relation name
Can insert entire result of query into relation
How do we delete data in SQL?
DELETE
Deletes tuples satisfying condition or deletes all
How do we update data in SQL?
UPDATE
Change certain attributes in certain tuples
How does the DDL of SQL work?
Database schema comprises declarations for relations of database
What are the elements of the table declaration in DDL for SQL?
Integer
Float
Char
Varchar
How do we view data in SQL?
View = virtual table = relation defined in terms of other tables
What is a base table?
Relation whose value is really stored in the database
How do you use a VIEW?
Interprets query as if base table
Definition of VIEWS used by a query are replaced by algebra
What is DMBS optimisation?
Optimises algebraic expression
Pushes selections down tree
Eliminates unnecessary projections