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 โ