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

Unix Special Keys That Improve Productivity

Image
Shared the UNIX terminal shortcut keys. These special keys you can use to stop the program processing, or resume it. An example of a UNIX special key and its use. Special Keys in UNIX much useful to take action when something happens. A scenario where you made some mistake in the input command and you need to stop the further process. Then you can use the CTRL+C command. It is equal to the DELETE command. Unix Keyboard Shortcuts or Special Keys. RETURN key  The RETURN key signifies the end of a line of input. On any terminal, RETURN has a key of its own, or return may be typed by holding down the control key and typing a 'm'. CTRL-m Key Hint: Ctrl-m command is equal to RETURN key in Unix systems DELETE Key The DELETE key stops a program/command immediately, without waiting for it to finish. DELETE can be achieved equivalently with ctrl-c. Hint: Ctrl-c Command you can use to interrupt the process. CTRL-s Key Ctrl-s pauses the output and the program is suspended until you sta

10 Top Unix Disk Space Quiz Questions

Image
I have listed 10 top Quiz questions on UNIX disk space. These questions help you to understand about disk-related concepts quickly. Unix Disk Space QUIZ Questions. Below listed 10 quiz questions help you to know the disk-space related concepts. 1. All devices are considered as files in Unix. Yes 2. All device files are stored in /etc or in its subdirectories. No 3. CD-ROM is a character device. No 4. The printer is a character device. Yes 5. The minor number represents the type of device. No 6. The dd command is used for copying data from one medium to another. Yes 7. The term bs in the dd command stands for block size. Yes 8. The du utility displays complete information about the usage of disk space by each file and directory. Yes 9. By default, the du command displays information in terms of 1024-byte blocks. No 10. The df command reports only the free disk space of the file system installed on our machines. Yes Keep Reading Top vi Editor Commands for Ubuntu

Vi Editor to Quit use Esc and Colon

Image
Here are vi editor commands you can use to quit from Vi editor with or without saving your work. These are useful to use in day-to-day work. w => To Save Your Work q => To Quit wq => To Save and Quit q! => To quit without saving vi editor also called Visual editor in terms of Unix or Linux or Ubuntu Operating systems. Since all are the same UNIX flavor, and UNIX is the mother of all these operating systems. Recently many of my friends asked to share some daily use vi editor commands . I am sharing those for your quick reference. 6 Top vi Editor Commands 1. How to Edit a file? vi filename This is the first command to use for editing a file. 2. A command to Repeat Previous Command? Use the  UP arrow to repeat the previous command. 3. How to Insert data? Use insert command to over-type data. 4. How to Save File? Press Esc then :w 5. How to Save and Quit (Exit)? Press Esc then :wq 6 How to quit without Save? Press Esc then :q!

These Tips Helpful to Remove Python List and Dictionary Duplicates

Image
In this post, I have shared top ideas to remove duplicates from the list. Those are with Append and Dictionary. 1. How to Remove Duplicates with Append # Here is a list with duplicates list_with_duplicates = [1,2,3,12,1,2,3,4,5,6,1,2,3,7,8,9] It is simple if you follow the first-approach - brute force approach: list_without_duplicates = [] for pd in list_with_duplicates:   if pd not in list_without_duplicates:       list_without_duplicates.append(pd) print(list_without_duplicates) Result: [1, 2, 3, 12, 4, 5, 6, 7, 8, 9] This method has performance issues when the list is bigger in size.  Real-time. 2. How to Remove Duplicates with Dictionary # Here is you can convert a list to a dictionary dict_without_duplicates = dict(zip(list_with_duplicates, list_with_duplicates)) print(dictionary_without_duplicates) Result: {1: 1, 2: 2, 3: 3, 12: 12, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9} Real-time. Once again, this works and has the advantage of taking less space than duplicating the entire list. 

Python Function: How to Write Error Logic

Image
Here's an example python user-defined function. Here, you'll know how to write error conditions. The best examples is if and else. I have shared the logic here for your reference. Python is one of the top programming languages. Python does support Functions . While writing functions you also need to consider some errors. Those are called exceptions. I am explaining how to give error logic in a function of Python. Exception-handling means to have logic for error scenarios. Writing exception I will show in a simple Function. In this post I will give you syntax for writing function and exception.  Here is my simple Function that multiplies two numbers. Logic to write Function in Python to Multiply Two Numbers  def product (num1,num2): prod=num1*num2 print( ' The product of the numbers is \t: '+str(prod) Parameters used the Python Function The 'def' means you are defining function with a name of 'product'. In the parameters of 'product', you can s

5 Super SEO Blogger Tools

Image
Here are the super free blogger SEO tools that every blogger needs. These tools simplify your effort to write SEO -friendly blog posts. These five free blogger SEO tools make your blog post wonders in google search. And, indexing of your post also faster. Blogger Tool #1: Headline Analyzer The best tool is the EMV Headline Analyzer . When you enter the headline, it analyzes and gives you an EMV ranking. When you get '50' or above to that, it appears quickly in Google search.   Blogger Tool #2: Headline Length Checker The usual headline length is 50 to 60 characters. Beyond that, the headline will get truncated and looks ugly for search engine users.  The SERP Snippet Optimization  Tool useful to know how it appears in the search results. Blogger Tool #3: Free Submission to Search Engines The tool  Ping-O-Matic  is a free submission tool. After your blog post, you can submit your feed to Ping-O-Matic. It does submit to search engines freely. Blogger Tool #4: Spell and Gramma

4 Top Python Oops Concepts Simplify Your Coding

Image
Oops concepts in Python explained in this post. Python supports Encapsulation, Inheritance, Abstraction, Polymorphism and Dynamic binding. These simplify your coding effort. I have given examples on Python Oops ( Object oriented) concepts. Python Oops  (Object oriented) Concepts Encapsulation Data hiding and abstraction Inheritance Polymorphism (overloading/overriding) The fifth Python special property is Dynamic binding. You May Also Like: 12 Frequently Asked Questions on Python #1 Python Oops Encapsulation Wrapping of data and functions in a single unit is called Encapsulation. #2 Python Oops Data Hiding and abstraction User program refers to methods from an object is called abstraction. Keeping all the methods under one object called data hiding. #3 Python Oops Inheritance Inhering properties means, referring property of an object of a class from an Object of the other Class. #4 Python Oops Polymorphism Poly means many. The definition of one function can use for man