<jupyter_start><jupyter_text>SQL in  Pythonic way via Jupyter Notebook @ <NAME> Requirement* 1.Install MySql Server in your system. Note down its root password.* 2.Install following packages in Anaconda by running cell below.<jupyter_code>#!pip install mysqlclient
#!pip install sqlalchemy
#!pip install ipython-sql<jupyter_output><empty_output><jupyter_text>Description* mysqlclient -->It provides connection to MySQL database using Python. Before you can access MySQL databases using Python, you must install mysqlclient packages. Other packages are also available viz: mysql-connector-python,PyMySQL.* sqlalchemy --> It provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language.* ipython-sql -->It introduces a %sql (or %%sql) magic to your notebook allowing you to connect to a database, using SQLAlchemy connect strings, then issue SQL commands within IPython or IPython Notebook.<jupyter_code>import pandas as pd
import sqlalchemy<jupyter_output><empty_output><jupyter_text>Creating a Database* For time being, for sake of simplicity --> Database is collection of tables.* We are going to create a database named 'Aashvi'. It is blank initialy. We will add tables in it.<jupyter_code>engine2 = sqlalchemy.create_engine('mysql://root:r1m2n3#?@localhost') # for connecting to server
engine2.execute("CREATE DATABASE Aashvi") # for creating a  database named  Aashvi
engine2.execute("USE Aashvi") # For selecting particular db in server.Currently we have only one i.e. Aashvi
engine2.connect()
print(engine2)<jupyter_output>Engine(mysql://root:***@localhost)<jupyter_text>ipython-sql library is loaded using the %load_ext<jupyter_code>%load_ext sql
# ipython-sql library is loaded using the %load_ext
# To connect to the database you need to pass connection string in SQLAlchemy format to the 
%sql mysql://root:r1m2n3#?@localhost/Aashvi<jupyter_output><empty_output><jupyter_text>Loading Iris data set through pandas<jupyter_code>data=pd.read_csv('iris.csv')
data.head()<jupyter_output><empty_output><jupyter_text>For making a sql table in DB from pandas dataframe<jupyter_code># Making a datafrme into sql table and storing in aashvi database  then working on it
data.to_sql('Iris_N',con=engine2)
# Now we have a sql table  named Iris_N in aashvi database we will work on it.<jupyter_output><empty_output><jupyter_text>For Dropping/Deleting any table from DB<jupyter_code>%%sql
DROP TABLE Iris_N<jupyter_output>* mysql://root:***@localhost/Aashvi
0 rows affected.<jupyter_text>Note: Once a table is dropped/deleted,we have create it again to access it or to work on it.  Module 1  Selecting multiple(coma seperated) or single column from a Table* Note: anything inside this -->   /\*,------\*/ is comment line, not executed as code.<jupyter_code>%%sql 
SELECT SepalLength,PetalWidth FROM Iris_N 
LIMIT 5           /*,For limiting the result upto only 5 rows, without  LIMIT all rows will be displayed*/<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>(*) wildcard character gives all colums of a table at a time, you dont have to write each column name individually<jupyter_code>%%sql
SELECT * FROM Iris_N
LIMIT 5<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>Limiting Results<jupyter_code>%%sql
SELECT SepalLength FROM Iris_N LIMIT 5<jupyter_output>* mysql://root:***@localhost/chinook
5 rows affected.<jupyter_text>Creating New Table and Writing on it<jupyter_code>%%sql
CREATE TABLE  shoes1(         
    Id char(10)  PRIMARY KEY,
    Brand char(10) NOT NULL,
    Type char(250) NOT NULL,
    Color char(250) NOT NULL,
    Price decimal(8,2) NOT NULL,
    Reviews varchar(35) NOT NULL
    )<jupyter_output>* mysql://root:***@localhost/Aashvi
0 rows affected.<jupyter_text>Adding data into table<jupyter_code>%%sql 
INSERT INTO shoes1
VALUES('14535974','Gucci','Slippers','Pink','695.00','I like it.')
%%sql
SELECT * FROM shoes1
%%sql
CREATE TABLE shoes2(
    Id        char(10)       PRIMARY KEY,
    Brand     char(10)       NOT NULL,
    Type      char(250)      NOT NULL,
    Color     char(250)      NOT NULL,
    Price     decimal(8,2)   NOT NULL,
    Reviews   varchar(35)    NOT NULL
    )
%%sql
SELECT Brand FROM shoes2
%%sql
INSERT INTO shoes2
VALUES('1','GUCCI','slippers','pink','650.30', 'I hate it.')
%%sql
SELECT * FROM shoes2
%%sql
INSERT INTO shoes1
(Id,Brand,Type,Color,Price,Reviews)
VALUES('14535984','Nike','Slippers','Blue','695.00','I didnt like it')
%%sql
INSERT INTO shoes2
(Id,Brand,Type,Color,Price,Reviews)
VALUES('2','r','ty','co','60','I like it')
%%sql 
SELECT * FROM shoes2<jupyter_output><empty_output><jupyter_text>Trying to insert row with Duplicate ID. This is not allowed and there will be an error.<jupyter_code>%%sql
INSERT INTO shoes1
(Id,Brand,Type,Color,Price,Reviews)
VALUES('14535984','Gucci','Slippers','Pink','695.00','I didnt like it')<jupyter_output><empty_output><jupyter_text>Inserting multiple rows at once<jupyter_code>%%sql
INSERT INTO shoes1
(Id,Brand,Type,Color,Price,Reviews)
VALUES('14535985','Nike','Slippers','Blue','678.00','I like it'),
('14535986','Goldstar','Shoes','Black','695.00','I didnt like it'),
('14535987','Nike','Slippers','Blue','800.00','Ok Ok'),
('14535988','Puma','Slippers','Blue','870.00','Nice to have one');
%%sql
SELECT * FROM shoes1<jupyter_output>* mysql://root:***@localhost/Aashvi
6 rows affected.<jupyter_text>CREATING TEMPORARY TABLE<jupyter_code>%%sql
CREATE TEMPORARY TABLE Sandals AS
(SELECT * FROM shoes1 WHERE Color='Blue')
%%sql CREATE TEMPORARY TABLE sand AS 
(SELECT * FROM shoes1 WHERE NOT Color='Blue')<jupyter_output>* mysql://root:***@localhost/Aashvi
2 rows affected.<jupyter_text>Now displaying above temperory table named 'Sandals'<jupyter_code>%%sql 
SELECT * FROM Sandals
%%sql
SELECT * FROM sand
%%sql
CREATE TEMPORARY TABLE setosa AS
(SELECT * FROM Iris_N WHERE Name='Iris-setosa')
%%sql
SELECT * FROM setosa<jupyter_output><empty_output><jupyter_text>Updating table and deleting rows and columns<jupyter_code>%%sql
SELECT * FROM shoes2<jupyter_output>* mysql://root:***@localhost/Aashvi
1 rows affected.<jupyter_text>Dropping a column from a table* multiple columns can be dropped by adding more drop commmnad below.<jupyter_code>%%sql
ALTER TABLE shoes2
DROP COLUMN  Type;
%%sql
SELECT * FROM shoes2<jupyter_output>* mysql://root:***@localhost/Aashvi
1 rows affected.<jupyter_text>Deleting Particular row<jupyter_code>%%sql
DELETE FROM shoes2  WHERE Id='1';
%%sql
SELECT * FROM shoes2<jupyter_output>* mysql://root:***@localhost/Aashvi
0 rows affected.<jupyter_text>Module 2  Filter Data ![sql3.PNG](attachment:sql3.PNG)<jupyter_code>%%sql 
SELECT * FROM Iris_N WHERE SepalLength >5 # Selecting all column
LIMIT 5
%%sql
SELECT * FROM Iris_N WHERE SepalLength<>0.5 LIMIT 8
%%sql
SELECT * FROM Iris_N WHERE PetalLength=1.4 LIMIT 5
%%sql 
SELECT SepalLength,SepalWidth 
FROM Iris_N
WHERE Name = 'Iris-versicolor'
LIMIT 5
# Selecting few column
%%sql 
SELECT SepalLength,SepalWidth 
FROM Iris_N
WHERE SepalLength BETWEEN 6 AND 7
LIMIT 5
# Selecting few column
%%sql 
SELECT SepalLength,SepalWidth 
FROM Iris_N 
WHERE SepalLength <6 OR SepalLength>7
LIMIT 5
%%sql 
SELECT SepalLength,SepalWidth 
FROM Iris_N 
WHERE SepalLength !=5
LIMIT 5<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>Advanced Filter    IN  <-- OPERATOR<jupyter_code>%%sql 
SELECT SepalLength,PetalLength,Name
FROM Iris_N
WHERE Name IN ('Iris-versicolor','Iris-setosa')
LIMIT 5<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>![sql5.PNG](attachment:sql5.PNG)  OR with AND<jupyter_code>%%sql 
SELECT SepalLength,PetalLength, Name
FROM Iris_N 
WHERE (SepalLength>6 OR SepalLength=5) AND  PetalLength>1.5 
LIMIT 5
## USE Parenthesis for maintain order of operations<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>NOT oprators<jupyter_code>%%sql 
SELECT * FROM Iris_N
WHERE NOT Name='Iris-setosa' AND NOT Name='Iris-versicolor'
LIMIT 5
%%sql
SELECT SepalLength,SepalWidth, Name
FROM Iris_N 
WHERE(Name<>'Iris-setosa' AND Name<>'Iris-vericolor')
LIMIT 5<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>USING Wildcaard* Importing an excel file as pandas dataframe and then converting it into sql table of database.<jupyter_code>edata=pd.read_excel(r'E:\Machine Learning\Downloaded video\sql_course\Email.xlsx')
edata.head()
edata.to_sql('Email',con=engine2)
%%sql
SELECT * FROM Email
LIMIT 5
%%sql
SELECT * FROM Email
WHERE Name LIKE '%Jain'
LIMIT 5
%%sql
SELECT * FROM Email
WHERE Name LIKE '%Kaur'
LIMIT 5
%%sql
SELECT * FROM Email
WHERE Name LIKE 'Rahul%'
LIMIT 5
%%sql
SELECT * FROM Email
WHERE (Name LIKE 'R%') AND (Name NOT LIKE '%Gupta')
LIMIT 7<jupyter_output>* mysql://root:***@localhost/Aashvi
7 rows affected.<jupyter_text>Sorting with ORDER BY -> DESC & ASC<jupyter_code>%%sql
SELECT * FROM Iris_N
ORDER BY  SepalLength ASC# ACS for ascending order(Default), DESC for descending
LIMIT 5
%%sql
CREATE TEMPORARY TABLE Iris_tmp AS 
SELECT * FROM Iris_N
WHERE  SepalLength > 6
ORDER BY SepalLength DESC

%%sql
SELECT * FROM Iris_tmp
%%sql
DROP TABLE Iris_tmp<jupyter_output>* mysql://root:***@localhost/Aashvi
0 rows affected.<jupyter_text>Math operations ![sql2.PNG](attachment:sql2.PNG)<jupyter_code>%%sql
SELECT SepalLength,SepalWidth, SepalLength*SepalWidth AS Cros_feature1
FROM Iris_N 
ORDER BY SepalWidth DESC
LIMIT 5
%%sql
SELECT SepalLength,SepalWidth, (SepalLength*SepalWidth)/PetalLength AS Cros_feature2
FROM Iris_N
LIMIT 5<jupyter_output>* mysql://root:***@localhost/Aashvi
5 rows affected.<jupyter_text>Check this one<jupyter_code>%%sql
CREATE TEMPORARY TABLE Temp AS 
SELECT SepalLength,PetalWidth,SepalLength-PetalWidth AS New_Feat
FROM Iris_N
WHERE SepalLength >6 
ORDER BY PetalWidth DESC
%%sql
SELECT * FROM Temp
LIMIT 8
%%sql
DROP TABLE Temp<jupyter_output>* mysql://root:***@localhost/Aashvi
0 rows affected.<jupyter_text>Aggregate Functions![sql2.PNG](attachment:sql2.PNG)<jupyter_code>%%sql
SELECT AVG(SepalLength) AS avgspl FROM Iris_N

%%sql
SELECT COUNT(*) AS total_entry FROM Iris_N 
##counts all rows in the table containing values or null values
%%sql
SELECT COUNT(SepalLength) AS total_spl FROM Iris_N
## counts all the rows in a specifica column ignoring NULL values
%%sql
SELECT MAX(SepalLength) AS maxspl FROM Iris_N
%%sql
SELECT MAX(SepalLength) AS maxspl, MIN(SepalLength) AS minspl FROM Iris_N
##Null values are ignore
%%sql
SELECT SUM((SepalLength)) AS sumspl FROM Iris_N
%%sql 
SELECT SUM(SepalLength*SepalWidth) as prodsplw
FROM Iris_N 
where (SepalLength)>6
%%sql
SELECT COUNT(DISTINCT SepalLength) FROM Iris_N
%%sql
SELECT SUM(DISTINCT SepalLength) FROM Iris_N<jupyter_output>* mysql://root:***@localhost/Aashvi
1 rows affected.<jupyter_text>Grouping Data with SQL* Importing an excel file as pandas dataframe and then converting it into sql table of database.<jupyter_code>tips=pd.read_csv('E:/Machine Learning/Downloaded video/sql_course/tips.csv')
tips.head()
tips.to_sql('tips',con=engine2)
%%sql
SELECT smoker, SUM(total_bill) AS total_collection 
FROM tips 
GROUP BY smoker
%%sql
SELECT day, SUM(total_bill) AS total_collection 
FROM tips 
GROUP BY day<jupyter_output>* mysql://root:***@localhost/Aashvi
4 rows affected.<jupyter_text>![sql7.PNG](attachment:sql7.PNG)<jupyter_code>%%sql
SELECT day, SUM(total_bill) AS total_collection
FROM tips
WHERE size>3
GROUP BY day
HAVING total_collection>41
ORDER BY day DESC
%%sql
SELECT time,day,SUM(tip) AS total_tip
FROM tips
WHERE size>4
GROUP BY day
HAVING day <> 'Sun'<jupyter_output>* mysql://root:***@localhost/Aashvi
2 rows affected.<jupyter_text>Module 3 : Joinings  Joins in Detail with visible example: Pandas Syntx & Equivalent SQL A. INNER JOIN 1. Basic Example with one unique key combination:* one-to-one joins: for example when joining two DataFrame objects on their indexes (which must contain unique values).<jupyter_code>LEFT1 = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'],
                     'A': ['A0', 'A1', 'A2', 'A3'],
                     'B': ['B0', 'B1', 'B2', 'B3']})

