CPSC 531 - Advanced Databases - Fall 2019
RDBMS and Database
The database is Luis Rocha’s Chinook Database, modified for use with Python.
Platforms
You may use any platform to develop and test your code, but note that per the Syllabus the test environment for projects in this course is a Tuffix 2019 Edition r2 Virtual Machine with Python 3.6.8. It is your team’s responsibility to ensure that your code runs on this platform.
Loading the Database
Download the database file Chinook_Python.py and place it in directory where you will develop your Python code. The database can be loaded with the following command:
from Chinook_Python import *
You will find variables named Artist, Album, Customer, etc. containing sets of namedtuple objects.
Note: an earlier version of Chinook_Python.py did not export the InvoiceLine relation by default. You can import it explicitly (e.g., from Chinoook_Python import InvoiceLine), or use the link above to download an updated version.
Relational Operators
Implement the following functions in Python:
The predicate for select() should be a function that takes a single namedtuple as an argument and returns True or False.
The predicate for theta_join() should take two namedtuples and return a bool.
The new_columns and new_relation parameters to rename() are optional. if neither argument is provided, return the original relation.
Extra Credit
Implement natural_join(relation1, relation2).
Queries
The file queries.py contains four variations of the first query from Project 1:
All of the queries above should return the following set:
{Result(Title='Blood Sugar Sex Magik'),
Result(Title='By The Way'),
Result(Title='Californication')}
When the relational operators are implemented and the queries above work correctly, write code to run the last query from Project 1.
Performance Measurement
As a rough approximation of the processing required for each query, instrument your functions to measure the cardinality of the result set for each relational operator. When a query completes, print the total number of tuples returned during processing.
Python Tips
If you are new to Python, see A Whirlwind Tour of Python.
You may find the following useful:
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme