SQL for BI

SQL for BI – Joins in SQL

Table: table_a id 1 1 1 4 5 Table: table_b id 1 1 2 3 6 SQL Code to create table and insert data USE sqlforbi; CREATE TABLE `table_a` ( `id` int NOT NULL ); CREATE TABLE `table_b` ( `id` int NOT NULL ); insert into table_a values (1); insert into table_a values (1); insert […]

SQL for BI – Joins in SQL Read More »

SQL for BI – Orders table

Table: orders order_id cust_id order_date ship_date payment_mode created_date 10001 1 2022-01-15 22:15:00 2022-01-16 09:15:00 Credit Card 15/01/22 10002 1 2022-01-24 04:15:43 2022-01-26 15:00:15 Net Banking 24/01/22 10003 4 2022-01-30 08:15:32 2022-01-30 13:15:00 Cash on Delivery 30/01/22 10004 5 2022-02-13 21:20:00 2022-02-17 14:09:10 Credit Card 13/02/22 10005 3 2022-02-14 18:00:14 2022-02-14 18:10:10 Credit Card 14/02/22 SQL

SQL for BI – Orders table Read More »

SQL

What is SQL? Acronym SQL stands for Structured Query Language used to communicate between you and the database. Data is stored in the database in the form of tables. SQL is used to Write data in a database Read (query) data stored in a database Update and insert new data Syntax for SQL depends on

SQL Read More »

SQL for BI – products table

Table: products product_id product_name list_price updated_date created_date 1 laptop 10000 2022-01-01 2021-12-01 2 office chair 2000 2022-01-01 2021-12-01 3 air purifier 5000 2022-01-01 2021-12-01 4 bluetooth speaker 1000 2022-01-01 2021-12-01 5 washing machine 6000 2022-01-01 2021-12-01 SQL Code to create table and insert data use sqlforbi; CREATE TABLE products ( product_id smallint, product_name varchar(100), list_price

SQL for BI – products table Read More »

SQL for BI – Customers table

Table: customers cust_id cust_name date_of_birth country created_date 1 Ram 1995-12-25 IN 2022-07-17 00:00:00 2 Ravi Krishna 1995-06-05 IN 2022-07-17 08:00:00 3 Raghav Krishna 1995-12-25 US 2022-07-17 21:55:00 4 Mark ABD 1985-12-18 US 2022-07-18 06:11:05 5 Peter David 1995-12-25 IN 2022-07-18 23:05:59 6 Alex ABD 1989-03-22 SG 2022-07-20 09:10:12 7 Surya Krishna 1995-11-25 US 2022-07-20 20:35:23

SQL for BI – Customers table Read More »