การส่งข้อมูลกลับเข้าฐานข้อมูล

การประมวลผลข้อมูลบน Command Line

Susan Sun

Data Person

csvsql: เอกสารอ้างอิง

csvsql:

  • รัน SQL statements โดยตรงบนฐานข้อมูล
  • รองรับทั้งการสร้างตารางและการแทรกข้อมูล

อาร์กิวเมนต์เพิ่มเติม:

  • --insert
  • --db
  • --no-inference & --no-constraints
การประมวลผลข้อมูลบน Command Line

csvsql: การส่งข้อมูลกลับเข้าฐานข้อมูล

ตัวอย่างไวยากรณ์:

csvsql --db "sqlite:///SpotifyDatabase.db" \
       --insert Spotify_MusicAttributes.csv

หมายเหตุ:

  1. ใช้ line break เพื่อให้โค้ดอ่านง่ายขึ้น

  2. ใช้ slash สามตัวเพื่อเริ่มต้นชื่อฐานข้อมูล

  3. ลงท้ายด้วยนามสกุลไฟล์ .db สำหรับฐานข้อมูล SQLITE

การประมวลผลข้อมูลบน Command Line

csvsql: การส่งข้อมูลกลับเข้าฐานข้อมูล

ตัวอย่างไวยากรณ์:

csvsql --db "sqlite:///SpotifyDatabase.db" \
       --insert Spotify_MusicAttributes.csv

เอกสารอ้างอิง:

csvsql -h
--insert  In addition to creating the table, also insert the
          data into the table. Only valid when --db is specified.
การประมวลผลข้อมูลบน Command Line

csvsql: การส่งข้อมูลกลับเข้าฐานข้อมูล

ตัวอย่างไวยากรณ์:

csvsql --no-inference --no-constraints \
       --db "sqlite:///SpotifyDatabase.db" \
       --insert Spotify_MusicAttributes.csv

เอกสารอ้างอิง:

csvsql -h
--no-inference   Disable type inference when parsing the input.
--no-constraints Generate a schema without length limits or null checks.
การประมวลผลข้อมูลบน Command Line

มาฝึกกันเถอะ!

การประมวลผลข้อมูลบน Command Line

Preparing Video For Download...