Nlogn Profile picture
Nov 24, 2020 25 tweets 9 min read Read on X
SQL INTERVIEW QUESTION CHEATSHEET.

SQL is the most popular database and many popular websites use SQL. So, here is a collection of the most asked #SQL interview questions to help you prepare.

Please RT for reach and bookmark for easy recall.

🧵A Thread 🧵

#100DaysOfCode
1. What is Database?

A database is an organized collection of data, stored and retrieved digitally from a remote or local computer system. Databases can be vast and complex, and such databases are developed using fixed design and modeling approaches.

#100DaysOfCode
2. What is DBMS?

DBMS stands for Database Management System. DBMS is a system software responsible for the creation, retrieval, updating, and management of the database.

#100DaysOfCode
3. What is SQL?

SQL stands for Structured Query Language. It is the standard language for relational database management systems. It is especially useful in handling organized data comprised of entities and relations between different entities of the data.

#100DaysOfCode
4. What is the difference between SQL and MySQL?

SQL is a standard language for retrieving and manipulating structured databases. On the contrary, MySQL is a relational database management system, like #SQL Server, Oracle, that is used to manage SQL databases.

#100DaysOfCode
5. What are Tables and Fields?

A table is an organized collection of data stored in the form of rows and columns. Columns can be categorized as vertical and rows as horizontal. The columns in a table are called fields while the rows can be referred to as records

#100DaysOfCode
6. What is a Primary Key?

The PRIMARY KEY constraint uniquely identifies each row in a table. It must contain UNIQUE values and has an implicit NOT NULL constraint.

A table in SQL is strictly restricted to have one and only one primary key.

#100DaysOfCode
7. What is a UNIQUE constraint?

A UNIQUE constraint ensures that all values in a column are different. This provides uniqueness for the column(s) and helps identify each row uniquely. Unlike the primary key, there can be multiple unique constraints defined per table.
8. What is a Foreign Key?

A FOREIGN KEY comprises of single or collection of fields in a table that essentially refers to the PRIMARY KEY in another table. Foreign key constraint ensures referential integrity in the relation between two tables.

#100DaysOfCode
9. What is a Join? List its different types.

The SQL Join clause is used to combine records (rows) from two or more tables in a SQL database based on a related column between the two.

Types -

INNER JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
FULL OUTER JOIN

#100DaysOfCode
10. What is a Query?

A query is a request for data or information from a database table or combination of tables. A database query can be either a select query or an action query.

#100DaysOfCode
11. SQL create and drop database?

Create database db_name -
=> CREATE DATABASE db_name;

Drop database db_name -
=> DROP DATABASE db_name;

#100DaysOfCode
12. Create and drop a table in SQL?

CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
DROP TABLE table_name;

#100DaysOfCode
13. What is the difference between DROP and TRUNCATE statements?

If a table is dropped, all things associated with the tables are dropped as well. However, if a table is truncated, none of the above problems exist and the table retains its original structure.

#100DaysOfCode
14. How do we use the DISTINCT statement?

The DISTINCT statement is used with the SELECT statement. If a record contains duplicate values then DISTINCT will select different values among duplicate records.

Syntax-
SELECT DISTINCT column_name
FROM table_name;

#100DaysOfCode
15. What is ACID property?

In order to maintain consistency in a database, before and after the transaction, certain properties are followed. These are called ACID properties.

- Atomicity
- - Consistency
- Isolation
- - Durability

#100DaysOfCode
16. How many Aggregate functions are available in SQL?

SQL Aggregate functions calculate values from multiple columns & return a single value. There are 7 aggregate functions in SQL-

1. AVG()
2. COUNT()
3. MAX()
4. MIN()
5. SUM()
6. FIRST()
7. LAST()

#100DaysOfCode
17. What is View in SQL?

A View can be defined as a virtual table that contains rows and columns with fields from one or more tables.

Syntax:

CREATE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition

#100DaysOfCode
18. What is SQL Injection?

SQL Injection is a type of database attack technique where malicious SQL statements are inserted into an entry field of the database in a way that once it is executed, the database is exposed to an attacker for the attack.

#100DaysOfCode
19. What is Normalization? How many Normalization forms are there?
Normalization is used to organize the data tor remove redundancies.

5 type of normal form:

First Normal Form(1NF)
First Normal Form(2NF)
Third Normal Form(3NF)
Fourth Normal Form(BCNF)

#100DaysOfCode
20. What is a Relationship? How many types of Relationships are there?

