This assignment focuses on fundamental SQL database operations, specifically creating and managing databases using basic SQL commands.
- Understand how to create and manage databases in SQL
- Learn how to use SQL commands to create and delete databases
- Gain experience working with basic SQL commands for database management
βββ answers.sql # Contains all SQL queries for the assignment
βββ README.md # This documentation file
The answers.sql file contains solutions to the following tasks:
Query: CREATE DATABASE salesDB;
- Creates a new database named
salesDB - This database will be empty and ready for table creation and data insertion
Query: DROP DATABASE demo;
- Permanently deletes the database named
demo β οΈ Warning: This operation cannot be undone and will remove all data, tables, and objects within the demo database
-
Using MySQL Command Line:
mysql -u your_username -p < answers.sql -
Using MySQL Workbench:
- Open the
answers.sqlfile - Execute the queries sequentially
- Open the
-
Using Other SQL Clients:
- Import or open the file in your preferred SQL client
- Run the queries in order
- Ensure you have appropriate permissions to create and drop databases
- The
DROP DATABASEcommand is irreversible - use with caution - Verify that no active connections exist to the
demodatabase before attempting to drop it - These commands follow standard SQL syntax but may require slight modifications for different database systems (MySQL, PostgreSQL, SQL Server, etc.)
After executing the queries in answers.sql:
- A new database named
salesDBwill be created - The existing database named
demowill be permanently deleted (if it exists)
If you encounter errors:
- Verify your SQL user has CREATE and DROP privileges
- Check if the
demodatabase exists before attempting to drop it - Ensure no applications are connected to the
demodatabase when executing the DROP command
Student Name: Emmanuel Ukah