| Introduction to SQL | 
        
        SQL allows us to select and group subsets of data, do math and other calculations, and combine data.A relational database is made up of tables which are related to each other by shared keys.Different database management systems (DBMS) use slightly different vocabulary, but they are all based on the same ideas. | 
  
  
    
      | Getting to know your data | 
        
        We can import sqlite3 to work with relational database in pythonPrimary key uniquely identifies each rows in a table. A foreign key in one table refers to a primary key in another table.Common data types in SQL are are integer, varchar, char, text, double, etc. | 
  
  
    
      | Basic Queries | 
        
        It is useful to apply conventions when writing SQL queries to aid readability.Use logical connectors such as AND or OR to create more complex queries.Calculations using mathematical symbols can also be performed on SQL queries.Adding comments in SQL helps keep complex queries understandable. | 
  
  
    
      | SQL Aggregation | 
        
        Use the GROUP BYkeyword to aggregate data.Functions like MIN,MAX,AVERAGE,SUM,COUNT, etc. operate on aggregated data.Aliases can help shorten long queries. To write clear and readible queries, use the ASkeyword when creating aliases.Use the HAVINGkeyword to filter on aggregate properties.Use a VIEWto store the result of a query as though it was a new table. | 
  
  
    
      | Joins | 
        
        Use the JOINcommand to combine data from two tables—theONorUSINGkeywords specify which columns link the tables.Regular JOINreturns cross product of the two tables. Other join commands provide different behavior, e.g.,LEFT JOINretains all rows of the table on the left side of the command.IFNULLallows you to specify a value to use in place ofNULL, which can help in joins
NULLIFcan be used to replace certain values withNULLin results
Many other functions like IFNULLandNULLIFcan operate on individual values. |