Field |
Type |
Description |
user_id |
int |
Primary Key and Unique identifier of the user |
first_name |
varchar |
user First Name |
last_name |
varchar |
User Last Name |
Field |
Type |
Description |
order_id |
int |
Primary Key and Unique identifier of the order |
order_name |
varchar |
Order name |
user_id |
varchar |
User who submitted order |
Talk through each of the following SQL statements and what the problem with each is.
SELECT user_id, last_name, first_name, FROM public.users;
SELECT * FROM public.users LEFT JOIN public.orders ON user_id = user_id;
SELECT count(user_id) AS "Count per last_name", last_name
FROM public.users;
SELECT * FROM public.users WHERE first_name = "test";