Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:14:23+00:00 2026-05-28T00:14:23+00:00

I have a database that has no real normalization, so I am going back

  • 0

I have a database that has no real normalization, so I am going back and trying to make it a little better. Right now we have the following columns:

FirstName | LastName | SchoolYear | Grade | SchoolId | Games Played
 Bob      | Smith    | 2010       |  Fr   | 245      | 3
 Tina     | Johnson  | 2010       |  So   | 2894     | 10
 Bob      | Smith    | 2010       |  Fr   | 245      | 3 

How would I find schools that have 2 people with the same name, school year, grade, and school ID? They would look like duplicates in the database (all the columns would be the same), but each player only has one row with games played for each year. This is how I know there are similar people at a school, there would be 2 rows with the same information.

I’m using SQL Server 2008

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:14:23+00:00Added an answer on May 28, 2026 at 12:14 am

    If I understand your question correctly, this query:

    SELECT FirstName, LastName, SchoolYear, Grade, SchoolId
    FROM <your table>
    GROUP BY FirstName, LastName, SchoolYear, Grade, SchoolId
    HAVING COUNT(*) > 1
    

    This will basically find all the (FirstName, LastName, SchoolYear, Grade, SchoolId) sets that exist in more than one record.

    If you are only interested in the SchoolId’s of the above records, then go with:

    SELECT DISTINCT SchoolId
    FROM <your table>
    GROUP BY FirstName, LastName, SchoolYear, Grade, SchoolId
    HAVING COUNT(*) > 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have inherited a database that has no real referential integrity at all, so
I have a database that has a vessel pressure that is trended every 30
I have a database that has lots of data and is all neat, normalized
I have a database that has four columns like this level_1, level_2, level_3, level_4
I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID
I have an existing database that has some testing data into and I'm interested
I have a database structure that has a Person table which contains fields such
I have a MySQL database that has on the order of 400 million innodb_data_pending_reads
I have a SQL database that has a table with a field set to
I have inherited a database that has a lot of cursors in it, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.