Friday, July 27, 2018

SQL & Linux command_Session 5A

%%!
pip install --trusted-host pypi.org ipython-sql
Out[1]:
['Collecting ipython-sql',
 '  Downloading https://files.pythonhosted.org/packages/ab/df/427e7cf05ffc67e78672ad57dce2436c1e825129033effe6fcaf804d0c60/ipython_sql-0.3.9-py2.py3-none-any.whl',
 'Requirement already satisfied: sqlalchemy>=0.6.7 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython-sql) (1.2.7)',
 'Requirement already satisfied: ipython>=1.0 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython-sql) (6.4.0)',
 'Collecting sqlparse (from ipython-sql)',
 '  Downloading https://files.pythonhosted.org/packages/65/85/20bdd72f4537cf2c4d5d005368d502b2f464ede22982e724a82c86268eda/sqlparse-0.2.4-py2.py3-none-any.whl',
 'Requirement already satisfied: ipython-genutils>=0.1.0 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython-sql) (0.2.0)',
 'Collecting prettytable (from ipython-sql)',
 '  Downloading https://files.pythonhosted.org/packages/ef/30/4b0746848746ed5941f052479e7c23d2b56d174b82f4fd34a25e389831f5/prettytable-0.7.2.tar.bz2',
 'Requirement already satisfied: six in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython-sql) (1.11.0)',
 'Requirement already satisfied: traitlets>=4.2 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (4.3.2)',
 'Requirement already satisfied: pickleshare in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (0.7.4)',
 'Requirement already satisfied: simplegeneric>0.8 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (0.8.1)',
 'Requirement already satisfied: backcall in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (0.1.0)',
 'Requirement already satisfied: jedi>=0.10 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (0.12.0)',
 'Requirement already satisfied: setuptools>=18.5 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (39.1.0)',
 'Requirement already satisfied: colorama; sys_platform == "win32" in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (0.3.9)',
 'Requirement already satisfied: pygments in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (2.2.0)',
 'Requirement already satisfied: decorator in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (4.3.0)',
 'Requirement already satisfied: prompt-toolkit<2.0.0,>=1.0.15 in c:\\users\\user\\anaconda3\\lib\\site-packages (from ipython>=1.0->ipython-sql) (1.0.15)',
 'Requirement already satisfied: parso>=0.2.0 in c:\\users\\user\\anaconda3\\lib\\site-packages (from jedi>=0.10->ipython>=1.0->ipython-sql) (0.2.0)',
 'Requirement already satisfied: wcwidth in c:\\users\\user\\anaconda3\\lib\\site-packages (from prompt-toolkit<2.0.0,>=1.0.15->ipython>=1.0->ipython-sql) (0.1.7)',
 'Building wheels for collected packages: prettytable',
 '  Running setup.py bdist_wheel for prettytable: started',
 "  Running setup.py bdist_wheel for prettytable: finished with status 'done'",
 '  Stored in directory: C:\\Users\\user\\AppData\\Local\\pip\\Cache\\wheels\\80\\34\\1c\\3967380d9676d162cb59513bd9dc862d0584e045a162095606',
 'Successfully built prettytable',
 'distributed 1.21.8 requires msgpack, which is not installed.',
 'Installing collected packages: sqlparse, prettytable, ipython-sql',
 'Successfully installed ipython-sql-0.3.9 prettytable-0.7.2 sqlparse-0.2.4',
 'You are using pip version 10.0.1, however version 18.0 is available.',
 "You should consider upgrading via the 'python -m pip install --upgrade pip' command."]
In [2]:
%load_ext sql
In [3]:
%sql sqlite://
Out[3]:
'Connected: @None'
In [16]:
%%sql
CREATE TABLE Emp (FirstName varchar(30), LastName varchar(30));
INSERT INTO Emp values ('Ranjan', 'Sinha');
insert into Emp values ('Ruchi' , 'Srivastva');
Select * from Emp;
 * sqlite://
Done.
1 rows affected.
1 rows affected.
Done.
Out[16]:
FirstNameLastName
RanjanSinha
RanjanSinha
RuchiSrivastva
RanjanSinha
RuchiSrivastva
In [17]:
pwd
Out[17]:
'C:\\Users\\user\\Python_Prithwis Mukerjee'
In [36]:
ls-a
 Volume in drive C has no label.
 Volume Serial Number is 52A5-F269

 Directory of C:\Users\user\Python_Prithwis Mukerjee

File Not Found
In [57]:
mkdir Ranjan
In [58]:
rmdir Ranjan
In [59]:
echo hello! My name is Ranjan
hello! My name is Ranjan


Sir Rest of the code is not working on window

No comments:

Post a Comment