RIGHT1 = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'],
                      'C': ['C0', 'C1', 'C2', 'C3'],
                      'D': ['D0', 'D1', 'D2', 'D3']})

result = pd.merge(LEFT1, RIGHT1, on='key')

print(LEFT1,'\n\n',RIGHT1)
result<jupyter_output>key   A   B
0  K0  A0  B0
1  K1  A1  B1
2  K2  A2  B2
3  K3  A3  B3 

   key   C   D
0  K0  C0  D0
1  K1  C1  D1
2  K2  C2  D2
3  K3  C3  D3<jupyter_text>Equivalent SQL implementation<jupyter_code>## Making a datafrme into sql table and storing in database  then working on it
LEFT1.to_sql('left1',con=engine2)
RIGHT1.to_sql('right1',con=engine2)
%%sql
SELECT * FROM left1
%%sql
SELECT * FROM right1
%%sql
SELECT left1.key,A,B
FROM left1
JOIN right1 
ON left1.key=right1.key
/*,Cmment line --> or, we can write : INNER JOIN */<jupyter_output>* mysql://root:***@localhost/chinook
4 rows affected.<jupyter_text>2. Complicated Example with multiple join keys. Only the keys appearing in both left and right are present (the intersection), since how='inner' by default (in pandas).<jupyter_code>LEFT2 = pd.DataFrame({'key1': ['K0', 'K0', 'K1', 'K2'],
                     'key2': ['K0', 'K1', 'K0', 'K1'],
                     'A': ['A0', 'A1', 'A2', 'A3'],
                     'B': ['B0', 'B1', 'B2', 'B3']})

RIGHT2 = pd.DataFrame({'key1': ['K0', 'K1', 'K1', 'K2'],
                      'key2': ['K0', 'K0', 'K0', 'K0'],
                      'C': ['C0', 'C1', 'C2', 'C3'],
                      'D': ['D0', 'D1', 'D2', 'D3']})

result = pd.merge(LEFT2, RIGHT2, on=['key1', 'key2'],how='inner') ##intersection --> default how='inner'
print(LEFT2,'\n\n',RIGHT2)
result<jupyter_output>key1 key2   A   B
0   K0   K0  A0  B0
1   K0   K1  A1  B1
2   K1   K0  A2  B2
3   K2   K1  A3  B3 

   key1 key2   C   D
0   K0   K0  C0  D0
1   K1   K0  C1  D1
2   K1   K0  C2  D2
3   K2   K0  C3  D3<jupyter_text>Equivalent SQL implementation<jupyter_code>### Making a datafrme into sql table and storing in database  then working on it
LEFT2.to_sql('left2',con=engine2)
RIGHT2.to_sql('right2',con=engine2)
%%sql
SELECT * FROM left2
%%sql
SELECT * FROM right2
%%sql
SELECT left2.key1,left2.key2,A,B,C,D
FROM left2
JOIN right2
ON (left2.key1=right2.key1) AND (left2.key2=right2.key2)<jupyter_output>* mysql://root:***@localhost/chinook
3 rows affected.<jupyter_text>Note: In above Example and examples given below, we are joing on two field ( on both :key1 & key2) thus 'AND' operator has been used. For joining on one key, AND part will not be there.  B. Example > how='left' /left join* Using same above two table i.e. left2 and right2<jupyter_code>result = pd.merge(LEFT2, RIGHT2, how='left', on=['key1', 'key2']) ##left>A,right>B
print(LEFT2,'\n\n',RIGHT2)
result<jupyter_output>key1 key2   A   B
0   K0   K0  A0  B0
1   K0   K1  A1  B1
2   K1   K0  A2  B2
3   K2   K1  A3  B3 

   key1 key2   C   D
