๐Ÿ‘ฉโ€๐Ÿ’ป 75+ SQL Practice Questions

โ Oracle
โ MySQL
โ SQL Server
โ PostgreSQL
โ SQLite

โ‡ฉ

Topics covered:

โžŠ Table
โž‹ Constraints
โž€ Primary Key
โž Unique
โž‚ Not Null
โžƒ Default
โž„ Check
โž… Foreign Key
โžŒ Insert, Update, Delete
โž Select
โžŠ Table

โž€ Create a Table with a few fields by specifying their data types.

โž Add a field to an existing table.

โž‚ Modify a field's data type of a table.

โžƒ Rename a field's name.

โž„ Remove a field from a table.

โž… Rename a table's name.

โž† Drop a table.
โž‹ Constraints

โž€ Primary Key
โž Unique
โž‚ Not Null
โžƒ Default
โž„ Check
โž… Foreign Key
โž‹.โž€ Primary Key

โžค Create a Table with
โž€ a single field as the primary key
โž 2 or, more fields as the primary key
...

โžค Add a primary key to an existing table
โž‚ for a single field
โžƒ for 2 or, more fields
...
โž‹.โž Unique

โžค Create a Table with
โž€ a single field unique
โž 2 or, more fields combining unique
โž‚ multiple unique fields
...

โžค Add a unique constraint to an existing table
โžƒ for a single field
โž„ for 2 or, more fields combining
...

โž… Drop a unique constraint
โž‹.โž‚ Not Null

โžค Create a Table with
โž€ one NOT NULL field
โž multiple NOT NULL fields
...

โž‚ Add NOT NULL constraint to an existing field
โžƒ Remove NOT NULL constraint from an existing field
โž‹.โžƒ Default

โžค Create a Table with DEFAULT value(s)
โž€ for one field
โž multiple fields
...

โž‚ Add a DEFAULT value constraint to an existing field
โžƒ Remove DEFAULT value constraint from an existing field
โž‹.โž„ Check

โžค Create a Table with CHECK constraint for
โž€ a single field
โž 2 or, more fields combining
โž‚ multiple separated fields
...

โžค Add a CHECK constraint to an existing table
โžƒ for a single field
โž„ for 2 or, more fields combining
...

โž… Drop a CHECK constraint
โž‹.โž… Foreign Key

โžค Create a Table with
โž€ a single foreign key field
โž 2 or, more fields combining foreign key
โž‚ multiple foreign key fields
...

โžค Add a foreign key constraint to a table
โžƒ for a single field
โž„ for 2 or, more fields combining
...

โž… Drop a foreign key
โžŒ Insert, Update, Delete

โž€ Insert a row into a table.
โž Insert a row into a table by providing data for a few fields.
โž‚ Insert multiple rows at a time into a table.
โžƒ Insert into a table by selecting needed data from another table.
โž„ Update a specific field's data in a table.
โž… Update a field's data for multiple rows at a time.
โž† Delete a row from a table.
โž‡ Delete multiple rows from a table.
โž Select

โž€ Fetch all rows from a table.
โž Fetch only specific fields' data from a table.
โž‚ Fetch only those rows that match a condition.
โžƒ Apply multiple conditions.
โž„ Check if a field's data is NULL.
โž… Check if a field's data is not NULL.
โž† Check if a field's data starts with "NewY"
โž‡ Check if a field's data ends with "don"
โžˆ Check if a field's data contains "ijin"
โž‰ Check if a field's data has "a" at 2nd position
โž€โž€ Check if a field's data starts with "B" and, has at least 5 characters.
โž€โž Check if a field's data starts with "B" and, ends with "a".
โž€โž‚ Check if a field's data starts with "a" or, "o".
โž€โžƒ Check if a field's data doesn't contain "a" or, "o" at the 2nd position.
โž€โž„ Check if a field's data ends with any character from "m" to "t".
โž€โž… Check if a field's data is 1 or, 2 or, 3 or, 4 or, 5.
โž€โž† Check if a field's data is in the range of 10 to 30.
โž€โž‡ Check if a field's data is not in the range of 10 to 50.
โž€โžˆ Fetch only distinct data contained in a field.
20. Fetch only the first 10 rows.
โžโž€ Fetch rows from 21 to 40.
โžโž Find the minimum value of a field.
โžโž‚ Find the maximum value of a field.
โžโžƒ Find the average value of a field.
โžโž„ Find the sum of all values contained in a field.
โžโž… Find the number of rows fetched.
โžโž† Find the count of distinct data in a field.
โžโž‡ Fetch rows in ascending order for a field.
โžโžˆ Fetch rows in descending order for a field.
๐Ÿ Final Words

