GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing codescracker.com โ Drop Table and Database in SQL
Drop Table and Database in SQLThis post will teach you how to drop a table, truncate a table, and delete a database in SQL. Dropping a table means deleting it, whereas truncating a table means deleting all of its data but not the table itself. Drop a Table in SQLSQL provides the DROP TABLE statement to accomplish this task. The following is the general syntax for dropping a table in SQL. DROP TABLE tableName; For example, the SQL query below will delete the table "mytable" from the database. DROP TABLE mytable; Truncate a Table in SQLTo remove or delete all of the data or records in a table, use the TRUNCATE statement instead of the DROP statement. The general form of the TRUNCATE statement that can be used to truncate a table in SQL is shown below. TRUNCATE TABLE tableName; For example, the SQL query below will delete all the records from the table named "student". TRUNCATE TABLE student; Drop a Database in SQLThe SQL query for dropping a database looks similar to the SQL query for dropping a table. The only difference is that we must replace TABLE with DATABASE. Here is the general form of the SQL DROP DATABASE statement that is used to drop a database. DROP DATABASE databaseName; For example, to drop a database named "codescracker," use the following SQL query: DROP DATABASE codescracker; That's it. Here I am going to end the SQL tutorial. I hope you like this tutorial ๐. If you want to explore more about SQL with me or want to explore other topics with me, then please let me know. You can contact us through any of our social media accounts or directly through the email ID. You can find the link to contact us at the bottom of the page. Thank you, and have a great future ๐. ยซ Previous Topic CodesCracker.com ยป Practice Quizzes
Test your programming and computer science knowledge with interactive MCQs and topic-based quizzes. Popular Topics
Explore the most popular programming and computer science tutorials on CodesCracker. |
| You are visitor 01402503 โ GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร600. No cookies required. |