Databases (MySQL)

wat doet de SQL-methode CHAR_LENGTH()?
1 / 36
suivant
Slide 1: Question ouverte
ICTMBOStudiejaar 1

Cette leçon contient 36 diapositives, avec quiz interactifs.

time-iconLa durée de la leçon est: 30 min

Éléments de cette leçon

wat doet de SQL-methode CHAR_LENGTH()?

Slide 1 - Question ouverte

I.p.v. CHAR_LENGTH() meteen bij de SQL-query in te stoppen, kun je ook in php de lengte van een string opvragen. Met welke functie kan dat?

Slide 2 - Question ouverte

INSTR( str , substr ) geeft de positie van de eerste gevonden substr in str; welke php-functie doet hetzelfde?

Slide 3 - Question ouverte

Wat doet de SQL-methode LOWER()?

Slide 4 - Question ouverte

Welke php-functie doet hetzelfde als LOWER()?

Slide 5 - Question ouverte

Wat doet de SQL-methode
REPLACE( string , vervang , door)

Slide 6 - Question ouverte

Welke functie in php doet hetzelfde als REPLACE() in SQL?

Slide 7 - Question ouverte

Wat doet de SQL-stringmethode RIGHT()?

Slide 8 - Question ouverte

Welke PHP-functie doet hetzelfde als SQL-methode RIGHT()

Slide 9 - Question ouverte

Wat doet de stringmethode LTRIM()?

Slide 10 - Question ouverte

Welke PHP-functie doet hetzelfde als SQL-methode LTRIM()

Slide 11 - Question ouverte

Wat denk je dat de SQL-stringmethode REVERSE() doet? (niet opzoeken)

Slide 12 - Question ouverte

Wat doet de SQL-Date-methode CURDATE()?

Slide 13 - Question ouverte

Wat doet de SQL-DATE-methode DAYNAME()?

Slide 14 - Question ouverte

Wat doet de SQL-DATE-methode DATEDIFF()?

Slide 15 - Question ouverte

Pasfoto's!!!!

Slide 16 - Question ouverte

With SQL, how do you select all the columns from a table named "Persons"?
A
SELECT *.Persons
B
SELECT Persons
C
SELECT [all] FROM Persons
D
SELECT * FROM Persons

Slide 17 - Quiz

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
A
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
B
SELECT * FROM Persons WHERE FirstName='Peter'
C
SELECT * FROM Persons WHERE FirstName<>'Peter'
D
SELECT [all] FROM Persons WHERE FirstName='Peter'

Slide 18 - Quiz

Which SQL statement is used to create a database table called 'Customers'?
A
CREATE DB Customers
B
CREATE DATABASE TABLE Customers
C
CREATE TABLE Customers
D
CREATE DATABASE TAB Customers

Slide 19 - Quiz

Which SQL statement is used to extract data from a database?
A
SELECT
B
EXTRACT
C
GET
D
OPEN

Slide 20 - Quiz

Which SQL statement is used to update data in a database?
A
MODIFY
B
SAVE AS
C
SAVE
D
UPDATE

Slide 21 - Quiz

Which SQL statement is used to delete data from a database?
A
COLLAPSE
B
REMOVE
C
DELETE

Slide 22 - Quiz

Which SQL statement is used to insert new data in a database?
A
ADD RECORD
B
ADD NEW
C
INSERT NEW
D
INSERT INTO

Slide 23 - Quiz

With SQL, how do you select a column named "FirstName" from a table named "Persons"?
A
EXTRACT FirstName FROM Persons
B
SELECT FirstName FROM Persons
C
SELECT Persons.FirstName

Slide 24 - Quiz

With SQL, how do you select all the columns from a table named "Persons"?
A
SELECT * FROM Persons
B
SELECT Persons
C
SELECT *.Persons
D
SELECT [all] FROM Persons

Slide 25 - Quiz

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
A
SELECT [all] FROM Persons WHERE FirstName='Peter'
B
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
C
SELECT * FROM Persons WHERE FirstName='Peter'
D
SELECT * FROM Persons WHERE FirstName<>'Peter'

Slide 26 - Quiz

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
A
SELECT * FROM Persons WHERE FirstName='%a%'
B
SELECT * FROM Persons WHERE FirstName='a'
C
SELECT * FROM Persons WHERE FirstName LIKE '%a'
D
SELECT * FROM Persons WHERE FirstName LIKE 'a%'

Slide 27 - Quiz

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
A
TRUE
B
FALSE

Slide 28 - Quiz

With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
A
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
B
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
C
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

Slide 29 - Quiz

Which SQL statement is used to return only different values?
A
SELECT DISTINCT
B
SELECT DIFFERENT
C
SELECT UNIQUE

Slide 30 - Quiz

Which SQL keyword is used to sort the result-set?
A
SORT
B
SORT BY
C
ORDER
D
ORDER BY

Slide 31 - Quiz

Tabel: 'adressen'
Kolom: 'straat'
SQL-vraag: selecteer de eerste drie karakters (letters) van alle straten

Slide 32 - Question ouverte

Tabel: 'adressen'
Kolom: 'straat'
SQL-vraag: selecteer alle records waarvan de straatnaam eindigt op 'weg'

Slide 33 - Question ouverte

Database: 'persoonsgegevens'
SQL-vraag: maak een tabel 'straat' aan met de kolommen 'straat_id', 'straatnaam' en 'plaats_id'

Slide 34 - Question ouverte

Tabel: 'straat'
Kolommen: 'straat_id', 'straatnaam' en 'plaats_id'
SQL-vraag: voeg een rij toe met de gegevens: 'Trekweg' en '3' (voor de plaats_id)

Slide 35 - Question ouverte

Tabel: adres
Kolommen: 'straatnaam', 'huisnummer' en 'plaatsnaam'
SQL-vraag: selecteer de adressen uit de tabel waarbij de straat, huisnr en de plaatsnaam achter elkaar aan geplakt zijn

Slide 36 - Question ouverte