Im working with several .csv files and im not sure how to decide what needs to be primary keys or foreign keys and referencing them in my python code on visual studio code
Added by Adam B.
Step 1
csv files. Look for common attributes or fields that can be used to link the files together. Show more…
Show all steps
Your feedback will help us improve your experience
Supreeta N and 70 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Create a solution that accepts an input identifying the name of a CSV file, for example, "input1.csv". Each file contains two rows of comma-separated values. Import the built-in module csv and use its open() function and reader() method to create a dictionary of key:value pairs for each row of comma-separated values in the specified file. Output the file contents as two dictionaries. The solution output should be in the format {key:value,key:value,key:value} {key:value,key:value,key:value}
Supreeta N.
Create a Python dictionary that returns a list of values for each key. The key can be whatever type you want
Willis J.
You will design a program that manages the inventory of an electronics store. You will need to use a number of concepts that you learned in class, including the use of classes, dictionaries, and input and output of comma-delimited CSV files. Input: a) ManufacturerList.csv - contains items listed by row. Each row contains item ID, manufacturer name, item type, and optionally a damaged indicator. b) PriceList.csv - contains items listed by row. Each row contains item ID and the item price. c) ServiceDatesList.csv - contains items listed by row. Each row contains item ID and service date. Example ManufacturerList.csv, PriceList.csv, and ServiceDatesList.csv are provided for reference. Your code will be expected to work with any group input files of the appropriate format. Manufacturers can and will likely be different, as will the actual items. Required Output: Processed Inventory Reports: a) FullInventory.csv - all the items listed by row with all their information. The items should be sorted alphabetically by manufacturer. Each row should contain item ID, manufacturer name, item type, price, service date, and a list if it is damaged. The item attributes must appear in this order. b) ItemTypeInventory.csv - there should be a file for each item type, and the item type needs to be in the file name. Each row of the file should contain item ID, manufacturer name, price, service date, and a list if it is damaged. The items should be sorted by their item ID. c) PastServiceDateInventory.csv - all the items that are past the service date on the day the program is actually executed. Each row should contain item ID, manufacturer name, item type, price, service date, and a list if it is damaged. The items must appear in the order of service date from oldest to most recent. d) DamagedInventory.csv - all items that are damaged. Each row should contain item ID, manufacturer name, item type, price, and service date. The items must appear in the order of most expensive to least expensive.
Akash M.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD