Skip to content

ElderNuel/MySQL-Database-Week-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

SQL Database Management Assignment

πŸ“‹ Assignment Overview

This assignment focuses on fundamental SQL database operations, specifically creating and managing databases using basic SQL commands.

🎯 Learning Objectives

  • 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

πŸ“‚ File Structure

β”œβ”€β”€ answers.sql          # Contains all SQL queries for the assignment
└── README.md           # This documentation file

πŸ“ Assignment Questions & Solutions

The answers.sql file contains solutions to the following tasks:

1. Create a New Database

Query: CREATE DATABASE salesDB;

  • Creates a new database named salesDB
  • This database will be empty and ready for table creation and data insertion

2. Drop an Existing Database

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

πŸš€ How to Execute

  1. Using MySQL Command Line:

    mysql -u your_username -p < answers.sql
  2. Using MySQL Workbench:

    • Open the answers.sql file
    • Execute the queries sequentially
  3. Using Other SQL Clients:

    • Import or open the file in your preferred SQL client
    • Run the queries in order

⚠️ Important Notes

  • Ensure you have appropriate permissions to create and drop databases
  • The DROP DATABASE command is irreversible - use with caution
  • Verify that no active connections exist to the demo database 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.)

πŸ“Š Expected Outcome

After executing the queries in answers.sql:

  1. A new database named salesDB will be created
  2. The existing database named demo will be permanently deleted (if it exists)

πŸ› οΈ Troubleshooting

If you encounter errors:

  • Verify your SQL user has CREATE and DROP privileges
  • Check if the demo database exists before attempting to drop it
  • Ensure no applications are connected to the demo database when executing the DROP command

Student Name: Emmanuel Ukah

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors