Posts

Featured Post

SQL Interview Success: Unlocking the Top 5 Frequently Asked Queries

Image
 Here are the five top commonly asked SQL queries in the interviews. These you can expect in Data Analyst, or, Data Engineer interviews. Top SQL Queries for Interviews 01. Joins The commonly asked question pertains to providing two tables, determining the number of rows that will return on various join types, and the resultant. Table1 -------- id ---- 1 1 2 3 Table2 -------- id ---- 1 3 1 NULL Output ------- Inner join --------------- 5 rows will return The result will be: =============== 1  1 1   1 1   1 1    1 3    3 02. Substring and Concat Here, we need to write an SQL query to make the upper case of the first letter and the small case of the remaining letter. Table1 ------ ename ===== raJu venKat kRIshna Solution: ========== SELECT CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name, 2))) AS capitalized_name FROM Table1; 03. Case statement SQL Query ========= SELECT Code1, Code2,      CASE         WHEN Code1 = 'A' AND Code2 = 'AA' THEN "A" | "A

Five top SQL Query Performance Tuning Tips

Image
SQL query runs faster when you write it in a specific method. You can say it as tuning. There are five tuning tips: List of Performance Tuning Tips use index columns, use group by, avoid duplicate column in SELECT & Where, use Left Joins use a co-related subquery. Five top SQL Query Performance Tuning Tips SQL Performance Tuning Tip: 01 Use  indexes in the where clause of SQL . Let me elaborate more on that. Be sure the columns that you are using in the WHERE clause should be already part of the Index columns of that database Table. An example SQL Query: SELECT *  FROM emp_sal_nonppi WHERE dob <= 2017-08-01; SQL Performance Tuning Tip: 02 Use GROUP BY . Some people use a  DISTINCT clause to eliminate duplicates . You can achieve this by GROUP BY. An example SQL Query: SELECT E.empno, E.lastname FROM emp E,emp_projact EP WHERE E.empno = EP.empno GROUP BY E.empno, E.lastname; SQL Performance Tuning Tip: 03 Avoid using duplicates in the Query. Some people use the same col

AI Project 5 things You need to be Successful

Image
Suppose you have got an opportunity to create a project on AI. Try implementing these five before the start. These five are Learning, Programming Language, Knowledge representation, Problem Solving, and Hardware. Ensure These 5 Things Done, if you want to be your AI Project Successful 1. Learning Process. What is learning? - adding knowledge to the storehouse, and improving its performance. The success of an AI program depends on two things- the extent of wisdom it has and how frequently it acquires it. Learning agents consist of four main components. They are the: The Learning element - is part of the agent responsible for improving its performance.  The Performance element - is the part that chooses the actions to take.  Critics , that tell the learning element of how the agent is doing.  The Problem generator - suggests actions that could lead to new information experiences. 2. Programming Language. LISP and Prolog are the primary languages used in AI programming. LISP (List Pro

Python Supports These 5 Native Data types

Image
Python supports five native data types. The Data types are such that a Programmer can use to write the logic and get the output. Many beginners may not aware of native data types. So I am adding a short note on that here. Native means as is Python supported data types. Python Five Key Native Data Types Python Native Data Types In Python, you can find five types of native data types. Here is a quick list for you. Those are Number, String, List, Tuple, Set, and Dictionary. 1. Number For all the numeric values,  you can use this data type. 2. String It handles all Characters, Special-symbols, and Alphanumeric values. 3. List It is something like sequential data. A program can do Sort, Merge, etc. on this data. 4. Tuple Data is a little different from the List. 5. Set This kind of Data-type helps you to do set operations. Those are like Intersection, Difference, etc. 6. Dictionary Here, the Dictionary something like a group of List kinds of data. But, each value has a key associated with i

Python: Store Multiple Values in a Variable

Image
In Python, you can assign values to the variables. This post tells you how to assign values to multiple variables. It is common assigning values in any programming language. But Python simplifies your job by introducing this technic. Here is  Python For Loop Tricky Example . Python Assigning the Values At once. a = 1 b = 1 c = 1 d = 1 or, you can assign simultaneously as; a=b=c=d=1 Python Assigning Multiple Values at Once The other way you can assign as; a, b, c, d = 10, 1, 3.5, 'Srini' From the above, you can understand as below: The '10' assigns to a. The '1' assigns to b. The '3.5' assigns to  c. Then 'Srini' to d.  References Python Basics Variable Assignment

How to Decode TLV Quickly

Image
TLV format contains three parts Tag, Length, and value. In a credit card or financial transactions, the TLV protocol supports this format. Below, you will find the ideas to decode TLV data quickly.  According to IBM , the tag tells what type of data it is. The length field denotes the length of the value. The value-field denotes the actual value. Structure of TLV. TLV comprises three field values. Tag Length Value How to Decode TLV The EMV labs developed tags which in turn part of EMV protocol. Each tag has an unique meaning. And the Tag and Length together takes 1 to 4 bytes of memory. 1. The Best example for TLV. Below is the way to decode the EMV tag. The first part of the TLV format is TAG. The second part is LENGTH, and finally the VALUE. Syntax of EMV tag: [Tag][Value Length][Value] (ex. " 9F40 05 F000F0A001 ") where,  Tag Name =  9F40 Value Length (in bytes) =  05  Value (Hex representation of bytes. Example, "F0" – 1-byte) =  F000F0A001 Finally, what is 9F40

Machine Learning The Best Book for Beginners

Image
You need a mix of different technologies for Data Science projects. Instead of learning many skills, just learn a few. The four main steps of an ML project are extracting the data, model development, artificial intelligence, and presentation. Attending interviews with many skills is not so easy. So keep the skills short. Best Machine Learning Book for Beginners A person with many skills can't perform all the work. You had better learn a few skills like Python, MATLAB, Tableau, and RDBMS. So that you can get a job quickly in the data-science project. Out of Data Science skills, Machine learning is a new concept. Why because you can learn Python, like any other language. Tableau also the same. Here is the area that needs your 60% effort in Machine learning.   Machine Learning The Best Book. Related Posts How to write multiple IF-conditions in Python Simplified

Python 'getsizeof' Command the Real Purpose

Image
Here's a sample python program to get the size of a List array.  Getting the number of elements present in a List is not easy. So how to get this? To do you need the 'getsizeof' command. Import 'sys' Library. You need to import the 'sys' library to use the SIZE commands.  >>> import sys Congrats to you since you have now imported the SYS library. The command name is " getsizeof" . Check the below example. print("An Integer:") i = int(100) print(sys.getsizeof(i)) The result will be: 100 What is the size command?  - is to get the size of elements. It gives the result based on the object you are being used. Suppose, if you use Strings, you will get String length. How to use the  'getsizeof' command? Example:1 print("Empty string:") empty_string = "" print(sys.getsizeof(empty_string)) Example:2 print("A normal string") s = "Hello world" print(sys.getsizeof(s)) Example:3 print("Incr