sql

| |

Using Subqueries To Join 2 More Tables Which Do Not Have Unique Primary and Foreign Keys

Using Subqueries to join 2 more tables which do not have distinct values in a column We want to find the number of Flight bookings by Country, number of Car bookings by Country and the number of Hotel bookings by Country all appearing in one table with same country on one row. We want to…

|

Rank a Place Visited By a Customer- Microsoft SQL Server – T-Transact

This is a short guide to getting ranking or rating from Microsoft Sql Server customers. Ranking is taken by checking how many times a customer has visited a particular country divided by the total number of travels the customer has made within the database   /*make a back up of the recommender rankings table*/ truncate…

|

Splitting Values in one Column to Multiple Columns using CASE Expression Statement SQL Server

Sometimes, you would want to split values in a column into separate rows  in SQL server.  This is a simple guide. Lets check the fields in the table we will be working with. select [orderID] ,[itemType] ,[price] ,[quantity] from [Antrak].[dbo].[ClothingSale] Let’s check the result:   We can see that the itemType field has different values…

|

MySQL – Summarizing Data – SUM COUNT -MIN -MAX – AVG – DOGNITION Database

Summarizing  Data This week we are looking at five most common aggregate functions used to summarize information stored in tables: COUNT and SUM very frequently. COUNT is the only aggregate function that can work on any type of variable. The other four aggregate functions are only appropriate for numerical data. All aggregate functions require you…

Teradata Viewpoint – SQL Scratchpad – Writing Queries Dillard’s Department Store Database
| |

Teradata Viewpoint – SQL Scratchpad – Writing Queries Dillard’s Department Store Database

Analysing ‘Big Data’ from a database with real world data requires retrieving data from the database by writing relevant queries. As part of “Managing Big Data with MySQL” by Duke University on Cousera, I dealt with real world data that comprise hundreds to millions of entries/rows. This is the database of Dillard’s Department stores, specifically, the UA_DILLARDS that contains…