exam questions

Exam AZ-303 All Questions

View all questions & answers for the AZ-303 exam

Exam AZ-303 topic 1 question 62 discussion

Actual exam question from Microsoft's AZ-303
Question #: 62
Topic #: 1
[All AZ-303 Questions]

You have an Azure SQL database named DB1.
You plan to create the following four tables in DB1 by using the following code.
Table1.

Table2.

Table3.

Table4.

You need to identify which table must be created last.
What should you identify?

  • A. Table1
  • B. Table2
  • C. Table3
  • D. Table4
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Table1 references Table4. Therefore Table4 must be created before Table1.
Table2 references Table1 and Table3. Therefore Table1 and Table3 must be created before Table2.
Note: FOREIGN KEY REFERENCES is a constraint that provides referential integrity for the data in the column or columns. FOREIGN KEY constraints require that each value in the column exists in the corresponding referenced column or columns in the referenced table. FOREIGN KEY constraints can reference only columns that are PRIMARY KEY or UNIQUE constraints in the referenced table or columns referenced in a UNIQUE INDEX on the referenced table.
Incorrect Answers:
A: Table1 is referenced by Table2 and should be crated before Table2.
C: Table3 is referenced by Table2 and should be crated before Table2.
D: Table4 is referenced by Table1 and should be crated before Table1.
Reference:
https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-ver15

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
xaccan
Highly Voted 4 years, 7 months ago
correct
upvoted 26 times
...
pentium75
Highly Voted 4 years ago
Of course the answer is correct, but this is pure SQL, has nothing to do with Azure architecture and is also not part of the official training material.
upvoted 11 times
...
KemalM
Most Recent 3 years, 5 months ago
Selected Answer: B
Table2 should be the last one
upvoted 1 times
...
Ansh27feb
3 years, 6 months ago
Selected Answer: B
Answer is Correct
upvoted 1 times
...
asemaan
3 years, 10 months ago
Yes the answer is correct . . . logically. But because no foreign key constraints are defined as part of the create table means you can create the tables in any order!
upvoted 1 times
...
syu31svc
3 years, 11 months ago
Table1 references Table4. Therefore Table4 must be created before Table1. Table2 references Table1 and Table3. Therefore Table1 and Table3 must be created before Table2 Answer is B
upvoted 3 times
...
Rockers
4 years, 3 months ago
Correct. Sequence of table creation will be .... Table 4 | Table 1, 3 | Table 2
upvoted 7 times
...
Ramkid
4 years, 5 months ago
yes, logically table 2 is correct
upvoted 1 times
...
sujeetkb2021
4 years, 6 months ago
Table2 is the correct answer as it references to Table 1 and Table 3 so these 2 tables should be created first
upvoted 9 times
...
mactone
4 years, 6 months ago
obviously table 4. correct answer
upvoted 4 times
mactone
4 years, 6 months ago
sorry typo. Table 2
upvoted 4 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...