CSci 275 TDA Part 4: Queries and Views
Due: Thursday, April 14th.
In this part of the team project, you will write queries and create views for your database.
- (15 points)
Write at least six queries on your TDA database, using the select-from-where construct of SQL.
Each team member must have responsibility for at least two of these queries.
(Please indicate these responsibilities on the group deliverable.)
To receive full credit, all of your queries should exhibit some interesting feature of SQL:
queries over more than one relation, or sub-queries, for example.
Turn in a copy of all of your SQL queries, along with a script illustrating their execution.
Your script should be sufficient to convince the grader that your commands run successfully.
Please do not, however, turn in query results that are too long!
You may use "FETCH FIRST n ROWS ONLY" or some variation if necessary.
- (15 points)
Write at least six data modification commands on your TDA database.
Again, each team member must be assigned responsibility for at least two of these commands.
These commands should be "interesting," in the sense that they involve some complex feature,
such as inserting the result of a query, updating several tuples at once,
or deleting a set of tuples that is more than one but less than all the tuples in a relation.
Hand in a script that shows your modification commands running in a convincing fashion.
- (10 points)
Create at least two views on top of your database schema.
Show your CREATE VIEW statements and the response of the system.
Also, show a query involving each view and the system response
(but truncate the response if there are more than a few tuples produced).
Finally, show a script of what happens when you try to update your view,
say by inserting a new tuple into it.
Is either of your views updatable? Why or why not?