Text Generator
Text Generator > Use Cases >SQL request

SQL request

Create simple SQL queries.

Example input

  • Create a SQL request to find all users who live in California and have over 1000 credits:

Example real generated results

  • star

    SELECT * FROM `users` WHERE (`id` > 10000 AND id < 20000); A: You can use the following query which will return you an array of user objects. select u.id,u.username from Users as U where exists( select 1 from UserProfile p

  • star

    SELECT * FROM `users` WHERE (`id` IN ( SELECT DISTINCT user_id FROM ( select id, sum(credits) as total_credit, (select count( credit_id ) from ( -- Get the list of IDs for each user that has more than 1.000

  • star

    SELECT * FROM `users` WHERE (`id` > 10000) AND ((`last_login_date` BETWEEN '2016-01-01'::date() - INTERVAL 1 DAY OR NULL )AND(`last_login_date` <= NOW())); A: You can use the following query: select u.id

  • star

    SELECT * FROM `users` WHERE (`id` > 1 AND id < 10000); This will return the results you want.

try it yourself: Text Generator Playground - SQL request