Brook Bisrat
Brook Bisrat

Reputation: 1

Understanding specifics of postgresql/sql

I am a total noob, but have a few questions. I have Pgadmin/postgresql on my computer and know how to write a few queries, however what I don't know is:

  1. When I write these schema's and they get saved to my computer is this the same thing as a SQL Server or SQL Database.

2.This might be stupid as well, but my company has a sql server that's never been used. I was told to download mysql "locally" first and then use it in a "production environment". I think I sort of understand that, but I really don't fully understand what that means.

2a. Could I then just connect the pgadmin directly to the sql server?

3.So if I have data coming in via csv/excel files how do I make it so that everything updates? So for example if I am looking at bike sales from 2014 to present and then Jan 1 more bike sales come in, does postgresql update this for me after I have created the files?

4.Would there be a better way to keep this data store running optimately/automatically.

I know these are alot of questions but I really appreciate the help.

Upvotes: 0

Views: 127

Answers (1)

Mike Christensen
Mike Christensen

Reputation: 91600

  1. A SQL database is a generic term for any relational database system that can allow the user to interact with the data using SQL (a standardized language used to query and manipulate data). Be sure not to confuse this with "Microsoft SQL Server" which is a brand of database software. Other products would be Oracle, PostgreSQL, mySQL, DB2, etc. There's also plenty of database servers that do not use SQL, but some other query language.

  2. mySQL is another type of database server, which also uses SQL just like PostgreSQL. It's known to be fairly light weight and simple, which is why a lot of people start out using it. I think your work is just telling you to install it locally so you don't need to worry about installing it on some other computer and provisioning resources for this purpose.

2a. You cannot connect pgAdmin to mySQL. pgAdmin is the client software that lets you connect to a local or remote PostgreSQL server. Different database servers use different protocols and drivers to communicate with clients. There are, however, general clients that can connect to multiple brands of databases. Some examples are Aqua Data Studio or ApexSQL.

  1. Postgres has the ability to import data from a CSV file into a table providing the schemas match. You can do something like:

    COPY sales FROM 'bikesales.csv' DELIMITER ',' CSV;

However, you would need to import the data again if it changed. I don't know of any mechanism to sync data between a database and CSV file whenever the data changes.

  1. The entire point of a database is to keep a record of all data. When data changes, you should update the database directly. If your sales data has to be in the form of a CSV file, you would need to implement some process that takes new sales and imports them into your database using some sort of automated task. You might be able to use something like pgAgent for this.

Hope this is at least somewhat helpful!

Upvotes: 1

Related Questions