HomeОбразованиеRelated VideosMore From: Lecture Snippets

SQL with Oracle 10g XE - Using INSERT to Add Data to a Table

77 ratings | 39321 views
In this video I use the INSERT command to add an entire record into a table. When using the command you must also use the keyword VALUES. If you want to enter a null value (one that has no value) for a field you can use the keyword NULL. Be sure to put single quotes around data types that are not numbers. Values need to be entered in the order the fields appear in the table. The commands I used are: INSERT INTO BOOKS VALUES (1,'140231862','9780140231861','The Winter King: A Novel of Arthur','Fiction','14.99','P',1996,1,2) INSERT INTO BOOKS VALUES ('2','140232478','9780140232479','Enemy of God: A Novel of Arthor','Fiction',14.99,'P','1997',1,2); INSERT INTO BOOKS VALUES ('3','140232877','9780140232875','Excalibur: A Novel of Arthor','Fiction',14.99,'P','1998',1,2); INSERT INTO BOOKS VALUES ('4','6513840','9780006513841','Harlequin: Grail Quest','Fiction',19.99,'P','2001',1,1); INSERT INTO BOOKS VALUES ('5','6513859','9780006513858','Vagabond: Grail Quest','Fiction',19.99,'P','2003',1,1); INSERT INTO BOOKS VALUES ('6','7149891','9780007149896','Heretic: Grail Quest','Fiction',19.99,'P','2004',1,1); INSERT INTO BOOKS VALUES ('7','553103547','9780553103540','A Game of Thrones','Fiction',13.99,'H','1996',2,4); INSERT INTO BOOKS VALUES ('8','553801473','9780553801477','A Dance with Dragons','Fiction',13.99,'H','2010',2,5); INSERT INTO BOOKS VALUES ('9','055357342X','9780553573428','A Storm of Swords','Fiction',4.99,'P','2003',2,4); INSERT INTO BOOKS VALUES ('10','1596590424','9781596590427','50 Success Classics','Audio',17.99,NULL,NULL,3,3) INSERT INTO AUTHOR VALUES (1,'Cornwell','Bernard'); INSERT INTO AUTHOR VALUES (2,'Martin','George'); INSERT INTO AUTHOR VALUES (3,'Butler','Tom'); INSERT INTO PUBLISHER VALUES (1,'HarperCollins Publishers Canada, Limited'); INSERT INTO PUBLISHER VALUES (2,'Penguin Books Canada, Limited'); INSERT INTO PUBLISHER VALUES (3,'Gildan Media Corp'); INSERT INTO PUBLISHER VALUES (4,'Bantam Dell Pub Group'); INSERT INTO PUBLISHER VALUES (5,'Spectra'); This video is part of a series of videos with the purpose of learning the SQL language. For more information visit Lecture Snippets at http://lecturesnippets.com.
Html code for embedding videos on your blog
Text Comments (10)
How can I import a .csv excel file into created table?
Sanjay chaudhary (7 months ago)
can you tell me if i insert as:- insert into student(1,'abc',20,'london') then it show error where i take name char(20)and address char(60) it is only show the error in char.plz................................................give some suggestion to solve it.
ComputerTechFun (2 years ago)
ORA-00001: unique constraint (SYSTEM.SYS_C004057) violated error please help me out
BlitzBeast- (2 years ago)
thank you for all your videos, you make simple and easy to grasp. i am taking classes online with ecpi university and i watch your videos to help me with these classes. keep the good work.
Rafat Muiz Mahmud (2 years ago)
great great great great great great
asandl (3 years ago)
thanks for this -- great source for newbies...
Soccer Action (5 years ago)
Thank you so much !
Rehab H (5 years ago)
thank you
Ceaser Younes (6 years ago)
you sir are a lifesaver. thanks.
Ranjith R (6 years ago)
helped a lot..........thank you very much :)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.