Jun-30-2020, 08:40 AM
Jun-30-2020, 09:10 AM
You give us very little information. Not knowing what the text file looks like,
the first reaction would be that in order to make requests, you don't need sql.
Simple string operations can do a lot.
paul
the first reaction would be that in order to make requests, you don't need sql.
Simple string operations can do a lot.
paul
Jun-30-2020, 09:46 AM
id |color |number |deleted|year|
-----|-----------|------------|-------|----|
21542|black |В 031 ВХ 138|true |2014|
15694|black |С053КН163 |true |2014|
in the task it is precisely necessary to use SQL queries for data selection.![[Image: 4a7a3c32c76215dd8ffdec8025ae1ac5-full.png]](https://cdn1.radikalno.ru/uploads/2020/6/30/4a7a3c32c76215dd8ffdec8025ae1ac5-full.png)
-----|-----------|------------|-------|----|
21542|black |В 031 ВХ 138|true |2014|
15694|black |С053КН163 |true |2014|
in the task it is precisely necessary to use SQL queries for data selection.
![[Image: 4a7a3c32c76215dd8ffdec8025ae1ac5-full.png]](https://cdn1.radikalno.ru/uploads/2020/6/30/4a7a3c32c76215dd8ffdec8025ae1ac5-full.png)
Jun-30-2020, 11:46 AM
I would read the data using Pandas, and either do the manipulations there or then loop through the Pandas dataframe and post the records into the database. Using the Pandas function read_csv with sep set to '|' and setting header should give you a start.
When you say it is necessary to use SQL, is this homework? Or are you needing the save the data for long term?
When you say it is necessary to use SQL, is this homework? Or are you needing the save the data for long term?
Jun-30-2020, 12:30 PM
I need to upload data from. txt to sql base and make sql queries
Jun-30-2020, 04:28 PM
OK, I explained how I would do it.
Knowing why can be helpful as we try to help you. There may be methods you hadn't thought of. If this is homework where you have been told this must be done with SQL then that's different.
Knowing why can be helpful as we try to help you. There may be methods you hadn't thought of. If this is homework where you have been told this must be done with SQL then that's different.
Jun-30-2020, 05:26 PM
insert into cars (id, color, number, deleted, year) values (21542, 'black', 'В 031 ВХ 138', 'true', 2014);... and so on.