Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this our tables are csv files. What would the python code look like to query these tables? Command-lin face to query data that is

For this our tables are csv files. What would the python code look like to query these tables? image text in transcribed
image text in transcribed
Command-lin face to query data that is stored in a database 1. Obtaindata suitable for a relational database e the data should map to at least two RLDB tables . one of the tables should have a foreign key to the other table pick data that will have at least thirty records in each database table each table should have at least three columns For example: US states and cities: STATE TABLE id name capital_ city (foreign key to the id column of the city table) CITY TABLE id name population state_name (foreign key to the id column of the state table) Other possibilities might be sports teams, songs/performers, animals/habitats 2. build a program that will connect to an SQLite database and let you query the data Provide a primitive command-line interface to query data from the database you'll let the user type in a command * you'll parse it and turn it into a query for the database you'll execute the query and print the results For example >capital Massachusetts Boston population state Massachusetts 6859819 > population city Boston 617594 An expert answer will be posted here Window Help Annotate TI Edit -up-description CH 04 Essentials Of Software En OTO 7855 the "grammar you create can have hard-coded tokens that are specific to your data (the way my example uses "state", "city, "population", "capital" but each "sentence" you type should turn into a database query that returns one or more results Assume that the database has already been created (it's not necessary to provide commands to create the database or the tables in the database) But, do provide a command that will let a user see the schema (the list of tables in the database, and the names of the columns in each table). General discussion . you should create your database on "localhost" that way all team members can get the program up and running on their own laptops with squlite3 and sqlite make this easy command that doesn't follow your legal syntax), then the program should tell me (and not crash OK to hardcode table names, column names in your code you can choose whatever database and language you want, but Java with JDBC and sqlite and pythor . your program should be robust: if I put in a command that the program doesn't understand (i.e,a the data should come from a file (eg, csv) e Specifics Your system should allow a user to query values from at least three columns of each table. You should support at least one query that involves a join between the two tables What to hand in

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions