You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: alexander_connelly_code_challenge.txt
+16-22Lines changed: 16 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -4,29 +4,23 @@ Data Integrity Checking & Cleanup
4
4
5
5
- For all countries that have multiple rows in the continent_map table, delete all multiple records leaving only the 1 record per country. The record that you keep should be the first one when sorted by the continent_code alphabetically ascending. Provide the query/ies and explanation of step(s) that you follow to delete these records.
6
6
7
-
CREATE DATABASE BrainTreeSQLCodingChallenge
8
-
9
-
CREATE TABLE continent_map (
10
-
ID int IDENTITY (1 , 1) PRIMARY KEY ,
11
-
country_code nvarchar(3),
12
-
continent_code nvarchar(2)
13
-
);
14
-
CREATE TABLE continents (
15
-
continent_code nvarchar(2),
16
-
continent_name nvarchar(50)
17
-
);
18
-
CREATE TABLE countries (
19
-
country_code nvarchar(3),
20
-
country_name nvarchar(100)
21
-
);
22
-
CREATE TABLE per_capita (
23
-
country_code nvarchar(3),
24
-
year int,
25
-
gdp_per_capita float
26
-
);
27
-
28
-
# Used Flat File Import to Get CSV files into DB Tables
0 commit comments