Lädt...


🔧 SQL Basic Question for interview


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

Let's come to the point.

I have created an Awesome SQL Interview GitHub repo to prepare for interview questions and practice SQL queries. I have divided the SQL queries into three sections: Basic (L0), Intermediate (L1), and Advanced (L2). This is the solution for the basic section.

L0: Basic SQL

  • Questions related to basic SQL commands such as SELECT, INSERT, UPDATE, and DELETE.
  • Queries related to basic data manipulation and retrieval from simple tables.

Query Questions:

  1. How do you display all columns and rows from the customers table?
  2. Write a query to retrieve only the customerName and phone from the customers table.
  3. How do you list all rows where country is 'USA' in the customers table?
  4. Write a query to find all products in the products table with a buyPrice less than 50.
  5. How do you fetch all orders with a status of 'Shipped' from the orders table?
  6. Write a query to display the productName and quantityInStock for all products in the products table.
  7. How do you find the distinct country values in the customers table?
  8. Write a query to count the total number of customers in the customers table.
  9. How do you retrieve all employees whose jobTitle is 'Sales Rep'?
  10. Write a query to sort the products table by productName in ascending order.
  11. How do you fetch the customerName and city of all customers located in 'Paris'?
  12. Write a query to display the top 10 orders from the orders table based on the orderDate.
  13. How do you retrieve all offices located in the USA?
  14. Write a query to display all employees who work in the office located in 'San Francisco'.
  15. How do you calculate the total number of orders placed in the orders table?
  16. Write a query to display the productName of all products in the products table where productLine is 'Classic Cars'.
  17. How do you find the customerName of all customers whose creditLimit is greater than 50,000?
  18. Write a query to fetch all products that have a quantityInStock between 10 and 100.
  19. How do you retrieve all orders placed in the year 2024?
  20. Write a query to display the employeeNumber and firstName of employees whose last names start with 'B'.

Solution with explanation

  1. How do you display all columns and rows from the customers table?
    Image description

  2. Write a query to retrieve only the customerName and phone from the customers table.
    Jaimin Bariya, Cloud Boy

  3. How do you list all rows where country is 'USA' in the customers table?
    Jaimin Bariya, Cloud Boy

  4. Find all products in the products table with a buyPrice less than 50.
    Jaimin Bariya, Cloud Boy

  5. Fetch all orders with a status of 'Shipped' from the orders table?
    Jaimin Bariya, Cloud Boy

  6. Display the productName and quantityInStock for all products in the products table.
    Jaimin Bariya, Cloud Boy

  7. Find the distinct country values in the customers table?
    Jaimin Bariya, Cloud Boy

  8. Count the total number of customers in the customers table.
    Jaimin Bariya, Cloud Boy

  9. Retrieve all employees whose jobTitle is 'Sales Rep'?
    Jaimin Bariya, Cloud Boy

  10. Sort the products table by productName in ascending order.
    Image description

  11. Fetch the customerName and city of all customers located in 'Paris'?
    Jaimin Bariya, Cloud Boy

  12. display the top 10 orders from the orders table based on the orderDate.
    Jaimin Bariya, Cloud Boy

  13. Retrieve all offices located in the USA?
    Jaimin Bariya, Cloud Boy

  14. Display all employees who work in the office located in 'San Francisco'.
    Jaimin Bariya, Cloud Boy

  15. Calculate the total number of orders placed in the orders table?
    Jaimin Bariya, Cloud Boy

  16. Display the productName of all products in the products table where productLine is 'Classic Cars'.
    Jaimin Bariya, Cloud Boy

  17. Find the customerName of all customers whose creditLimit is greater than 50,000?
    Jaimin Bariya, Cloud Boy

  18. Fetch all products that have a quantityInStock between 10 and 100.
    Jaimin Bariya, Cloud Boy

  19. Retrieve all orders placed in the year 2003?
    Jaimin Bariya, Cloud Boy

  20. Display the employeeNumber and firstName of employees whose last names start with 'B'.
    Jaimin Bariya, Cloud Boy

Hey, My name is Jaimin Baria AKA Cloud Boy..., If you have enjoyed and learned something useful, like this post, add a comment, and visit my Awesome SQL Interview GitHub repo.

Don't forget to give it a start 😅.

Happy Coding 🧑‍💻

