4. Staff without a profile image

easy

Instruction

  • Write a SQL query to return this staff's first name and last name.
  • Picture field contains the link that points to a staff's profile image.
  • There is only one staff who doesn't have a profile picture.
  • Use colname IS NULL to identify data that are missing.

Table: staff

  col_name   | col_type
-------------+--------------------------
 staff_id    | integer
 first_name  | text
 last_name   | text
 address_id  | smallint
 email       | text
 store_id    | smallint
 active      | boolean
 username    | text
 picture     | character varying

Sample results

 first_name | last_name
------------+-----------
 Jon        | Snow

Expected results

Solution postgres

SELECT first_name, last_name
FROM staff
WHERE picture IS NULL;
    

Explanation

This query is selecting the first and last names of all staff members from a table called "staff." However, it is only selecting those staff members whose "picture" field is null, meaning they do not have a picture associated with their profile.



More SELECT, WHERE, AND, OR, ORDER BY, LIMIT questions

ID Title Level FTPR
212 Top issuing bank by category visa hard -
211 High spenders by issuer visa easy -
210 Issuer and merchant report visa easy -
200 Last week's absent students snap medium -
175 Employees' email account amazon easy
11%
152 Salary analysis dropbox easy
23%
126 Top 3 restaurants uber hard
9%
111 Second most popular product amazon medium
14%
92 Acceptance rate first week of 2021 spotify easy
14%
17 GROUCHO WILLIAMS’ actor_id easy
65%
16 Staff who live in Woodridge easy
72%
3 Top 5 shortest movies easy
53%
2 Top 3 movie categories by sales easy
47%
1 Top store for movie sales easy
30%