WGU c170 PRE-ASSESSMENT:
DATA MANAGEMENT -
APPLICATIONS WITH COMPLETE
SOLUTION
Course
WGU c170
1. Primary Key
A Customer table contains:
CustomerID
FirstName
LastName
Email
Which column is the best choice for the primary key?
A. FirstName
B. LastName
C. Email
D. CustomerID
Answer: D. CustomerID
Solution: A primary key uniquely identifies each record. CustomerID is normally designed
specifically for this purpose.
2. Foreign Key
Consider these tables:
Customer(CustomerID, CustomerName)
Order(OrderID, OrderDate, CustomerID)
What is CustomerID in the Order table?
,A. Candidate key
B. Foreign key
C. Composite key
D. Alternate key
Answer: B. Foreign key
Solution: The CustomerID in Order references the primary key of Customer, establishing the
relationship between the tables.
3. CREATE TABLE
Which SQL statement correctly creates a table with a primary key?
A.
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50)
);
B.
MAKE TABLE Student (
StudentID INT PRIMARY,
Name VARCHAR(50)
);
C.
NEW TABLE Student (
StudentID KEY,
Name TEXT
);
D.
CREATE Student TABLE (
, StudentID PRIMARY KEY
);
Answer: A
Solution:
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50)
);
CREATE TABLE creates the table, while PRIMARY KEY establishes the unique identifier.
4. INSERT
Which statement adds a new student?
StudentID = 101
Name = Maria
Major = IT
A.
ADD Student VALUES (101, 'Maria', 'IT');
B.
INSERT INTO Student
VALUES (101, 'Maria', 'IT');
C.
UPDATE Student
VALUES (101, 'Maria', 'IT');
D.
CREATE Student
VALUES (101, 'Maria', 'IT');
DATA MANAGEMENT -
APPLICATIONS WITH COMPLETE
SOLUTION
Course
WGU c170
1. Primary Key
A Customer table contains:
CustomerID
FirstName
LastName
Which column is the best choice for the primary key?
A. FirstName
B. LastName
C. Email
D. CustomerID
Answer: D. CustomerID
Solution: A primary key uniquely identifies each record. CustomerID is normally designed
specifically for this purpose.
2. Foreign Key
Consider these tables:
Customer(CustomerID, CustomerName)
Order(OrderID, OrderDate, CustomerID)
What is CustomerID in the Order table?
,A. Candidate key
B. Foreign key
C. Composite key
D. Alternate key
Answer: B. Foreign key
Solution: The CustomerID in Order references the primary key of Customer, establishing the
relationship between the tables.
3. CREATE TABLE
Which SQL statement correctly creates a table with a primary key?
A.
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50)
);
B.
MAKE TABLE Student (
StudentID INT PRIMARY,
Name VARCHAR(50)
);
C.
NEW TABLE Student (
StudentID KEY,
Name TEXT
);
D.
CREATE Student TABLE (
, StudentID PRIMARY KEY
);
Answer: A
Solution:
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50)
);
CREATE TABLE creates the table, while PRIMARY KEY establishes the unique identifier.
4. INSERT
Which statement adds a new student?
StudentID = 101
Name = Maria
Major = IT
A.
ADD Student VALUES (101, 'Maria', 'IT');
B.
INSERT INTO Student
VALUES (101, 'Maria', 'IT');
C.
UPDATE Student
VALUES (101, 'Maria', 'IT');
D.
CREATE Student
VALUES (101, 'Maria', 'IT');