0   K0   K0  C0  D0
1   K1   K0  C1  D1
2   K1   K0  C2  D2
3   K2   K0  C3  D3<jupyter_text>Equivalent SQL implementation<jupyter_code>%%sql
SELECT left2.key1,left2.key2,A,B,C,D
FROM left2
LEFT JOIN right2
ON (left2.key1=right2.key1) AND (left2.key2=right2.key2)
ORDER BY key1<jupyter_output>* mysql://root:***@localhost/chinook
5 rows affected.<jupyter_text>C. Example > how='right'/right join<jupyter_code>result = pd.merge(LEFT2, RIGHT2, how='right', on=['key1', 'key2'])##left>A,right>B
print(LEFT2,'\n\n',RIGHT2)
result<jupyter_output>key1 key2   A   B
0   K0   K0  A0  B0
1   K0   K1  A1  B1
2   K1   K0  A2  B2
3   K2   K1  A3  B3 

   key1 key2   C   D
0   K0   K0  C0  D0
1   K1   K0  C1  D1
2   K1   K0  C2  D2
3   K2   K0  C3  D3<jupyter_text>Equivalent SQL implementation<jupyter_code>%%sql
SELECT right2.key1,right2.key2,A,B,C,D
FROM left2
RIGHT JOIN right2
ON (left2.key1=right2.key1) AND (left2.key2=right2.key2)
ORDER BY key1<jupyter_output>* mysql://root:***@localhost/chinook
4 rows affected.<jupyter_text>D. Example > how='outer'/outer join or  Union operation<jupyter_code>result = pd.merge(LEFT2, RIGHT2, how='outer', on=['key1', 'key2'])
print(LEFT2,'\n\n',RIGHT2)
result<jupyter_output>key1 key2   A   B
0   K0   K0  A0  B0
1   K0   K1  A1  B1
2   K1   K0  A2  B2
3   K2   K1  A3  B3 

   key1 key2   C   D
