Wikipedia:WikiProject Women in Red/Redlinks/N

{{Wikipedia:WikiProject Women in Red/Redlinks header|N}}

{{Database report

|sql=

WITH names AS (

WITH RECURSIVE deepcat (subcat, depth) AS

(

SELECT CAST('Feminine_given_names' AS VARCHAR(256)), 0

UNION

SELECT page_title, depth + 1

FROM deepcat

JOIN categorylinks ON cl_type = "subcat" AND cl_to = subcat

JOIN page ON page_id = cl_from AND page_namespace = 14 AND page_title LIKE "%eminine%"

WHERE depth < 4

)

SELECT DISTINCT SUBSTRING_INDEX(page_title, "_", 1) AS name

FROM deepcat

JOIN categorylinks ON cl_type = "page" AND cl_to = subcat

JOIN page ON page_id = cl_from AND page_namespace = 0 AND page_title LIKE "N%" /* If changed, needs a matching change 7 lines below */

)

SELECT lt_title Target, SUM(Pt.page_title IS NULL) LinkCount, MIN(Pf.page_title) ExampleLink1, MAX(Pf.page_title) ExampleLink2

FROM linktarget

JOIN pagelinks ON pl_target_id=lt_id AND pl_from_namespace IN (0, 10)

LEFT JOIN page Pt ON Pt.page_namespace=0 AND Pt.page_title=lt_title

JOIN names ON name=SUBSTRING_INDEX(lt_title, "_", 1)

STRAIGHT_JOIN page Pf ON Pf.page_id=pl_from AND NOT (Pf.page_namespace=0 AND Pf.page_title REGEXP "^(.*\\D)?(19{{!}}20)\\d\\d(?!\\d)")

WHERE lt_namespace=0 AND lt_title LIKE "N%" /* If changed, needs a matching change 7 lines above */

AND lt_title REGEXP "^\\p{Lu}\\p{Ll}+_(\\p{Lu}(\\p{Ll}+_{{!}}\\._?))*\\p{Lu}\\p{Ll}+(_\\(.*\\))?$"

GROUP BY Target

HAVING MAX(pl_from_namespace) = 0 AND LinkCount>=5

ORDER BY LinkCount DESC, Target

|wikilinks= 1,3,4

|excerpts=

|comments=

|interval=

|table_style=

|pagination=

|max_pages=

}}

{{error|1=[SQL Error: ER_BAD_FIELD_ERROR: Unknown column 'pl_title' in 'field list' – Consider using [https://quarry.wmflabs.org/ Quarry] to to test your SQL.]}}