What else can I say about SQL to prove that it is crucial to know how to work around databases?

Having said that, SQL could be the one thing that you could begin your programming journey with. 🀩

A Beginner-friendly version of SQL (UPDATE and DELETE)
πŸ§΅πŸ‘‡
🌟 Let's look at the table first!
The name of the table is -> faculties
We have columns as FacultyId, Name, Class, EmailId and Salary. "Faculties" Table.
β˜‘οΈ UPDATE
This clause is used to change values in a specified column.
You may or may not provide a condition along with the change you want to make.

πŸ‘‰ Update without condition:-
UPDATE table_name SET column_name = column_value;
Query: Change the salaries of the faculties to 4000.

SQL Query: UPDATE faculties SET Salary = 4000;

O/P: All the values in the Salary Column would change to 4000. UPDATE without condition
πŸ‘‰ Update with a condition:-
UPDATE table_name SET column_name = column_value where CONDITION;

Query: Change the value of Salary to 2000 where the FacultyId is 103. UPDATE with condition
β˜‘οΈ DELETE
The DELETE clause would help you remove the row(s) from the table.
You have to specify a condition to delete a specific row.

*Important Note*: If you do not specify a condition within the DELETE clause, all rows would be deleted.
πŸ‘‰ Delete with the condition:-
DELETE from table_name where CONDITION;

Query: Delete the values from the Faculties table where the salary is 2000.

SQL Query: DELETE from faculties where Salary = 2000;

O/P: The row where the Salary is 2000 is deleted from the table. DELETE clause
πŸ‘‰ Delete all rows:-
TRUNCATE table_name;

With TRUNCATE, the table will exist in the database, but all the rows in that table will be deleted.

πŸ‘‰ To Delete a table from the database:-
DROP table table_name;

πŸ‘‰ To Delete a database:-
DROP database database_name;
FYI, I wanted to put this thread yesterday, but somehow I was unable to access my Twitter Web. Even now, I had to login via Incognito Mode.

β€’ β€’ β€’

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

Keep Current with Sukriti Macker

Sukriti Macker 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 @Sukriti_Macker

25 Jun
I hope you are practising SQL whilst you are learning it. This technique makes it easier to understand concepts.

Alrighty, here is another thread for SQL. 🀩

SQL - A Beginner-friendly version! πŸ“š
(Clauses: IN, BETWEEN and LIKE)

Thread 🧡
🌟Which table are we working on today?
The name of the table is "products". So the columns that we have are productCode, productName, productDescription, among others.

Take a look πŸ‘‡ Column namesOverview of the information in the columns
β˜‘οΈ IN
This clause would reduce the efforts to write multiple OR conditions. It helps you find a specific match for a value.

πŸ‘‰ select column1, column2 from table_name where EXPRESSION IN ('value1', 'value2')
Read 15 tweets
24 Jun
Here is another thread of the most important clauses to boost your SQL queries to the next level!

Advance SQL, A beginner-friendly version! (#DataScience)

Thread 🧡
Let me explain what the table looks like.
The table name is customer_list, where the columns are ID, name, address, zip code, phone, city, country, notes & SID.

See the image for reference The table and column names in that table.
β˜‘οΈ GROUP BY
This clause is used to group rows that have the same values together. It summarises data from the database.

Note: The group by clause returns one row for each group.

πŸ‘‰ Query: select col_name from table_name GROUP BY column_name;
Read 13 tweets
14 Jun
Hey, folks! Some time back, I was scrolling through LinkedIn and found some essential SQL topics to revisit before an Interview.

Have a look πŸ§΅πŸ‘‡
1. WHERE, AND, OR, NOT, IN
2. ORDER BY, ASC, DESC
3. IS NULL
4. LIMIT
5. MIN, MAX, COUNT, AVG, SUM
6. LIKE, WILDCARDS
7. IN BETWEEN
8. INNER JOIN
9. LEFT JOIN
10. UNION ALL
11. GROUP BY
12. HAVING
13. LEFT, RIGHT, MID, CONCAT
14. PARTITION BY, OVER
15. LEAD, LAG
16. Subqueries
17. RANK, DENSE_RANK, PERCENT_RANK
18. ROW_NUMBER, CUME_DIST
19. FIRST_VALUE, LAST_VALUE
20. AS
Read 5 tweets
10 Jun
Let's dive further into SQL to help you through the most demanding skill required in the Data Science Industry.

A Beginner's Guide to Filter Results in MySQL - Part 5!!

Thread 🧡
β˜‘οΈ LIMIT Clause
To restrict the number of rows in the final result, we use the LIMIT clause.
That means if you have 10,000 rows in the data, you can fetch only 10 rows using this clause in your query.
πŸ‘‰ Query: select * table_name LIMIT limit_no;

For e.g., Consider a table PAYMENTS. It has more than 1000 rows. [See the image] Table PAYMENTS with 1000 rows.
Read 8 tweets
9 Jun
Have you found the concepts of JOINS in SQL tricky? πŸ˜΅β€πŸ’«

A Beginner-Friendly JOINS guide that would help you in your SQL & Data Science Journey.

Thread 🧡
β˜‘οΈ JOINS (Some Theory)
Using JOIN, we can query data from two or more tables based on the related column present in both tables.

While performing a join, we need to specify the shared column & the condition on which we want to join tables.
β˜‘οΈ Types of JOINS:-
1. Inner Join
2. Left Join
3. Right Join
4. Full Join
Read 14 tweets
7 Jun
Want to pursue Data Science? SQL is the most imperative skill required in it!

A Beginner's Guide to MySQL Queries part 4! πŸ“–
RETRIEVAL & LOADING the data!

Thread 🧡
βœ… RETRIEVE THE DATA

The SELECT command allows the retrieval of information as per our requirements.

You can select/retrieve:-
1. All the data from the table using *
2. A single column
3. Multiple columns
1️⃣ Select all columns of the table

SELECT * from table_name;

πŸ‘‰ E.g., Selecting/Retrieving all the values from the classroom1 table.

2️⃣ Select one column from the table

SELECT column_name from table_name;

πŸ‘‰ E.g., Selecting the student_name column from the table classroom1. Retrieving ALL the columns ...Retrieving ONE column from ...
Read 5 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

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

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(