I have the following tables that have profiles and list of photos (in the `photo` table) for each profile. I also have a `service` table and a `used` table, I want a query that would return the profile id which does not belong in the used service and also has more than 3 photos in the `photo` table

The `profile` table

```
CREATE TABLE public.profile
(
    id integer NOT NULL DEFAULT nextval('profile_id_seq'::regclass),
    name text COLLATE pg_catalog."default" NOT NULL,
    birthday timestamp with time zone NOT NULL,
    CONSTRAINT profile_id PRIMARY KEY (id)
)

```

The `photo` table

```
CREATE TABLE public.photo
(
    id integer NOT NULL DEFAULT nextval('photo_id_seq'::regclass),
    image bytea NOT NULL,
    image_id text COLLATE pg_catalog."default" NOT NULL,
    order_count smallint NOT NULL,
    profile_id bigint NOT NULL,
    CONSTRAINT photo_id PRIMARY KEY (id),
    CONSTRAINT photo_profile_id_fkey FOREIGN KEY (profile_id)
        REFERENCES public.profile (id) MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE
)

```

the `service` table

```
CREATE TABLE public.service
(
    id integer NOT NULL DEFAULT nextval('service_id_seq'::regclass),
    name text COLLATE pg_catalog."default" NOT NULL,
    CONSTRAINT service_id PRIMARY KEY (id)
)

```

the `used` table

```
CREATE TABLE public.used
(
    id integer NOT NULL DEFAULT nextval('used_id_seq'::regclass),
    service_id bigint NOT NULL,
    profile_id bigint NOT NULL,
    insert_timestamp timestamp with time zone NOT NULL DEFAULT now(),
    CONSTRAINT used_id PRIMARY KEY (id),
    CONSTRAINT used_profile_id_fkey FOREIGN KEY (profile_id)
        REFERENCES public.profile (id) MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE,
    CONSTRAINT used_service_id_fkey FOREIGN KEY (service_id)
        REFERENCES public.service (id) MATCH SIMPLE
        ON UPDATE CASCADE
        ON DELETE CASCADE
)

```