3.6k views
1 vote
Refer to the column information produced by SHOW COLUMNS FROM Supplier; statement. CountryId is a foreign key that references the CountryId column in the Country table. Which statement correctly inserts Oshkosh Bgosh? Table with 5 rows and 6 columns. The first row contains headers Field, Type, Null, Key, Default, Extra. The second row contains entries SupplierId, int(11),NO, PRI, NULL, auto_increment. The third row contains entries CompanyName, varchar(40), YES, , NULL, . The fourth row contains entries ContactName, varchar(50), YES, , NULL, . The fifth row contains CountryId, int(11), YES, MUL, NULL, .

User N Jedidiah
by
7.1k points

1 Answer

7 votes

Final Answer:

To correctly insert "Oshkosh Bgosh" into the Supplier table, the following SQL statement should be used:

```sql

INSERT INTO Supplier (CompanyName, ContactName, CountryId) VALUES ('Oshkosh Bgosh', 'YourContactName', YourCountryId);

```

Step-by-step explanation:

The SQL `INSERT` statement is used to add new records to a table. In this case, the Supplier table has columns CompanyName, ContactName, and CountryId. To insert "Oshkosh Bgosh," we need to provide values for these columns.

The SQL query specifies the columns (CompanyName, ContactName, CountryId) and their corresponding values. Replace 'YourContactName' and YourCountryId with the actual contact name and country ID for Oshkosh Bgosh. For example:

```sql

INSERT INTO Supplier (CompanyName, ContactName, CountryId) VALUES ('Oshkosh Bgosh', 'John Doe', 1);

```

This query inserts a new record with the CompanyName set to 'Oshkosh Bgosh', ContactName set to 'John Doe', and CountryId set to 1. Adjust the ContactName and CountryId values based on your specific data.

It's important to note that you should replace 'YourContactName' and YourCountryId with the actual values you want to insert into the Supplier table, ensuring that the CountryId value corresponds to a valid entry in the Country table since CountryId is a foreign key referencing the CountryId column in the Country table.

User Marcela
by
8.0k points