โฌ˜ Practice all these questions. Then, try to come up with your own questions by customizing all of these.

โฌ™ It's an ongoing series. I will share more practice questions on various topics of SQL. Stay tuned.

Happy Practicing. Happy Learning.
Hey ๐Ÿ‘‹

I am a Tech Educator and, Mentor from India ๐Ÿ‡ฎ๐Ÿ‡ณ

I am sharing Tutorials, Infographics, Cheat Sheets, Practice Questions, Project Ideas and Roadmaps on Web Development, DSA and, Databases.

To never miss anything, Follow Me โœ…

More from Swapna Kumar Panda

๐Ÿ›ฃ Beginner's Roadmap for Front-End

HTML & CSS โ†’ ๐Ÿ‘ฉโ€๐Ÿ’ป โ†’ JavaScript โ†’ ๐Ÿ‘ฉโ€๐Ÿ’ป
โ†“
๐Ÿ‘ฉโ€๐Ÿ’ป โ† React* โ† ๐Ÿ‘ฉโ€๐Ÿ’ป โ† Tailwind*
โ†“
TypeScript โ†’ ๐Ÿ‘ฉโ€๐Ÿ’ป โ†’ Next.js* โ†’ ๐Ÿ‘ฉโ€๐Ÿ’ป โ†’ ๐Ÿ

โ‡ฉ

What would we cover?

โžŠ HTML & CSS
โž‹ JavaScript
โžŒ CSS Frameworks
โž UI Frameworks
โžŽ TypeScript
โž Server-side Frameworks
โž Practice, Practice and, Practice
โž‘ Other Skills
โž’ Frequently Asked Questions

โžŠ HTML & CSS

โฌ˜ Your Front-End journey shall always start from HTML & CSS and, ends with these as well.

โฌ— Don't over burden yourself to learn everything at once. It's a continuous subject.

โฌ™ Do not separate HTML from CSS. That's


โž‹ JavaScript

JavaScript is essential. You should start with basics and move to complex subjects.

โ JavaScript Syntaxes
(preferably ES6 onwards)
โ HTML DOM API
โ Event Handling
โ Fetch


โžŒ CSS Frameworks

CSS Framework is necessary if you are planning to be a professional developer.

There are so many options available.

โ Tailwind CSS
โ Bootstrap
โ Chakra
โ Bulma
โ Foundation
โ Skeleton
โ Pure CSS

Start with anything. You can switch any time.

You May Also Like

#Bookmark this

The full story of || Dhruv ||

Weโ€™ll see How Dhruv occupied a fixed position in the northern sky?

I repeat โ€œUntold Unsung now Unearthedโ€

Go through entire thread carefully.

OM NAMO BHAGWATE VAASUDEVAAY

RT & spread the knowledge.
Any questions use #AskPratz


.... continuing from previous thread/story

O prince! Thus concentrate on that omnipotent eternal Lord with the mantra - โ€˜OM NAMO BHAGWATE VAASUDEVAAYโ€™ .

https://t.co/H62ehDT3ix


The prince Dhruv greeted the sages and continued on his journey. At last, he reached a beautiful forest Madhuvan on the bank of the river Yamuna. It was the same forest, which was later occupied by a demon Madhu.


Shatrughana, the youngest brother of Sri Rama had killed demon Lavan, son of Madhu in the same forest & founded the township of Mathura. In the same forest, prince Dhruv decided to carry out his penance. As per the dictate of the sages, he began to recite the mantra continuously


Very soon, the earth began to move because of Dhruvโ€™s severe penance. Even the seat of Indra could not remain stable. A stampede resulted among the gods. The gods then hatched a conspiracy to disturb the penance.
The entire discussion around Facebookโ€™s disclosures of what happened in 2016 is very frustrating. No exec stopped any investigations, but there were a lot of heated discussions about what to publish and when.


In the spring and summer of 2016, as reported by the Times, activity we traced to GRU was reported to the FBI. This was the standard model of interaction companies used for nation-state attacks against likely US targeted.

In the Spring of 2017, after a deep dive into the Fake News phenomena, the security team wanted to publish an update that covered what we had learned. At this point, we didnโ€™t have any advertising content or the big IRA cluster, but we did know about the GRU model.

This report when through dozens of edits as different equities were represented. I did not have any meetings with Sheryl on the paper, but I canโ€™t speak to whether she was in the loop with my higher-ups.

In the end, the difficult question of attribution was settled by us pointing to the DNI report instead of saying Russia or GRU directly. In my pre-briefs with members of Congress, I made it clear that we believed this action was GRU.