Talk:Ben Baldazo (Work Log)
Jump to navigation
Jump to search
Proposal for general timeline / overview / structure / etiquette of projects
Creating Folders and SQL
Regarding Folders and SQL database creation:
- Create a folder in the Z: Drive that has the same name as the PSQL database
- Create a PSQL database that is all lowercase and has no spaces (the shorter the better) (Help:Access RDP Sever)
- Create a ".sql" file named <databasename>.sql and save it in your project folder in the E: Drive in a new folder named <databasename>_SQL
- create a ".txt" file in this SQL folder in the E: Drive named <databasename>SQL_notes.txt
- Every time you create a new table in your database, document it here in the notes file
- This means put "table title : a short description of your table" for each new one you create
- It should look like this:
database name tables: <tablename> : Uploaded from text file with data on the VC round amounts into companies *optional comment on work this table needs or the state it's in <tablename> : Uploaded from text file with data on the VC round amounts into companies *optional comment on work this table needs or the state it's in
Regarding your database.sql file (etiquette and notation):
- This ".sql" file is where you are going to write and save all of your code (you copy it out of here then paste it into terminal or putty to run it)
- Every time you create a table, precede the command with a "drop table" command with the table you are about to make
- This way you will be able to just copy and paste the entirety of your code into your database should you need to recreate it
- Every time you create a table put "--<# of entries>" in the line under your code so we can keep track of the number of rows in each table within your code file
- anytime you want to comment on a table use "/* comment */" in your .sql file
- It should look like this:
DROP TABLE <tablename>; CREATE TABLE <tablename> ( <Column1> <datatype1>, <Column2> <datatype2>, <Column3> <datatype3>, <Column4> <datatype4> ); \COPY <tablename> FROM '<tab_delineated_file>.txt' WITH DELIMITER AS E'\t' HEADER NULL AS CSV --##### <--this is the number of entries /* If you would like to add a comment afterwards, it should be notated like this */
Compustat
Website: https://wrds-web.wharton.upenn.edu/wrds/ds/compm/funda/index.cfm?navId=84
- Select search entire database
- Pass: 9Mil2015
- User: mcnair