Problems installing pyperclip module for python. Not recognised as a module.
Not able to install it from command line. Resolved by running pip install pyperclip by running command line as administrator. (Right-click on command line icon in start menu and select "run as administrator").
Remember this about joins in SQL...
You may be confused by the differences between joins in SQL.
A standard JOIN or inner-join in SQL will join tables where the rows are exactly matching on the column that you are joining on. It will automatically not include non-matching rows, so that you are only presented with rows that are consistent. The benefit of this is that you are only presented with consistent and accurate information. The disadvantage is that you are missing information from some items.
However, a LEFT JOIN will join tables on a column where rows may not be matching (inconsistency between tables can be caused by one table being updated, but corresponding information in another table not being updated). In this scenario, you are given all information, but some attributes may be listed as NULL.
A CROSS JOIN creates a Cartesian Product. This means that it will allow us to combine all rows of one table with all rows of another table. If there are three rows in table A, and three rows in table B, all three rows of table A will be joined with all three rows of table B. The results of this join will have 9 rows.
A standard JOIN or inner-join in SQL will join tables where the rows are exactly matching on the column that you are joining on. It will automatically not include non-matching rows, so that you are only presented with rows that are consistent. The benefit of this is that you are only presented with consistent and accurate information. The disadvantage is that you are missing information from some items.
However, a LEFT JOIN will join tables on a column where rows may not be matching (inconsistency between tables can be caused by one table being updated, but corresponding information in another table not being updated). In this scenario, you are given all information, but some attributes may be listed as NULL.
Image above from codecademy.com https://s3.amazonaws.com/codecademy-content/courses/learn-sql/multiple-tables/left-join.gif |
A CROSS JOIN creates a Cartesian Product. This means that it will allow us to combine all rows of one table with all rows of another table. If there are three rows in table A, and three rows in table B, all three rows of table A will be joined with all three rows of table B. The results of this join will have 9 rows.
Shebang Line
The Shebang Line should be the first line of your python program.
This is what Automate the Boring Stuff with Python author Al Sweigart says about the Shebang line.
The first line of all your Python programs should be a shebang line, which tells your computer that you want Python to execute this program. The shebang line begins with #!, but the rest depends on your operating system.You will be able to run Python scripts from IDLE without the shebang line, but the line is needed to run them from the command line.
- On Windows, the shebang line is #! python3.
- On OS X, the shebang line is #! /usr/bin/env python3.
- On Linux, the shebang line is #! /usr/bin/python3.
SQLite strftime() Function
Did you know that strftime() is an SQLite function than allows the programmer to return a formatted date.
It takes two arguments:
strftime(format, column)
- To get an hour: strftime('%H', column_name)
- To get the year: strftime('%Y', column_name)
- To get the month: strftime('%m', column_name)
- To get the day: strftime('%d', column_name)
- To get the minute: strftime('%m', column_name)
- To get the second: strftime('%S', column_name)
The above is true as long as the time format is YYYY-MM-DD HH:MM:SS
More on this function can be read from the SQL documentation here.
Subscribe to:
Posts (Atom)
Web Development: Organizing Files and Folders
When you begin to build your website, it's a very clever idea to organize your files and folders efficiently. You should have: A ...
-
Some words are reserved in JavaScript and cannot be used as variable names. Some common examples are: case catch for let private th...
-
Did you know you can list your tables as aliases in SQL? Say you have a table called "quiz" with unique user_id's. You cou...
-
Continuing our journey through Automate the Boring Stuff with Python's excel lessons, we came across the get_column_letter and column_in...