SQL Learning πŸ’»
3.8K subscribers
3 photos
3 files
8 links
Learn SQL from Scratch!
See also @C_codings, @Cpp_codings
Download Telegram
Inserting in a table

INSERT INTO table_name (column1,column2, column3, ...)
VALUES (value1, value2, value3, ...);
πŸ‘18
Hey everyone ! Been a long since I posted anything. I realised that providing all the details here is meaningless as there are many better resources out there !
Keeping that in mind


Here's something for you

To minimize the impact of coronavirus outbreak on students, Progate (an online coding learning platform from Japan) has shared free access to their learning platform for all students until *30th April 2020*.

You can utilize this time at home by learning new tech skills. This will not only help you to strengthen your programming skills but will also allow you to prepare for interviews and placements.

This access includes 14 detailed online lessons of Python, Go, SQL, Command-Line and Git.

*STEPS TO ACTIVATE YOUR ACCESS:*

1) Create your free account on progate.com
2) Open this link and click the 'Join' button: bit.ly/progatespecialaccessduetocovid19
3) Open bit.ly/progatespecialaccess from a laptop/desktop and select the language
πŸ‘8πŸ‘Ž1
Find the Employees who hired in the Last n months. Write a SQL query for that.

Send your queries in the discussion group.
πŸ‘16
SQL.pdf
1.4 MB
πŸ‘10πŸ‘Ž2
Write a sql query to find the second largest number from table table_name and column number.
Write a sql query to delete duplicate rows from a table.
πŸ‘9
Write a sql query to find the Joining date of Employee in YYYY-DAY-Date format.
πŸ‘6
You are given this database, your task is to output➑
πŸ‘5
https://play.google.com/store/apps/details?id=com.sololearn.sql


If you are starting with SQL and wish to code the queries as you learn more about SQL , Sololearn is perfect place for you.
πŸ‘6
Here's a snippet of code written in C:

for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
//some operation
}
}


How can I write something equivalent in SQL?

Solution:Alias

say, you are asked to count the frequency of each color occurring in the same table , so you can write something like this:


select distinct color ,(select count(*) from colors where c.color=color) from colors c;
πŸ‘71πŸ€”12πŸ‘3
When assigning unique identifiers to rows based on a specified order, three key functions come into play: ROW_NUMBER, RANK, and DENSE_RANK.

Consider the following table:

| Name | Score |
|-------- |-------|
| Alice | 90 |
| Bob | 90 |
| Carol | 85 |
| David | 78 |


ROW_NUMBER:

The simplest of the three, ROW_NUMBER assigns a unique number to each row based on the specified order. Each row receives a distinct identifier, incrementing by one.
Example:
1
2
3
4


RANK:

Assigns unique numbers, and in the case of ties, rows get the same rank, and the next rank is skipped.
1
1
3
4


DENSE_RANK:

Assigns ranks to rows with tied values, without skipping the next rank

1
1
2
3


These functions help in organizing and analyzing data by providing distinct identifiers or ranks based on specified criteria. The example table illustrates how ROW_NUMBER, RANK, and DENSE_RANK operate in assigning order to rows with varying scores.

(Note: This is 1/3 of the total number of articles; others are coming soon.)
πŸ‘13πŸ€”2