Learn how to delete an existing table and how to conditionally delete a table when you don't know if the table exists or not.
- [Instructor] If you need to delete…a table from your database,…you'll use the drop table statement to do that.…Here again we're using the in-memory database…and I've pasted some SQL statements…from our chapter three exercise file.…I have three statements,…the first is a create-table statement,…very simple, two columns, A and B.…I insert one row into that table,…and use the select statement to look at it.…So when I press go here you'll see we have one row,…with the values one and two.…
Three queries performed, one row affected,…that's the row that we inserted…and one row returned.…Very very simple.…Now let's see what happens when we delete this table…with the drop-table statement.…So I come down here and I say drop table test like that.…And then I'll repeat the select from,…and I should get an error because that table…will no longer exist, right?…So when I press go here, notice query five.…That's the select statement.…General error one, no such table, test.…
Because I deleted it in query four,…the drop-table test statement.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- 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
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. 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.