Check out example codes for "database get 10 user aleatory". It will help you in understanding the concepts better.

Code Example 1

SELECT 
    t.customerNumber, t.customerName
FROM
    customers AS t
ORDER BY RAND()
LIMIT 5;

Learn ReactJs, React Native from akashmittal.com