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: