Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE People ( Id int NOT NULL IDENTITY, FirstName varchar(100) NOT NULL, LastName varchar(100) NOT NULL ) INSERT INTO People VALUES ('Luke','Doss'), ('John','Smith'), ('John','Doe'), ('Greg','Hart'), ('Lance','Elliot'), ('Matt','Acton'), ('Matt','Hutton') Select FirstName, Count(*) As NameCount from People group by firstname Select FirstName, Count(*) As NameCount from People group by firstname Having count(*)> 1 -- ** Problem 1: -- Write a query to provide a list of all the FirstName values --that are in the table, -- along with how many times they names are in there: -- Write the statement here: -- ** Problem 2: -- Modify the query to only show FirstName values that are in the table --more than once. -- Write the statement here:

Stuck with a problem? Got Error? Ask AI support!

Copy Clear