Skip to content

Maianh2510/SQL-data-cleaning2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

SQL-data-cleaning

header 1

header 2

header 3

col1 col2
1 2

Get the 10 first rows from the table using SQL console

Then put this code to Readme.md with a description what are you doing. For example like this:

full_name age martial_status email phone full_address job_title membership_date
addie lush 40 married [email protected] 254-389-8708 3226 Eastlawn Pass,Temple,Texas Assistant Professor 7/31/2013
ROCK CRADICK 46 married [email protected] 910-566-2007 4 Harbort Avenue,Fayetteville,North Carolina Programmer III 5/27/2018
Sydel Sharvell 46 divorced [email protected] 702-187-8715 4 School Place,Las Vegas,Nevada Budget/Accounting Analyst I 10/6/2017
Constantin de la cruz 35 [email protected] 402-688-7162 6 Monument Crossing,Omaha,Nebraska Desktop Support Technician 10/20/2015
Gaylor Redhole 38 married [email protected] 917-394-6001 88 Cherokee Pass,New York City,New York Legal Assistant 5/29/2019
Wanda del mar 44 single [email protected] 937-467-6942 10864 Buhler Plaza,Hamilton,Ohio Human Resources Assistant IV 3/24/2015
Joann Kenealy 41 married [email protected] 513-726-9885 733 Hagan Parkway,Cincinnati,Ohio Accountant IV 4/17/2013
Joete Cudiff 51 divorced [email protected] 616-617-0965 975 Dwight Plaza,Grand Rapids,Michigan Research Nurse 11/16/2014
mendie alexandrescu 46 single [email protected] 504-918-4753 34 Delladonna Terrace,New Orleans,Louisiana Systems Administrator III 3/12/1921
fey kloss 52 married [email protected] 808-177-0318 8976 Jackson Park,Honolulu,Hawaii Chemical Engineer 11/5/2014

Make a copy of your table

CREATE TABLE club_member_info_cleaned (
	full_name VARCHAR(50),
	age INTEGER,
	martial_status VARCHAR(50),
	email VARCHAR(50),
	phone VARCHAR(50),
	full_address VARCHAR(50),
	job_title VARCHAR(50),
	membership_date VARCHAR(50)
);
INSERT INTO club_member_info_cleaned
SELECT * FROM club_member_info

Inconsistent letter case and Leading and trailing whitespaces

UPDATE club_member_info_cleaned
SET full_name = LTRIM(full_name)
WHERE full_name NOTNULL;

UPDATE club_member_info_cleaned
SET full_name = UPPER(SUBSTRING(full_name,1,1))||LOWER(SUBSTRING(full_name,2,20))
WHERE full_name NOTNULL;

Age out of realistic range

UPDATE club_member_info_cleaned
SET age = (SELECT CEILING(AVG(age)) FROM club_member_info_cleaned )
WHERE age > 80;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published