SQL is just a language used to query databases. Your hypothetical website will need some sort of storage for - as you put it - profiles, videos and images, but a database is only one type of persistent storage you could use. If you do use an RDBMS (Relational DataBase Management System) like MySQL or SQL Server or Oracle or PostgreSQL, etc., you will use SQL to write the queries, but you will also have to learn whatever API is supported by both the RDBMS and your programming language.
You stated that you know Ruby on Rails. I have not used RoR, but I suspect it exposes some sort of data access API that should allow you to connect to whatever RDBMS you end up using. Search google for "ruby on rails database" and you'll probably get thousands of links to tutorials, reference pages and user forums.
Same with SQL (Structured Query Language), search google for "SQL tutorial".
The basics of SQL are very simple. Data in a database is stored in tables. A table has one or more named columns where the name of the column identifies what is stored in that column. A column also has other characteristics like the data type and a size. The rows (or records) in the table store the information about a single instance of the thing that the table stores.
For example, a table named People will store information about people and the information about a single person will be in a single row. The columns identify what information is stored for each person.
So a People table might have columns like Name, Birthdate, Address, PhoneNumber, etc.
There are many "rules" about how to properly design your tables and it's worth learning them. These rules are called database normalization rules (again, google it). For most databases, you'll be fine if you learn and use the first three normalization rules. When a table follows rule one, it is said to be "in the first normal form." When it follows rules one and two it is in the second normal form and when it follows the first three rules, it is in the third normal form. So as long as you design your tables to be in the third normal form, it will be easy to access the data - i.e. easy to write the queries.
So, if you had the table named People with columns Name, Birthdate, Address, City, State, Zip & Phone, you could, for example, get all the rows (and remember that each row represents a person) for people who live in Texas, but not in Dallas by using the following SQL query:
Select Name
From People
Where State = 'TX' and City != 'Dallas'
This is your basic Select command. A Select command is used to return rows from a table (or a combination of tables and other more esoteric data sources). After the word "Select" you list the comma-separated columns you want returned or use * (an asterisk) to return all the columns in the table.
The From clause tells the database engine where it should find these columns. In this example, we tell it to return the Name column from the People table. The From clause can get much more complicated - usually by using one or more Joins. Joins are ways of combining data from multiple, related tabled (this is where the word Relational in Relational Database comes from).
Finally, the Where clause is where you define the criteria that the database engine will use when picking which rows to include. In our example, we simple tell the database engine to include all rows where the state column is equal to the string 'TX' and the city column is not equal to 'Dallas'.
There are many other clauses, but this is your basic query.
Eventually, you will probably want to buy some books - they are a lot easier to use and learn from than online sources.