I created some tables in SQL, for example:
CREATE TABLE Courses(
CourseNo INTEGER CHECK(100<=CourseNo AND CourseNo<=999) PRIMARY KEY,
Title VARCHAR(100) NOT NULL,
)
I have to make an instance of this table which means I have to import some data from a .txt file into the table shown above. How can I do this? Is there a button in the SQL software to help me achieve this goal? Or do I have to use any codes like “INSERT” to import the file into my table?
if you are using MySQL, you must format your files with commas separating each field and a carriage return (end of line) at the end of each record. then you must save your TXT file as CSV (replace txt with csv).
open phpmyadmin, choose your DB, choose your table and click on IMPORT. choose the file and change the format from SQL to CSV