Coder Baba
Kanalga Telegramβda oβtish
Everything about programming for beginners. 1 and only official telegram channel of CODERBABA India. Content: .NET Developer, Programming (ASP. NET, VB. NET, C#, SQL Server), & Projects follow me https://linktr.ee/coderbaba *Programming *Coding *Note
Ko'proq ko'rsatish2 187
Obunachilar
-624 soatlar
-87 kun
-2230 kun
Postlar arxiv
2 187
π Master SQL for Interviews! π
π‘ SQL Challenge: Ready to test your skills? Hereβs a commonly asked SQL Interview Question that you must know to ace your next job interview! π
π₯ Question:
Write a SQL query to calculate the cumulative sum of sales for each employee. The result should include:
π EmployeeID
π SaleDate
π CumulativeSales
--SQL Code to Create the Table:
CREATE TABLE Sales (
EmployeeID INT,
SaleDate DATE,
SaleAmount DECIMAL(10, 2)
);
--Insert Sample Data into the Table
INSERT INTO Sales (EmployeeID, SaleDate, SaleAmount) VALUES
(1, '2024-01-01', 100.00), -- Employee 1 made a sale of 100 on Jan 1
(1, '2024-01-02', 150.00), -- Employee 1 made another sale on Jan 2
(1, '2024-01-03', 200.00), -- Employee 1 made another sale on Jan 3
(2, '2024-01-01', 120.00), -- Employee 2 made a sale on Jan 1
(2, '2024-01-02', 180.00), -- Employee 2 made another sale on Jan 2
(3, '2024-01-01', 200.00), -- Employee 3 made a sale on Jan 1
(3, '2024-01-03', 100.00), -- Employee 3 made a sale on Jan 3
(3, '2024-01-04', 50.00); -- Employee 3 made another sale on Jan 4
β¨ Hereβs the SQL Query Solution:
WITH CumulativeSales AS (
SELECT
EmployeeID,
SaleDate,
SaleAmount,
(SELECT SUM(SaleAmount)
FROM Sales AS S2
WHERE S2.EmployeeID = S1.EmployeeID
AND S2.SaleDate <= S1.SaleDate) AS CumulativeSales
FROM Sales S1
)
SELECT
EmployeeID,
SaleDate,
SaleAmount,
CumulativeSales
FROM CumulativeSales
ORDER BY EmployeeID, SaleDate;
π For a detailed explanation and additional learning, watch my YouTube video: π₯
https://youtu.be/baWTD9S0dpY
π Follow for More Insights: @coder_baba
π Don't forget to share this post with others preparing for technical interviews!
#SQLInterviewQuestions #DatabaseSkills #SQLServer #LearnSQL #InterviewPreparation #CumulativeSum #CodingTips #coderbaba
2 187
π Join Us on Facebook! π
Hey there, amazing people! π
Iβve just launched my Facebook page dedicated to bringing you awesome content, including funny reactions, daily vlogs, and much more! π₯π₯ If you love a good laugh and exciting reactions, come join the Stardust React community! π
Click here to follow and be a part of the fun:
π https://www.facebook.com/coderbaba
2 187
essential sql interview questions
1 Explain Order of Execution of SQL query
2 Provide a use case for each of the functions Rank, Dense_Rank & Row_Number
3 Write a query to find the cumulative sum/Running Total
4 Find the Most selling product by sales/ highest Salary of employees
5 Write a query to find the 2nd/nth highest Salary of employees
6 Difference between union vs union all
7 Identify if there any duplicates in a table
8 Scenario based Joins question, understanding of Inner, Left and Outer Joins via simple yet tricky question
9 LAG, write a query to find all those records where the transaction value is greater then previous transaction value
10 Rank vs Dense Rank, query to find the 2nd highest Salary of employee ( Ideal soln should handle ties)
11 Write a query to find the Running Difference (Ideal sol'n using windows function)
12 Write a query to display year on year/month on month growth
13 Write a query to find rolling average of daily sign-ups
14 Write a query to find the running difference using self join (helps in understanding the logical approach, ideally this question is solved via windows function)
15Write a query to find the cumulative sum using self join
(helps in understanding the logical approach, ideally this question is solved via windows function
#coderbaba #SQLTips
follow @coder_baba
2 187
Master Expense Management System in C# | One-Shot Full Tutorial + Free Code For Members Onlyπ
2 187
π° Master Expense Management System in VB.NET & SQL Server π | Full Tutorial
https://youtu.be/odGyzCKo7E0
#ExpenseManagement
#VBNet
#SQLServer
#ExpenseTracker
#DatabaseApp
#FinanceApp
#DesktopApplication
#BudgetingApp
#LearnVBNet
#ProgrammingTutorial
#VisualBasicNet
#SQLDatabase
#CodingMadeEasy
#FinanceTracker
#CRUDOperations
#DeveloperCommunity
#DatabaseDevelopment
#AppDevelopment
#SQLIntegration
#SoftwareProjects
2 187
π» Linux Commands Cheat Sheet π»
π ls: List files and directories in the current directory.
Example: ls
π cd: Change directory.
Example: cd /path/to/directory
π pwd: Show the current directory.
Example: pwd
π mkdir: Create a new directory.
Example: mkdir new_directory
π rm: Remove files and directories.
Example: rm file.txt
π cp: Copy files and directories.
Example: cp file.txt /path/to/destination
βοΈ mv: Move or rename files and directories.
Example: mv file.txt /path/to/destination
π touch: Create an empty file.
Example: touch file.txt
π cat: Display the contents of a file.
Example: cat file.txt
π grep: Search for a pattern in a file.
Example: grep "pattern" file.txt
π head: Display the first few lines of a file.
Example: head file.txt
π tail: Display the last few lines of a file.
Example: tail file.txt
π chmod: Change file permissions.
Example: chmod 755 file.txt
π€ chown: Change file ownership.
Example: chown user:group file.txt
π ln: Create a symbolic link.
Example: ln -s /path/to/file link
π find: Search for files and directories.
Example: find /path/to/search -name "pattern"
π¦ tar: Archive files and directories.
Example: tar -czvf archive.tar.gz files/
π unzip: Extract files from a zip archive.
Example: unzip archive.zip
π man: Access command manuals.
Example: man ls
π history: View command history.
Example: history
βοΈ ps: Show running processes.
Example: ps aux
β kill: Terminate a process.
Example: kill PID
πΎ df: Show disk space usage.
Example: df -h
π du: Check directory sizes.
Example: du -sh directory
π scp: Securely copy files between hosts.
Example: scp file.txt user@remote:/path/to/destination
π ssh: Connect to a remote host securely.
Example: ssh user@host
π ping: Test network connectivity.
Example: ping google.com
π§ ifconfig: Display network interface info.
Example: ifconfig
π wget: Download files from the web.
Example: wget https://example.com/file.txt
π curl: Transfer data to/from a server.
Example: curl https://example.com
Follow @coder_baba
#coderbaba #CoderBaba #linux
2 187
π Linux Commands Interview Q&A
π 1. What is Linux?
π§ Linux is an open-source operating system kernel forming the base for various distributions.
π§ 2. Main components of a Linux system?
Kernel, shell, and file system.
π» 3. Role of the Linux Kernel?
Manages system resources and provides services to applications.
π₯ 4. What is a shell?
Command-line interpreter for interacting with the OS.
π 5. Popular Linux distributions?
Ubuntu, Debian, Fedora, CentOS, and Red Hat Enterprise Linux.
π‘ 6. Changing file permissions?
Use chmod (e.g., chmod 755 filename) to set permissions.
π 7. Purpose of the "grep" command?
Searches for specific patterns within files.
π 8. Finding files?
Use find command based on criteria like name, size, and permissions.
π 9. What is the "top" command for?
Monitors system processes and resource usage in real-time.
πΎ 10. Checking disk usage?
df command shows disk space usage of file systems.
π 11. What is a symbolic link?
A soft link pointing to another file or directory.
π¦ 12. Purpose of the "tar" command?
Creates and manipulates archive files.
βοΈ 13. Starting and stopping services?
Use systemctl (e.g., systemctl start service_name) in systemd systems.
π 14. Purpose of the "ping" command?
Tests connectivity between a source and destination.
π 15. Checking network configuration?
ifconfig or ip command for network settings.
π 16. What is SSH?
Secure remote login and file transfer using encryption.
π 17. Killing a process?
kill command with process ID (PID) or killall by name.
π 18. Purpose of "rsync"?
Efficient file synchronization and transfer.
π 19. Checking hardware information?
lshw provides detailed hardware info.
π¨ 20. What is a firewall?
Controls network traffic for security.
πΆ 21. Checking system IP address?
ip addr command displays IPs for network interfaces.
β° 22. Purpose of "cron"?
Automates and schedules recurring tasks.
π 23. Mounting a filesystem?
mount command attaches a filesystem to the directory tree.
π 24. What is "chroot"?
Creates a separate environment with its own root directory.
π 25. Compressing and decompressing files?
gzip and gunzip for compression.
π 26. Purpose of "iptables"?
Configures the kernel firewall for network traffic filtering.
π‘ 27. Checking CPU usage?
Use top, htop, or mpstat.
π€ 28. Creating user accounts?
useradd command adds new users.
π 29. Searching within files?
grep -r to search recursively within files in a directory.
πΎ 30. Checking available memory?
free command shows free and used memory in the system.
#coderbaba #CoderBaba #Programming #linux
2 187
π Join the TopMate Community! π
Iβm excited to invite you to be part of the TopMate community, where innovation meets collaboration! π
TopMate offers an incredible platform to connect with like-minded individuals, share knowledge, and elevate your skills in programming and beyond. Whether you're a beginner or an experienced developer, this is the place for you!
β¨ Why Join?
πΉ Networking opportunities
πΉ Access to exclusive resources
πΉ Collaborative projects
πΉ Expert insights and mentorship
Donβt miss out on this chance to grow your skills and connect with a vibrant community!
π Join now using my referral link: topmate.io/join/coderbaba π
Letβs learn and grow together! πͺπ»
2 187
π Exciting news! πI'm thrilled to announce that I am now live on Topmate! π» As a mentor and leader in my field, I'm passionate about giving back to the community and helping others reach their goals. ππΌ Whether you're looking for career advice or expert guidance in your industry, I am here to support you through my Topmate page. π‘ Let's connect and achieve greatness together! #Mentorship #
