Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inserting Data To insert a single complete row

Similar presentations


Presentation on theme: "Inserting Data To insert a single complete row"— Presentation transcript:

1 Inserting Data To insert a single complete row
To insert a single partial row To insert multiple rows To insert the results of a query

2 Inserting Complete Rows
INSERT INTO Customers VALUES(NULL, 'Pep E. LaPew', '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA', NULL, NULL);

3 INSERT INTO customers(cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_ ) VALUES('Pep E. LaPew', '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA', NULL, NULL);

4 INSERT INTO customers(cust_name, cust_contact, cust_ , cust_address, cust_city, cust_state, cust_zip, cust_country) VALUES('Pep E. LaPew', NULL, NULL, '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA');

5 Inserting Multiple Rows
INSERT INTO customers(cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country) VALUES('Pep E. LaPew', '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA'); INSERT INTO customers(cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country) VALUES('M. Martian', '42 Galaxy Way', 'New York', 'NY', '11213', 'USA');

6 INSERT INTO customers(cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country) VALUES( 'Pep E. LaPew', '100 Main Street', 'Los Angeles', 'CA', '90046', 'USA' ), ( 'M. Martian', '42 Galaxy Way', 'New York', 'NY', '11213', 'USA' );

7 Inserting Retrieved Data
INSERT INTO customers(cust_id, cust_contact, cust_ , cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country) SELECT cust_id, cust_contact, cust_ , cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country FROM custnew;


Download ppt "Inserting Data To insert a single complete row"

Similar presentations


Ads by Google