Knowee
Questions
Features
Study Tools

Table building - InsertWrite a query to insert any 3 records into the 'building' table.Note:1. This ‘building’ table got foreign key reference. Already building_type table got below records in it. You no need to insert any new records into building_type table. Please insert records into building table alone by referring the below building_type_id.2. You can provide any values to the building id, owner_name, address, contact_number and email_address column. But for the building_type_id column you must refer to the values specified in the building_type id column only.3. Insert only 3 records into the building table

Question

Table building - InsertWrite a query to insert any 3 records into the 'building' table.Note:1. This ‘building’ table got foreign key reference. Already building_type table got below records in it. You no need to insert any new records into building_type table. Please insert records into building table alone by referring the below building_type_id.2. You can provide any values to the building id, owner_name, address, contact_number and email_address column. But for the building_type_id column you must refer to the values specified in the building_type id column only.3. Insert only 3 records into the building table

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

To insert 3 records into the 'building' table, you would use the SQL INSERT INTO statement. Here's how you can do it:

INSERT INTO building (building_id, owner_name, address, contact_number, email_address, building_type_id) 
VALUES (1, 'John Doe', '123 Main St', '123-456-7890', '[email protected]', 1);

INSERT INTO building (building_id, owner_name, address, contact_number, email_address, building_type_id) 
VALUES (2, 'Jane Smith', '456 Oak Ave', '987-654-3210', '[email protected]', 2);

INSERT INTO building (building_id, owner_name, address, contact_number, email_address, building_type_id) 
VALUES (3, 'Bob Johnson', '789 Pine Dr', '456-789-0123', '[email protected]', 3);

In this example, we're inserting 3 records into the 'building' table. Each record includes a building_id, owner_name, address, contact_number, email_address, and building_type_id. The building_type_id is a foreign key that references the 'building_type' table, so its value must match an existing record in the 'building_type' table.

This problem has been solved

Similar Questions

Write a query to insert any 3 records into the 'building' table.

Write a query to create 'building' table.Hint: Refer the schema diagram for the field names and its data type of the table.Note:This ‘building’ table got foreign key reference. You no need to create building_type table. It is already created for you.Field name and data type must be followed as such given in the schema diagram.There should not be any spelling mistakes in the field namesIf you specified wrong field name or missed any field name while creating the table, but if there is no syntax error then obviously the table will get created but it will not get Accepted.In this case, drop the table and recreate it again with correct field names and get it Accepted.

Write a query to create 'building' table.

Write a query to change the column name 'email_address' to 'email' in the building  table.Note:This query performs alter operation on building table. So ensure the table ‘building’ already created and exists in the database.If you get an error like ‘building’ does not exist. Then go back to first, third and fifth query and execute those create table query once and come back to this query.Column name to be altered and the new name must be specified without any mistake.If you specified wrong field name while altering the table, but if there is no syntax error then obviously the table will get altered but it will not get Accepted.In this case, alter the table with correct field names and get it Accepted.

Table building - UpdateWrite a query to change the owner_name  'Nicholas' to 'Alexander' present in the building table.Note:1. No need to insert any new records into the building table with an owner_name specified in the question. This is already taken care in the backend. You just write the update query with right condition and submit it.2. Specify the owner_name correctly3. Do not make any spelling mistakes while specifying the condition

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.