๐Ÿ‘ฉโ€๐Ÿ’ป 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

๐ŸŒฟ๐‘ป๐’‰๐’† ๐’”๐’•๐’๐’“๐’š ๐’๐’‡ ๐’‚ ๐‘บ๐’•๐’‚๐’“ : ๐‘ซ๐’‰๐’“๐’–๐’—๐’‚ & ๐‘ฝ๐’Š๐’”๐’‰๐’๐’–

Once upon a time there was a Raja named Uttฤnapฤda born of Svayambhuva Manu,1st man on earth.He had 2 beautiful wives - Suniti & Suruchi & two sons were born of them Dhruva & Uttama respectively.
#talesofkrishna https://t.co/E85MTPkF9W


Now Suniti was the daughter of a tribal chief while Suruchi was the daughter of a rich king. Hence Suruchi was always favored the most by Raja while Suniti was ignored. But while Suniti was gentle & kind hearted by nature Suruchi was venomous inside.
#KrishnaLeela


The story is of a time when ideally the eldest son of the king becomes the heir to the throne. Hence the sinhasan of the Raja belonged to Dhruva.This is why Suruchi who was the 2nd wife nourished poison in her heart for Dhruva as she knew her son will never get the throne.


One day when Dhruva was just 5 years old he went on to sit on his father's lap. Suruchi, the jealous queen, got enraged and shoved him away from Raja as she never wanted Raja to shower Dhruva with his fatherly affection.


Dhruva protested questioning his step mother "why can't i sit on my own father's lap?" A furious Suruchi berated him saying "only God can allow him that privilege. Go ask him"
Moderna CEO Stephane Bancel was previously CEO of bioMerieux in France from 07-10.

Alain Merieux, who owns bioMerieux, was instrumental in the creation of the Wuhan Institute of Virology P4 Lab.

The same people who helped create the virus, also helped to create the vaccines...


Moderna partnered with French Pasteur Institute in 2015 to develop mRNA vaccine technology.

Pasteur Institute partnered with the Wuhan P4 Laboratory in 2017 along with the Merieux Foundation to study emerging viruses...
https://t.co/yFsHwrNYaK
https://t.co/9M5lydBKhM


Nobel prize winning scientist Luc Montagnier asserts that Sars-Cov-2 is man-made and originated from the Wuhan Institute of Virology.

Montagnier did extensive work with the Pasteur Institute in France which was partnered with the Wuhan P4.

Merieux Foundation & the Chinese government have worked together since 1965, and partnered to study emerging pathogens in Africa in 2015.

Their research included "PATHOGENS CARRIED BY BATS" that provoke respiratory diseases.

๐Ÿšจ๐Ÿšจ๐Ÿšจ
https://t.co/gVwpT0ssqI
@EricTopol @NBA @StephenKissler @yhgrad B.1.1.7 reveals clearly that SARS-CoV-2 is reverting to its original pre-outbreak condition, i.e. adapted to transgenic hACE2 mice (either Baric's BALB/c ones or others used at WIV labs during chimeric bat coronavirus experiments aimed at developing a pan betacoronavirus vaccine)

@NBA @StephenKissler @yhgrad 1. From Day 1, SARS-COV-2 was very well adapted to humans .....and transgenic hACE2 Mice


@NBA @StephenKissler @yhgrad 2. High Probability of serial passaging in Transgenic Mice expressing hACE2 in genesis of SARS-COV-2


@NBA @StephenKissler @yhgrad B.1.1.7 has an unusually large number of genetic changes, ... found to date in mouse-adapted SARS-CoV2 and is also seen in ferret infections.
https://t.co/9Z4oJmkcKj


@NBA @StephenKissler @yhgrad We adapted a clinical isolate of SARS-CoV-2 by serial passaging in the ... Thus, this mouse-adapted strain and associated challenge model should be ... (B) SARS-CoV-2 genomic RNA loads in mouse lung homogenates at P0 to P6.
https://t.co/I90OOCJg7o