Knowee
Questions
Features
Study Tools

How do you list all users records with age > 21 in this table?+-------+-------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-------------------------------------------------------------------------------------------------------------------------------+| users | CREATE TABLE `users` ( `id` int(11) DEFAULT NULL, `name` varchar(256) DEFAULT NULL, `age` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1 |+-------+-------------------------------------------------------------------------------------------------------------------------------+SELECT * FROM users WHERE age < 21;SELECT * FROM users WHERE age IS UP TO 21;SELECT * FROM users WHERE age > 21;SELECT * FROM users WHERE age BETWEEN 21 AND 89;

Question

How do you list all users records with age > 21 in this table?+-------+-------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-------------------------------------------------------------------------------------------------------------------------------+| users | CREATE TABLE users ( id int(11) DEFAULT NULL, name varchar(256) DEFAULT NULL, age int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1 |+-------+-------------------------------------------------------------------------------------------------------------------------------+SELECT * FROM users WHERE age < 21;SELECT * FROM users WHERE age IS UP TO 21;SELECT * FROM users WHERE age > 21;SELECT * FROM users WHERE age BETWEEN 21 AND 89;

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

To list all user records with age greater than 21 from the 'users' table, you would use the following SQL query:

SELECT * FROM users WHERE age > 21;

This query will return all columns (indicated by the asterisk *) for all records in the 'users' table where the 'age' is greater than 21.

Similar Questions

How do you list all users in this table?+-------+-------------------------------------------------------------------------------------------------------------------------------+| Table | Create Table |+-------+-------------------------------------------------------------------------------------------------------------------------------+| users | CREATE TABLE `users` ( `id` int(11) DEFAULT NULL, `name` varchar(256) DEFAULT NULL, `age` int(11) DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=latin1 |+-------+-------------------------------------------------------------------------------------------------------------------------------+DELETE * FROM users;SELECT * FROM users;SELECT ALL users;

Consider a table Employee with attributes Name, Age and Branch. Select the SQL query to retrieve the Age and Branch of the youngest Employee over the age of 18 for branches with atleast 10 employees. Select all that apply.

How do you retrieve the youngest employee's name and age? *SELECT Name, Age FROM Employees ORDER BY Age ASC LIMIT 1;SELECT MIN(Age), Name FROM Employees;SELECT LAST(Name), Age FROM Employees ORDER BY Age DESC;SELECT Name, Age FROM Employees WHERE Age = MIN(Age);

How do you select rows from a table where the 'Age' column is greater than 30?A. SELECT * FROM table WHERE Age > 30;B. GET * FROM table IF Age > 30;C. SELECT * FROM table HAVING Age > 30;D. EXTRACT * FROM table WHERE Age > 30;

This task concerns the following tables:PersonsidnameaddressageeyeColorgenderKnowsidpersonA_id → PersonspersonB_id → PersonsThe semantics of the Knows table is that personA knows personB.Write a query that returns the name of all persons that are more than 5 years older than everybody they know.

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.