0   K0   K0  C0  D0
1   K1   K0  C1  D1
2   K1   K0  C2  D2
3   K2   K0  C3  D3<jupyter_text>Equivalent SQL implementation* Since here is two field on which we have to join Union is used to get full outer join.<jupyter_code>%%sql
SELECT left2.key1,left2.key2,A,B,C,D
FROM left2
LEFT JOIN right2
ON (left2.key1=right2.key1) AND (left2.key2=right2.key2)
UNION
SELECT right2.key1,right2.key2,A,B,C,D
FROM left2
RIGHT JOIN right2
ON (left2.key1=right2.key1) AND (left2.key2=right2.key2)
ORDER BY key1<jupyter_output>* mysql://root:***@localhost/chinook
6 rows affected.<jupyter_text>For joining on one field only,  following syntax can be used :![full%20outer%20join.JPG](attachment:full%20outer%20join.JPG)  Module 4 Practice on Chinook database : Self join, Many more Different Scenarios For this we have to first upload chinook database to our mysql server. Connecting to Database<jupyter_code>dialect+driver://username:password@host:port/database
engine1=sqlalchemy.create_engine('mysql+mysqldb://root:r1m2n3#?@localhost/chinook')
engine1.connect()
print(engine1)<jupyter_output><empty_output><jupyter_text>Chinook Shema  > Image Ref: sqlitetutorial.net![Chinook%20Schema%20detail.JPG](attachment:Chinook%20Schema%20detail.JPG)  Q.1. Provide a query showing Customers (just their full names, customer ID and country) who are not in the US<jupyter_code>%%sql
SELECT FirstName,LastName,CustomerId,Country 
FROM chinook.customer
WHERE Country<>'USA'
## Check below syntax for concatenation of two string columns
%%sql 
SELECT CONCAT(FirstName,' ', LastName) AS Name ,CustomerId,Country 
FROM chinook.customer
WHERE Country <>'USA';<jupyter_output><empty_output><jupyter_text>Q.2.Provide a query only showing the Customers from Brazil.<jupyter_code>%%sql 
SELECT FirstName,Country
FROM chinook.customer
WHERE Country ='Brazil'<jupyter_output><empty_output><jupyter_text>Q.3. Provide a query showing the Invoices of customers who are from Brazil. The resultant table should show the customer's full name, Invoice ID, Date of the invoice and billing country.<jupyter_code>%%sql
SELECT invoice.CustomerID, CONCAT(FirstName,' ', LastName) AS Name,InvoiceId,InvoiceDate,Country
FROM invoice
JOIN customer
ON customer.CustomerId=invoice.CustomerID
Where Country ='Brazil'<jupyter_output><empty_output><jupyter_text>Q.4. Provide a query showing only the Employees who are Sales Agents.<jupyter_code>%%sql
SELECT * FROM chinook.employee limit 4
%%sql
SELECT CONCAT(FirstName ,' ',LastName) AS Name 
FROM chinook.employee
WHERE Title LIKE '%Sales%Agent%'<jupyter_output><empty_output><jupyter_text>* Q.5.Provide a query showing a unique list of billing countries from the Invoice table.<jupyter_code>%%sql
SELECT DISTINCT BillingCountry
FROM invoice<jupyter_output><empty_output><jupyter_text>Self Join :* Find the Mangers of the empoyees<jupyter_code>/*,e.EmployeeId,e.FirstName,m.FirstName AS Managers_Name*/  --> For commenting
%%sql
SELECT e.EmployeeId,e.FirstName,m.FirstName AS Managers_Name
FROM employee e
JOIN employee m
on e.ReportsTo=m.EmployeeID<jupyter_output><empty_output><jupyter_text>Joining Mutiple tables more than 2  Q.6. Provide a query that shows the invoices associated with each sales agent. The resultant table should include the Sales Agent's full name.<jupyter_code>%%sql
SELECT InvoiceId, CONCAT(employee.FirstName," ",employee.LastName) AS Name, Title
FROM customer 
JOIN invoice ON invoice.CustomerId=customer.CustomerId
JOIN employee ON customer.SupportRepId=employee.EmployeeId;
%%sql
SELECT InvoiceId, CONCAT(employee.FirstName," ",employee.LastName) AS Name, Title
FROM invoice
JOIN customer ON invoice.CustomerId=customer.CustomerId
JOIN employee ON customer.SupportRepId=employee.EmployeeId<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1148722537031514, 'fraction_numerical': 0.03389999005865394, 'mean_word_length': 5.122641509433962, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '48', 'dir': 'jupyter-structured-clean-dedup', 'id': '226264', 'license': 'MIT', 'n_tokens_mistral': 7536, 'n_tokens_neox': 7214, 'n_words': 2122, 'path': '.ipynb_checkpoints/SQL_Working-checkpoint.ipynb', 'repo_name': 'Rami-RK/SQL-in-Pythonic-way-via-Jupyter', 'size': '20126'}