Posts

Top 50+ Linux Commands

  Top 50+ Linux Commands  ls  - The most frequently used command in Linux to list directories pwd  - Print working directory command in Linux cd  - Linux command to navigate through directories mkdir  - Command used to create directories in Linux mv  - Move or rename files in Linux cp  - Similar usage as mv but for copying files in Linux rm  - Delete files or directories touch  - Create blank/empty files ln  - Create symbolic links (shortcuts) to other files cat  - Display file contents on the terminal clear  - Clear the terminal display echo  - Print any text that follows the command less  - Linux command to display paged outputs in the terminal man  - Access manual pages for all Linux commands uname  - Linux command to get basic information about the OS whoami  - Get the active username tar  - Command to extract and compress files in Linux grep  - Search for a string within an output he...

JOIN Questions Part I

Image
  JOIN Questions Part I Question Mania Now that you have been introduced to JOINs, let's practice to build your skills and comfort with this new tool. Below I have provided the  ERD  and a bunch of questions. The solutions for the questions can be found on the next concept for you to check your answers or just in case you get stuck! I recommend testing your queries with the environment below, and then saving them to a file. Then compare your file to my solutions on the next concept! Questions and Solutions Provide a table for all the for all  web_events  associated with account  name  of  Walmart . There should be three columns. Be sure to include the  primary_poc , time of the event, and the  channel  for each event. Additionally, you might choose to add a fourth column to assure only  Walmart  events were chosen. SELECT a . primary_poc , w . occurred_at , w . channel , a . name FROM web_events w JOIN accounts a ON ...

Alias

  Alias When we  JOIN  tables together, it is nice to give each table an  alias . Frequently an alias is just the first letter of the table name. You actually saw something similar for column names in the  Arithmetic Operators  concept. Example: FROM tablename AS t1 JOIN tablename2 AS t2 Before, you saw something like: SELECT col1 + col2 AS total , col3 Frequently, you might also see these statements without the  AS  statement. Each of the above could be written in the following way instead, and they would still produce the  exact same results : FROM tablename t1 JOIN tablename2 t2 and SELECT col1 + col2 total , col3 Aliases for Columns in Resulting Table While aliasing tables is the most common use case. It can also be used to alias the columns selected to have the resulting table reflect a more readable name. Example: Select t1 . column1 aliasname , t2 . column2 aliasname2 FROM tablename AS t1 JOIN tablename2 AS t2 The al...