Posts

Showing posts with the label Directory

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

6 Python Directory Commands Useful to Read

Image
Here's logic to create Python Directory . You need to import the 'OS' package to create Python directory. Here're the list of Python directory commands. Python How to Create Directory Here's Logic You can create and delete directories in Python. Here's the helpful logic you can use for your projects. For this, you need to import 'os'.  Python Directories 1. How to Create a Directory Import os  os.mkdir('datafiles') 2. How to Change Directory os.chdir('newdirectory') 3. How to Create a Directory and then Create a file in it import os  os.mkdir('datafiles/newfiles');  os.chdir('datafiles/newfiles');  fp=open('input.txt', 'w')  fp.write('Hello, Welcome to Programming in Python')  fp.close() 4. How to Know Present Working Directory os.getcwd() 5. How to delete a directory os.rmdir('directoryname') 6. How to get the List of Directories os.listdir() Keep Reading You May Also Like:   55 Best Gift I