← 返回 snapchat 的题目列表Create and Query Snapchat Users Table by Age and Name
类型:online_judge
snapchat
Using Snapchat's own database, perform the following data operations: Create a table named users with the following fields: id (integer, primary key), name (string), age (integer), and city (string). Insert the following sample data into the table: (1, 'Alice', 30, 'New York'), (2, 'Bob', 25, 'Los Angeles'), (3, 'Charlie', 35, 'Chicago'). Then, write an SQL query to select all users whose age is greater than 30 and order them by name in alphabetical order. Provide test cases and expected outputs.
Example
Input
users table with sample data