SQL and Bible Studies:- Books in each Genre

Background The Bible is a collection of books. One can categorize the books in so many different ways. In this post, we will use someone else work. He has categorized bible books into genres.   SQL The work avails a couple of database platforms. In this post, we will provide working samples for Transact SQL … Continue reading SQL and Bible Studies:- Books in each Genre

MySQL – Using “Load Data” Statement

Background Let us load data into our MySQL using it's native "Load Data" statement. Outline Data Source Identify Data Source Review Data Download Data Tools CURL Prepare Target Storage Create Tables Create Staging Table Create Actual Table Load Data Load data into staging table Move data from staging table into actual table Tasks Data Source … Continue reading MySQL – Using “Load Data” Statement

MySQL:- Stored Procedure – Simple Insert Statement w/ Identity Key

Background Let us create a simple Stored Procedure in MySQL.   Code Table department SQL Stored Procedure departmentAdd Outline Add Department Arguments Department Name ( name ) Insert Record Capture Identity Value (¬† LAST_INSERT_ID() ) Return Assigned identity value as idAssigned SQL Invoke Output Output - Department Output - Department - Last Added   Code … Continue reading MySQL:- Stored Procedure – Simple Insert Statement w/ Identity Key

MySQL:- Group_Concat Function

Background When viewing data an aggregated view can sometimes be easier to read.   Data Model ER-Diagram Images   Data Presentation Images Detail   Summary   GROUP_CONCAT MySQL offers an option for aggregating data through its GROUP_CONCAT function. Code SQL Source Code Control GitHub Gist DanielAdeniji/MySQLGroupConcatFunction.sql Link

MySQL:- Date Types & Sizes

Background Playing around more with MySQL and wanted to see why a certain implementation specification was chosen over another. I really struggled to make sense of things. Date Types & Sizes There are a couple of types that one can use for date & time in MySQL. Inclusive:- time date datetime timestamp Code Output  

MySQL:- Functions

Background Wanted to cover a couple of MySQL System Functions.   System Functions   Category Use Function Name Syntax Sample Data Date and Time Functions Current Date CurDate curdate() 2020-08-24 current_date current_date() 2020-08-24 Current Time CurTime curtime() 09:27:01 current_time current_time() 09:27:01 Day Function Day of the Month day day(curdate()) 24 Day Name dayname dayname(curdate()) Monday … Continue reading MySQL:- Functions

MySQL – Sample – Sakila – Adding new customer record

Background Wanted to see how hard it will be to play around with the sakila MySQL Database. Objective Our objective will be to add a couple of records to the sakila.customer table. Because the table has a couple of foreign keys, we need to get a handle to valid entries in those tables, as well. … Continue reading MySQL – Sample – Sakila – Adding new customer record