SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Nom d’une commande en SQL

A

clause. s’écrit en majuscule ex: CREATE TABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
SQL
creates a new table.
adds a new row to a table.
queries data from a table.
edits a row in a table.
changes an existing table.
deletes rows from a table.
A
CREATE TABLE 
INSERT INTO 
SELECT 
UPDATE
ALTER TABLE 
DELETE FROM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How to use clause WHERE name LIKE ‘exemple’ to search
names like ‘se[1 character]en’
names beginning with letter ‘a’
names containing ‘man’

A

WHERE name LIKE ‘se_en’
WHERE name LIKE ‘a%’
WHERE name LIKE ‘%man%’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SQL : comment trouver tous les films dont l’année est comprise entre 1990 et 2000

A

SELECT * FROM movies

WHERE year BETWEEN 1990 AND 2000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL : classer les films par ordre décroissant de classement IMDB, afficher le top 3

A

SELECT * FROM movies
ORDER BY imd_rating DESC
LIMIT 3;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SQL : récupérer le nombre d’apps par groupe de prix

A

SELECT price, COUNT(*) FROM fake_apps

GROUP BY price;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

SQL : apps Calculate the average number of downloads at each price. In the code editor type

rounding the average number of downloads to two decimal

A

SELECT price, ROUND(AVG(downloads),2) FROM fake_apps

GROUP BY price;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

SQL : Comment désigne-t-on les différents types de clés

A

foreign keys and primary keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

SQL : fonction pour transformer un timestamp en date

A

select date(timestamp)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly