
SELECT
u.id AS 'id',
u.username AS 'username',
u.firstname AS 'first name',
u.lastname AS 'last name',
u.email AS 'email'
FROM prefix_user AS u
WHERE u.id > 2
The SELECT statement is used to select data FROM a database table. We can assign an alias to the database table using the AS statement as shown above. This is useful as it prevents you having to rewrite the database table over and over again when creating columns using the SELECT syntax.
id, username, firstname, lastname and email are all columns from the database table with the associated column heading you give them.

For more information on the Pluto LMS database tables,
click here.
The WHERE clause is used to filter your records that fulfil a specified condition.
The above query will produce the following sample table:
id | username | first name | last name | email |
3 | joesoap | Joe | Soap | js@e.com |
4 | salwhite | Sal | White | sw@e.com |
5 | themb | Them | B | tb@e.com |
6 | jess | Jess | Sky | js@e.com |