The relationship can be defined as the connection between more than one table in the database.

Type of Relationship -
1. One to One
2. Many to One
3. Many to Many
4. One to Many

#100DaysOfCode
21. How to select all records from the table?

To select all the records from the table we need to use the following syntax:

SELECT * FROM table_name;

#100DaysOfCode
22. Difference between TRUNCATE, DELETE, and DROP commands?

DELETE removes some or all rows from a table based on the condition.
TRUNCATE removes ALL rows from a table by deallocating the memory pages.
DROP command removes a table from the database completely.

#100DaysOfCode
23. Define UNION, MINUS, UNION ALL?

MINUS – returns all distinct rows selected by the first query but not by the second.
UNION – returns all distinct rows selected by either query
UNION ALL – returns all rows selected by either query, including all duplicates.

#100DaysOfCode
Follow our free interview preparation and technical newsletter

nlogn.in/newsletter

P.S please confirm email from your inbox to help us avoid Spam.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Nlogn

Nlogn Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @NlognHQ

Jun 7, 2021
Productive Tools For Web Developers

Thread 🧵
1. Metatags

This tool can help you to test and view your website's preview when viewed on Google, Facebook, or Twitter.

metatags.io

#100DaysOfCode
2. ExtractCSS

This tool can help you to extract element Id, class, and inline styles from HTML documents and output them as CSS stylesheets.

extractcss.com

#100DaysOfCode
Read 9 tweets
Apr 9, 2021
SQL INTERVIEW QUESTION CHEATSHEET.

SQL is the most popular database Query Language and many popular websites use it. So, here's a collection of the most asked SQL interview questions.

Please RT for reach and bookmark for easy recall.

🧵A Thread 🧵

#100DaysOfCode
1. What is Database?

A database is an organized collection of data, stored and retrieved digitally from a remote or local computer system. Databases can be vast and complex, and such databases are developed using fixed design and modeling approaches.

#100DaysOfCode
2. What is DBMS?

DBMS stands for Database Management System. DBMS is a system software responsible for the creation, retrieval, updating, and management of the database.

#100DaysOfCode
Read 24 tweets
Apr 8, 2021
BEST FREE TOOLS FOR WEB DESIGNERS AND WEB DEVELOPERS

🧵A Thread 🧵
Table of Contents -

Web Design Resources

1. Newsletter
2. Software
3. Photos
4. Icons
5. Fonts
6. Colors
7. Backgrounds + Textures
8. UI Guides

Web Development Resources

1. Domain Name Search Engines
2. Frameworks, Templates, Code Packs
3. Code Style Guides
4. Code Validation
Newsletter Lists

1. Creative Market (creativemarket.com)

Creative Market newsletter list is once a week newsletter, where you’ll get an email packed with 5 free downloads, including everything from patterns and fonts to templates and themes.

#100DaysOfCode
Read 22 tweets
Apr 7, 2021
Do you know today is a Gumroad Sale day?

Huge sale is going on, on various products. If you are interested, here's the list of all such products 👇🏽

#GumroadDay
The Art of Twitter: A Guide To Building Your Twitter Account (39$ Only)
gumroad.com/a/332403827/XF…
Live Intentionally: Discipline, Mindset, Direction - A 90 Day Self-Improvement Program (19$ Only)

gumroad.com/a/332403827/vr…
Read 5 tweets
Apr 4, 2021
40+ High-Quality Free Resources for Web Development

A Master Thread 👇🏽
Table of Contents:

- Illustrations
- Development
- CSS
- Tailwind
- Design
- Productivity

#100DaysOfCode
Illustrations

1. Drawkit (drawkit.io)
2. Blush (blush.design)
3. Smash illustration (usesmash.com)
4. Control (control.rocks)
5. Error 404 (error404.fun)
6. Open Doodles (opendoodles.com)

#100DaysOfCode
Read 13 tweets
Mar 30, 2021
Are you a Web Developer?

Here are 50+ resources to help you Improve your Web Performance

🧵A Thread🧵
Table Of Contents:

- HTML
- CSS
- Images
- Fonts
- JavaScript
- Server
- Testing Tools
- Frameworks

#100DaysOfCode
HTML

✨ Minify HTML
☄️ Order your styles & scripts for page speed
⚡️ Eliminate render-blocking resources
🌟 Minimize layout thrashing
🎉 Prioritize resources
✨ Preload critical assets to improve speed
💥 Establish network connections early
⚡️ Prefetch resources

#100DaysOfCode
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(