<jupyter_start><jupyter_text>import sql library<jupyter_code>import pandas as pd
import sqlite3
%load_ext sql

%sql sqlite://<jupyter_output><empty_output><jupyter_text>SQl table 1<jupyter_code>%%sql
create table Employee(Emp_id varchar(10) PRIMARY KEY, First name varchar(50) not null, Last name varchar(50), Address varchar(50) not null, title char(25) not null, Salary number(10) not null, Hire_date DATE)
%%sql
SELECT * FROM employee;

%%sql
insert into Employee values ('emp03', 'rani', 'singh', '43 law gate', 'tester',77000,'2020-06-18');
insert into Employee values ('emp04', 'kittu', 'singh', '43 law gate', 'desiner',57000,'2020-03-04');
insert into Employee values ('emp05', 'Aman', 'singh', '43 law gate', 'developer',67000,'2020-08-07');
insert into Employee values ('emp06', 'riya', 'singh', '43 law gate', 'tester',74000,'2020-03-04');
insert into Employee values ('emp07', 'Ayush', 'singh', '43 law gate', 'tester',47000,'2020-09-13');
insert into Employee values ('emp08', 'Nupur', 'singh', '43 law gate', 'developer',37000,'2020-0-19');
%%sql
SELECT * FROM employee;<jupyter_output>* sqlite://
Done.<jupyter_text>sql table 2<jupyter_code>%%sql
create table Employee2(Emp_id varchar(10) PRIMARY KEY, city_cover varchar(50) not null, Contact_number number(10) not null, Age int,
    CHECK (Age>=18) );
%%sql

insert into Employee2 values ('emp03', 'kanpur', 8051557283,24);
insert into Employee2 values ('emp04', 'jalandher', 8051557283,22);
insert into Employee2 values ('emp05', 'chandighar', 8051557283,29);
insert into Employee2 values ('emp06', 'patna', 8051557283,26);
insert into Employee2 values ('emp07', 'Delhi', 8051557283,30);
insert into Employee2 values ('emp08', 'kanpur', 8051557283,31);

%%sql
SELECT * FROM employee2;<jupyter_output>* sqlite://
Done.<jupyter_text>inner join<jupyter_code>%%sql
select Employee.first,Employee.last,Employee2.city_cover from Employee INNER JOIN Employee2 ON Employee.Emp_id = Employee2.Emp_id;<jupyter_output>* sqlite://
Done.<jupyter_text>view<jupyter_code>%%sql
CREATE VIEW DetailsView AS
SELECT first, last, title 
FROM Employee;
WHERE Emp_id = emp05;
%%sql
SELECT * FROM DetailsView;<jupyter_output>* sqlite://
Done.<jupyter_text>like clause<jupyter_code>%%sql
select * from Employee where title like '__v%';<jupyter_output>* sqlite://
Done.<jupyter_text>Order by clause<jupyter_code>%%sql
select * from Employee order by salary;
%%sql
select * from Employee order by salary desc;<jupyter_output>* sqlite://
Done.
{'fraction_non_alphanumeric': 0.15028203062046736, 'fraction_numerical': 0.08904109589041095, 'mean_word_length': 7.167763157894737, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '340776', 'license': 'Apache-2.0', 'n_tokens_mistral': 1033, 'n_tokens_neox': 857, 'n_words': 248, 'path': 'joins.ipynb', 'repo_name': 'bindas16/SQL', 'size': '2482'}