PGoCareerGoCareer prep tools
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

SQL · Theory

Create Database

← All stacks

Theory

8/439

Create Database

CREATE DATABASE college; makes an empty cupboard. Nothing is in it yet — no tables. Names are usually lowercase, no spaces. Then USE college; so the next CREATE TABLE goes inside it.

CREATE DATABASE IF NOT EXISTS college; is safer in scripts — it won’t error if the DB already exists. SHOW DATABASES; lists them. You should see college in that list after you create it.

One project, one database, is the student habit. Don’t put students and a shopping cart in the same DB unless it is the same app.

Trap — CREATE DATABASE then forgetting USE — tables land in another database and you think they ‘vanished’.

On the example next to this theory — CREATE DATABASE makes a schema; USE selects it for following statements.

Exam tip

CREATE DATABASE college; USE college; SHOW DATABASES;

Create Database — sample query

-- Database admin (MySQL syntax; run on MySQL server)
-- CREATE DATABASE shop;
-- USE shop;
-- SHOW DATABASES;
SELECT 'Use CREATE/USE/SHOW on MySQL server' AS tip;

CREATE DATABASE makes a schema; USE selects it for following statements.

Short notes

  • DefCREATE DATABASE name; makes an empty schema.
  • RuleThen USE name; before CREATE TABLE.
  • TrapForgetting USE — tables go to the wrong DB.

Questions

1

What does CREATE DATABASE do?

2

What next?

8 / 439

P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.