What is the purpose of the 'USE' command in SQL?

The USE command in SQL is used to select a specific database to work with. When you execute the USE command followed by the database name, it sets the context for subsequent SQL statements to that particular database. This means that any operations like SELECT, INSERT, UPDATE, or DELETE will be performed on the specified database.

Example:

USE my_database;

After executing this command, any SQL commands you run will apply to my_database until you switch to another database or end the session.

0 Comments

no data
Be the first to share your comment!