SQL Cheatsheet 📝
This SQL cheatsheet is designed to be your quick reference guide for SQL programming. Whether you’re a beginner learning how to query databases or an experienced developer looking for a handy resource, this cheatsheet covers essential SQL topics.
1. Database Basics
-
-
2. Tables
- Create Table:
- Drop Table:
- Alter Table:
3. Insert Data
-
4. Select Queries
- Basic Select:
- Select Specific Columns:
- Select with Condition:
5. Update Data
-
6. Delete Data
-
7. Joins
- Inner Join:
- Left Join:
- Right Join:
8. Aggregations
- Count:
- Sum:
- Group By:
9. Sorting & Limiting
- Order By:
- Limit Results:
10. Indexes
- Create Index:
- Drop Index:
11. Subqueries
-
12. Views
- Create View:
- Drop View:
Hope it helps :)
This SQL cheatsheet is designed to be your quick reference guide for SQL programming. Whether you’re a beginner learning how to query databases or an experienced developer looking for a handy resource, this cheatsheet covers essential SQL topics.
1. Database Basics
-
CREATE DATABASE db_name;-
USE db_name;2. Tables
- Create Table:
CREATE TABLE table_name (col1 datatype, col2 datatype);- Drop Table:
DROP TABLE table_name;- Alter Table:
ALTER TABLE table_name ADD column_name datatype;3. Insert Data
-
INSERT INTO table_name (col1, col2) VALUES (val1, val2);4. Select Queries
- Basic Select:
SELECT * FROM table_name;- Select Specific Columns:
SELECT col1, col2 FROM table_name;- Select with Condition:
SELECT * FROM table_name WHERE condition;5. Update Data
-
UPDATE table_name SET col1 = value1 WHERE condition;6. Delete Data
-
DELETE FROM table_name WHERE condition;7. Joins
- Inner Join:
SELECT * FROM table1 INNER JOIN table2 ON table1.col = table2.col;- Left Join:
SELECT * FROM table1 LEFT JOIN table2 ON table1.col = table2.col;- Right Join:
SELECT * FROM table1 RIGHT JOIN table2 ON table1.col = table2.col;8. Aggregations
- Count:
SELECT COUNT(*) FROM table_name;- Sum:
SELECT SUM(col) FROM table_name;- Group By:
SELECT col, COUNT(*) FROM table_name GROUP BY col;9. Sorting & Limiting
- Order By:
SELECT * FROM table_name ORDER BY col ASC|DESC;- Limit Results:
SELECT * FROM table_name LIMIT n;10. Indexes
- Create Index:
CREATE INDEX idx_name ON table_name (col);- Drop Index:
DROP INDEX idx_name;11. Subqueries
-
SELECT * FROM table_name WHERE col IN (SELECT col FROM other_table);12. Views
- Create View:
CREATE VIEW view_name AS SELECT * FROM table_name;- Drop View:
DROP VIEW view_name;Hope it helps :)
❤3
CGI Interview Questions
1) Introduce Yourself
2) What is Full Stack Development?
3) Difference between GET and POST method
4) Explain OOPs Concepts with Examples
5) What is the difference between SQL and NoSQL?
6) Explain SDLC and Agile Model
7) Describe your Final Year Project
8) Write an SQL query to count employees in each department
9) SQL query to find duplicate records in a table
10) Difference between INNER JOIN and LEFT JOIN
11) SQL query to fetch top 3 highest salaries
12) Write a program to check if a number is a palindrome
13) Write a program to check if two strings are anagrams
14) Find the missing number in a sorted array
15) Implement Stack using Array
16) What is Time and Space Complexity?
17) What are your strengths and weaknesses?
18) Why do you want to join CGI?
19) Are you open to working night shifts or relocating?
20) How do you manage deadlines or pressure?
1) Introduce Yourself
2) What is Full Stack Development?
3) Difference between GET and POST method
4) Explain OOPs Concepts with Examples
5) What is the difference between SQL and NoSQL?
6) Explain SDLC and Agile Model
7) Describe your Final Year Project
8) Write an SQL query to count employees in each department
9) SQL query to find duplicate records in a table
10) Difference between INNER JOIN and LEFT JOIN
11) SQL query to fetch top 3 highest salaries
12) Write a program to check if a number is a palindrome
13) Write a program to check if two strings are anagrams
14) Find the missing number in a sorted array
15) Implement Stack using Array
16) What is Time and Space Complexity?
17) What are your strengths and weaknesses?
18) Why do you want to join CGI?
19) Are you open to working night shifts or relocating?
20) How do you manage deadlines or pressure?
❤1
Accenture Interview Questions
1. Tell me about yourself.
2. Tell me about your project and your roles in your project
3. Are u designing the framework, so tell me the folder structure of your framework.
4. Tell me what type of framework you are using.
5. Tell me the maven command.
6. Write a program to reverse a string.
7. Open the url Amazon, search for mobiles, scroll the page two times, and find the xpath of 7th listed Mobile phone....write a generic xpath. It should work when I use the same xpath in the new tab also.
8. Suppose there are multiple mobile numbers given in a website ..how u find which are the valid mobile number and which are invalid..give count also.
9. Write a selenium program to read the data from the Excel sheet.
10. Difference between method overloading and method overriding
11. What is the primary key, and how is it different from the foreign key.
12. Http status codes
13. Http methods call
14. What is inheritance where u apply in your framework.
15. Explain the testng.xml file.
1. Tell me about yourself.
2. Tell me about your project and your roles in your project
3. Are u designing the framework, so tell me the folder structure of your framework.
4. Tell me what type of framework you are using.
5. Tell me the maven command.
6. Write a program to reverse a string.
7. Open the url Amazon, search for mobiles, scroll the page two times, and find the xpath of 7th listed Mobile phone....write a generic xpath. It should work when I use the same xpath in the new tab also.
8. Suppose there are multiple mobile numbers given in a website ..how u find which are the valid mobile number and which are invalid..give count also.
9. Write a selenium program to read the data from the Excel sheet.
10. Difference between method overloading and method overriding
11. What is the primary key, and how is it different from the foreign key.
12. Http status codes
13. Http methods call
14. What is inheritance where u apply in your framework.
15. Explain the testng.xml file.