B
B
Blyyya2016-01-19 19:05:05
MySQL
Blyyya, 2016-01-19 19:05:05

How to translate these sql queries into Russian?

How to translate these sql-queries to the great and mighty?
one.

SELECT id,  LEFT(joketext,  20),  name,  email
    FROM joke INNER JOIN author 
    ON authorid = author.id

My option is to SELECT the id cells, the first 20 characters from the joketext, name, email cell FROM the joke table and (internally) merge with the author table ON condition that the values ​​of the authorid and id cells of the author table match! AM I RIGHT ?
2.
SELECT joketext
    FROM joke INNER JOIN jokecategory 
    ON joke.id = jokeid
    INNER JOIN category
    ON categoryid = category.id
    WHERE name =  "о д'Артаньяне"

My variant is to select cell joketext FROM joke table and (internally) join with jokecategory table ON condition of match of id values ​​from joke and jokeid table -> next... result obtained (internal) join with category table ON condition of match of categoryid and id values ​​from category table WHERE the cell contains the words "about d'Artagnan" ! AM I RIGHT ?
3.
SELECT author.name                      <- не понятно в этом месте
                            FROM joke INNER JOIN author 
                            ON authorid = author.id 
                            INNER JOIN jokecategory 
                            ON joke.id = jokeid 
                            INNER JOIN category
                            ON categoryid = category.id 
                            WHERE category.name = 
"о д'Артаньяне" <- не понятно в этом месте

My variant is to SELECT the name cell of the author table FROM the joke table (internally) join with the author table ON the condition that the authorid and id values ​​of the author table match -> next ... jokeid -> next... merge the result (internally) with the category table ON the condition that the categoryid and id values ​​of the category table match WHERE in the name cell of the category table there are the words "about d'Artagnan" ! HERE in this request for sure, messed up

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2016-01-19
@coderisimo

1) These are SQL queries
2) on the last query:
you get a table created from 4 different tables with common fields:
this table will contain author.name (from author) and category.name (from category).
For a better understanding of this and other queries, go to 'SQL Queries'. PHP is out of business here))).
There are detailed explanations, even with pictures)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question