CS257 Software Design Friday, 14 October 2022 0. Some code review reports still missing - If your partner submitted feedback on your behalf, I don't know that unless you tell me 1. What questions are bugging you here at midterm? - Jamboard link is in #announcements - Think about it, talk about it, post - Any topic: SQL, postgres, command-line args, Unix, testing, etc. etc. === What's up with the %% in psycopg2-sample.py? === query = '''SELECT given_name, surname FROM authors WHERE surname ILIKE CONCAT('%%', %s, '%%')''' In SQL surname LIKE 'Br%' -- % is a wildcard character this will match all three Brontes, etc., but not Abramovich surname ILIKE 'br%' -- case-insensitive still matches Brontes, but not Abramovich surname ILIKE '%br%' -- all Brontes, Abramovich, etc. In Python I want ... WHERE surname ILIKE '%whatever-the-user-asked-for%' ===== Difference between SQL and psql ===== - The Structured Query Language is a language for articulating requests for a database (search, modify a table, insert data, change data,...) - postgresd is a server program that waits for SQL requests from a client program and executes those requests - psql is - a client that sends requests to postgresd - a prompt-based user interface for that client ===== Final project: "full-stack web application" ===== - partner survey includes pick-your-own-partner - pick a dataset, design database what features would a user of a website for this data want? mock up a user interface implement a web-based user interface writing server code to extract data from the database and send it to the browser etc. 2. Homework plan - Fix up your database design and convert.py if you think it would help you - Design simple command-line interface (CLI) - Implement the CLI with stubs for the operations - Plunder code from my samples to use your SQL queries to implement the database lookups