1 / 16

Moving SQL Data Across Applications

Moving SQL Data Across Applications. How do you export and import data into or out of a database? What do we mean by .csv?. About moving data. First, a few definitions…. The CSV (Comma delimited) file format batting.csv Text files (ASCII) pitching.txt HTML files Batting.html.

Download Presentation

Moving SQL Data Across Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Moving SQL Data Across Applications How do you export and import data into or out of a database? What do we mean by .csv? CS 105 Spring 2010

  2. CS 105 Spring 2010

  3. About moving data. First, a few definitions… • The CSV (Comma delimited) file format • batting.csv • Text files (ASCII) • pitching.txt • HTML files • Batting.html CS 105 Spring 2010

  4. Moving data into SQLyog from the Web • Import data from author’s website: • http://www.forta.com/books/0672321289/ • Then use WinZip, and you have text scripts: CS 105 Spring 2010

  5. First, run the “create tables” scriptsJust paste them into a query CREATE TABLE Customers ( cust_id CHAR(10) NOT NULL, cust_name CHAR(50) NOT NULL, cust_addressCHAR(50) , cust_city CHAR(50) , cust_state CHAR(5) , cust_zip CHAR(10) , cust_country CHAR(50) , cust_contact CHAR(50) , cust_email CHAR(255) ); CS 105 Spring 2010

  6. Then, select one table,and run its “populate” script…paste it into a query INSERT INTOCustomers (cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) VALUES ('1000000001', 'Village Toys', '200 Maple Lane', 'Detroit', 'MI', '44444', 'USA', 'John Smith', 'sales@villagetoys.com'); ‘etc. CS 105 Spring 2010

  7. Transfer complete CS 105 Spring 2010

  8. Moving data from SQLyog to Access • Usually .csv files are the easiest way. • Every piece of software has its own peculiarities—be flexible CS 105 Spring 2010

  9. Choose .csv Data • This action saves the data in a file (csv means comma-separated-values) CS 105 Spring 2010

  10. What does it look like now? • Each record is on its own line • Commas separate each field in each record CS 105 Spring 2010

  11. Importing the data into Access (or any other database) • Most databases allow you to import raw files as long as there is something to delineate the columns. • With Access, create a new database but do not enter any data. CS 105 Spring 2010

  12. Choose type of data that you will import CS 105 Spring 2010

  13. Access automatically creates the columns CS 105 Spring 2010

  14. You tell the database whatdata types, constraints, names you want CS 105 Spring 2010

  15. Now you are all set: CS 105 Spring 2010

  16. To Summarize: • How do you export and import data into or out of a database? • What does .csv stand for? link to importing demo film CS 105 Spring 2010

More Related