Saving .sql queries as .sql text file - mysql

Beginner's question: I am learning SQL and the book says 'SQL queries can be created as an SQL script which can be saved as a plain text file with a .sql file extension.' presumably this is done in Notepad but how do I save it as a .sql script please?

To save a file as sql file in notepad - save the file as "yourFile.sql" as in the below picture.
Make sure to select "All Types ." instead of "Normal text file (*.txt)"! Else it will be saved as script.sql.txt.

Related

how to turn a .wpress file to a .sql file and view its contents?

I want to move my wordpress database to cloud sql but I exported the wpress database as a file and its extension is .wpress. How can I change it to a .sql file and view its contents?
I'm not a WordPress developer but I might suggest you export the .wpress data to excel or better still a .csv file
View the data that way or you could import the data back to an SQL database and view from there.

how to upload hindi data using csv file in mysql

CSV file data
database structure
mysql error
data stored
I tried multiple times uploading the data in MySQL database. but still getting the same error and I found multiple solutions for this but I am still getting this issue
invalid column count in CSV input on line 2.
How can I upload CSV file in MySQL database?
Plz help me.
save the .xlsx or xls to CSV (comma delimited) (*.csv) and save .xlsx to Unicode Text (.txt)
Then open .txt file in Notepad
Select and copy the space, replace it with comma
Save the .txt file, by replacing the CSV file in UTF-8 format.
then try to upload this UTF-8 .csv in database table.
It worked for me, hope so it will work for you too.

LOAD CSV command keeps using old file: location, ignores command input

I am using Community edition 3.0.5 on Windows 10 . I made multiple efforts to execute a LOAD CSV command before being told that such files cannot reside on an external drive. When I moved the file to users/user/ and tried to execute the LOAD CSV command I got the same message "Couldn't load the external resource at: file:/F:/Neo4j%20DBs/Data.gov%20Consumer%20Complaints/Consumer%20Complaints%20DB/import/Users/CharlieOh/Consumer_Complaints.csv" in spite of the fact the command I entered was
"LOAD CSV WITH HEADERS FROM
'file:///Users/CharlieOh/Consumer_Complaints.csv' AS line
WITH line
LIMIT 1
RETURN line"
I tried to locate the file neo4j.conf and could only find C:\Program Files (x86)\Neo4j Community 3.2.2\Neo4j Community.install4j\i4jparams.conf . I even deleted the old DB and recreated the small amount of data and got the same error, which seems to indicate that the LOAD CSV function is totally useless across all my neo4j databases. BTW the %20 in the file specification was due to suggestions on Stack Overflow as well as using underscores to avoid any use of blank spaces in the file specification. None of it worked and now that I believe that I may have solved the problem by putting the csv file in the user directory, the LOAD CSV function won't let me do it. One last thing, I am following the YouTube video https://www.youtube.com/watch?v=Eh_79goBRUk to learn how to load a csv file into neo4j.
The csv file needs to go in the import directory of the specific database. With Neo4j Desktop this is easy to identify by clicking on the Manage button of the database and then the open folder button. It looks like you've found it.
Once the database import directory is located, you specify it in the LOAD CSV with the statement LOAD CSV WITH HEADERS FROM 'file:///" + FN + "'where FN is your file name, including the csv extension. You do NOT use the full path; that is assumed.

Why can't I save a file as a csv?

So I downloaded this file off the web and its in CSV format but saved as a txt. It has every thing separated by commas and everything but I am having trouble making it a CSV file. When I go to "save as", to try to save it as a CSV, I don't see the option to save it as a CSV.
It's difficult to answer not knowing what software you are using.
Try to open the file using Microsoft Excel and then save it as CSV.
If Excel won't open it, then copy-paste the data from the text file to a new Excel workbook in top left cell then use the function "Text to Columns" located in the "Data" tab.
The wizard will then help you convert your data from any CSV format which you will then be able to save as CSV file.
Open the CSV file in Notepad. Save as AllFiles, and filename.csv. Now this *.txt file will exist alongside a new file filename.csv in the same directory. Now you can open this csv file in excel. (make sure you choose all files here also otherwise the csv file won't be visible)

CSV File showing random characteristics

I copied a file from my ipad using iFunBox and I tried opened it with:
Microsoft Excel
FreeFileViewer
Notepad
Notepad++
All of them shown nothing File (.csv) Everytime open it using those 4 programmes this is what I get:
] 1 ˆ&ÓMF.¶•J¡ ñßR)åÙ¥e
ò¦Øœsl\V{`¸u°N±vI¦½™êk4“‡-m Ùò¾ˆÚär'²ø¢å:š nàÊ#‹8yH#uä³éc‹übuÙÀÙHIˆ[g¿^¶$9¹asï³`‰;*ý:Ôê]ÓlÆFJŠzÆy l[
†nÒdzÙ› ™uê^ï:—ŽœÏ·`ð€‡°XR…Hù™6è³ß×+¥Û/‹ÐÉÞ‡çååw¿öùr~uóçˆKÝcýœó©û$R0áÓ)`´Á°ŠOŸ¸hÉw”ÕÌ$¾S|åÚ†G¾Ùú¿#/¯J(Ádž‡Úøo䇙ñyŠÃ©A°6ÀÊ¿©þFDBº·SáóDEa±€o¹Nê¦ä~iÿñÍQ‹òÊun¢ç,Æâðe IéŒ
The file seems to be binary and not CSV. CSV is a plain text file which depending on the text encoding may show some strange characters, but mainly plainly readable. The file above is a kind of OMF file, whatever that is.