Data science/Database(28)
-
[IBM]Databases and SQL for Data Science with Python - Views, Stored Procedures
VIEWS Show a selection of data for a given table Combine two or more tables in meaningful ways It can be queried like a table, views are dynamic; only the definition of the view is stored, not the data Create view statement to create view CREATE VIEW (,, ... ) AS SELECT , ,... FROM WHERE ; REPLACE VIEW statement CREATE OR REPLACE VIEW view_name AS SELECT column1, column2, ... FROM table_name WHE..
2021.05.09 -
[IBM]Databases and SQL for Data Science with Python - Working with real-world datasets, Getting table and columns Details (DB2)
1. Working with csv files ; comma or semi-colon separated values 2. Querying column names with mixed case (upper and lower) - when it's mixed "Id", use double quotes 3. spaces and special characters - database may change space to underscore( _ ) and these should be within the double quotes 4. in Jupyter notebooks 5. Splitting queries to multiple lines in Jupyter: use \ %sql select "Id", "Name_of..
2021.05.07 -
[IBM]Databases and SQL for Data Science with Python - Analyzing data with Python
Load CSV file into DB2 on cloud : Source-Target-Define-Finalize data.cityofchicago.org/Health-Human-Services/Census-Data-Selected-socioeconomic-indicators-in-C/kn9c-c2s2?utm_email=Email&utm_source=Nurture&utm_content=000026UJ&utm_term=10006555&utm_campaign=PLACEHOLDER&utm_id=SkillsNetwork-Courses-IBMDeveloperSkillsNetwork-DB0201EN-SkillsNetwork-20127838 Census Data - Selected socioeconomic indic..
2021.05.02 -
[IBM]Databases and SQL for Data Science with Python - Creating Tables, loading data and querying data
How to create tables in DB2 from Python application ibm_db.exec_immediate() The parameters for the functions are: connection, statement, options stmt = ibm_db.exec_immediate (conn, "CREATE TABLE Trucks( serial_no varchar(20) PRIMARY KEY NOT NULL, model VARCHAR(20) NOT NULL, manufacturer VARCHAR(20) NOT NULL, Engine_size VARCHAR(20) NOT NULL, Truck_Class VARCHAR(20) NOT NULL) " ) How to load the ..
2021.05.02 -
[IBM]Databases and SQL for Data Science with Python - How to access DB using Python
Python : ecosystem - NumPy, panda, matplotlib, SciPy Ease of use, portable, support rdbms, DB-API, Detail document Notebook : Matlab, Jupyter, Jupyter Notebooks Language of choice, Share, Interactive Output, BIg Data integration Application program call the DBMS, handle the error etc. Writing Code using DB-API Benefits : Easy to implement and understand, encourages similarity between the Python ..
2021.05.02 -
[IBM]Databases and SQL for Data Science with Python- Week 2 & Week 3
Relational DB - Data independence DDL: Defining objects(Table)- define, change, Drop Create, alter, truncate, drop DML: Manipulating data in tables - modify, CRUD operations(Create, Remove, Update and Delete) insert, select, update, delete Create Table Statement - includes a definition of attributes in relational DB CREATE TABLE table_name ( Column_name datatype optional parameter, ...) CREATE T..
2021.05.02 -
[IBM]Databases and SQL for Data Science with Python - DML(UPDATE, INSERT, DELETE)
INSERT INTO table_name (column1, column2, ... ) VALUES (value1, value2, ... ) ; UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE condition ; DELETE FROM table_name WHERE condition ; ====================================================================================================== Insert a new instructor record with id 4 for Sandip Saha who lives in Edmonton, CA into the "I..
2021.04.28 -
[IBM]Databases and SQL for Data Science with Python- Count, Distinct, LIMIT (Practice exercises )
Practice exercises -Count, Distinct, LIMIT Now, let us practice creating and running some LIMIT related queries. Problem: Retrieve the name of the first 50 films distinctly. -> SELECT DISTINCT Title FROM FilmLocations LIMIT 50; Problem Retrieve first 10 film names distinctly released in 2015. -> SELECT DISTINCT Titel FROM FilmLocations WHERE ReleaseYear = 2015 LIMIT 10; Problem: Retrieve the nex..
2021.04.28