How do you delete an existing table? How do you conditionally delete a table when you don't know if the table exists or not? Learn the answers to these questions in this video.
- [Instructor] You'll use the DROP TABLE statement … to delete a table from the database. … So here we're using the test database, … and you notice we have this test table … which we created in a previous lesson. … And so here, if I try to create the table again, … you'll notice that I'll get an error here. … Says error while executing, blah blah blah, … table test already exists. … And so if I want to create the table differently, … I need to delete the table first, … and we use that with the DROP TABLEs statement. … So here we have DROP TABLE test; … and I'm going to go ahead and execute that. … And query finished successfully, … and now I can go ahead and I can create that table again, … insert some rows into it, and select from it. … Now this is different than the tables before, … this is both text columns, … and that's okay, because that table doesn't exist anymore. … You notice it's gone from the test database. … And so, going to go ahead and execute this. … And you notice we created the table, it has two columns, …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.