...

🔧 Basic SQL Question for Interview, everyone should know


📈 29.64 Punkte
🔧 Programmierung

🔧 SQL Basic Question for interview


📈 29.64 Punkte
🔧 Programmierung

🔧 Top 25 SQL Interview Question for SDET


📈 20.5 Punkte
🔧 Programmierung

🔧 13 Basic Terms In SQL That Basically Ask in Interview.


📈 19.91 Punkte
🔧 Programmierung

🔧 SQL Basic And Intermediate Questions For Interview


📈 19.91 Punkte
🔧 Programmierung

📰 Rational or Not? This Basic Math Question Took Decades To Answer.


📈 18.88 Punkte
📰 IT Security Nachrichten

📰 OpenAI's stock investing GPTs fail this basic question about stock investing


📈 18.88 Punkte
📰 IT Nachrichten

🐧 Basic question on creating a sudo user


📈 18.88 Punkte
🐧 Linux Tipps

🎥 What can I do with Visual Basic in .NET 5? | One Dev Question


📈 18.88 Punkte
🎥 Video | Youtube

📰 Salt--basic question


📈 18.88 Punkte
📰 IT Security Nachrichten

📰 iPhone personal hotspot security (terribly basic question, sorry in advance)


📈 18.88 Punkte
📰 IT Security Nachrichten

📰 iPhone personal hotspot security (terribly basic question, sorry in advance)


📈 18.88 Punkte
📰 IT Security Nachrichten

🕵️ Basic Reverse Engineering | TryHackMe Basic Malware RE


📈 18.28 Punkte
🕵️ Reverse Engineering

🕵️ Low CVE-2012-5570: Basic webmail project Basic webmail


📈 18.28 Punkte
🕵️ Sicherheitslücken

📰 Could We Fund a Universal Basic Income with Universal Basic Assets?


📈 18.28 Punkte
📰 IT Security Nachrichten

🕵️ Medium CVE-2017-17642: Basic job site script project Basic job site script


📈 18.28 Punkte
🕵️ Sicherheitslücken

🕵️ Medium CVE-2017-17600: Basic b2b script project Basic b2b script


📈 18.28 Punkte
🕵️ Sicherheitslücken

🍏 Chipmunk Basic 1.368.22 - BASIC interpreter.


📈 18.28 Punkte
🍏 iOS / Mac OS

🔧 Data base handle interview question


📈 17.24 Punkte
🔧 Programmierung

🔧 For all the Developers! 🐍💻 | The Best Interview Coding Question 🚀🤖


📈 17.24 Punkte
🔧 Programmierung

🔧 Javascript Interview Question Explanation- Object Properties


📈 17.24 Punkte
🔧 Programmierung

🔧 Average City Temperature Calculation Interview Question EPAM


📈 17.24 Punkte
🔧 Programmierung

🔧 🚨 (Amazon) Interview Alert: I Just Decoded a Tricky JavaScript Question in 2 Minutes!


📈 17.24 Punkte
🔧 Programmierung

🔧 Common Interview Question: Swapping Two Numbers Without a Temporary Variable in Java


📈 17.24 Punkte
🔧 Programmierung

🔧 React Interview HTML Table Question


📈 17.24 Punkte
🔧 Programmierung

🔧 What's the Worst Question You've Ever Been Asked in an Interview?


📈 17.24 Punkte
🔧 Programmierung

🔧 Popular interview question: What is the difference between Process and Thread ?


📈 17.24 Punkte
🔧 Programmierung

🔧 INTERVIEW Question : Local Storage - Access between Tabs


📈 17.24 Punkte
🔧 Programmierung

🔧 Java Stream Scenario Based Interview Question


📈 17.24 Punkte
🔧 Programmierung

🔧 Java logical interview question | Sum a list but ignore any duplicates codewars java solution


📈 17.24 Punkte
🔧 Programmierung

🔧 Tricky JavaScript Interview Question Using Array And Object Destructuring Combined


📈 17.24 Punkte
🔧 Programmierung

🔧 Designing Twitter – A System Design Interview Question


📈 17.24 Punkte
🔧 Programmierung

🔧 Interview Question: Tell me when you decided to make short-term sacrifices for long-term gains.


📈 17.24 Punkte
🔧 Programmierung

matomo