SQLforGeeks
  • Home
  • SQL
  • SQL Tutorial
  • SQL Syntax
  • Our Services
Contact
  1. SQL
  2. Create database

Text copied!

« Previous
Next »

Create database

Dec. 11, 2022, 2:12 a.m. under SQL

  • Hi! You should check Detach database post first.

    Creating SQL database refers to the the process of defining and adding a new database instance that is managed by a database management system (DBMS) using SQL commands. "CREATE DATABASE" command is used to create the database.

    To create SQL database, you can use the graphical user interface (GUI) or Transact-SQL (T-SQL).
    Here's an example of how to create database using T-SQL :

    As you can see in below image, [SQL Tutorial] database is not present. Let's create it!

    Create database

    1. Run below SQL command in SSMS :

    USE [master]; 
    
    CREATE DATABASE [SQL Tutorial];
            
    Create database

    2. Above command will create a new database [SQL Tutorial] to the SQL Server database instance.

    Create database

    That's it! You have successfully created a new [SQL Tutorial] database using T-SQL.

    Here's a step-by-step guide on how to create SQL database using GUI :

    1. Right-click on the "Databases folder" in the Object Explorer >> Select "New Database".

    Create database

    2. "New Database" dialog box will appear, enter a name for the database in the "Database name" field >> Click "OK" button.

    Create database

    3. There you go, [SQL Tutorial] database created successfully.

    Create database

    That's it! You have successfully created a new [SQL Tutorial] database using GUI.

    Frequently Asked Questions :

    How do I create a SQL database?

    To create a SQL database, use a SQL database management system like MySQL or SQL Server and execute a "CREATE DATABASE" statement.

    Can I create a SQL database for free?

    Yes, you can create a SQL database for free using open-source database management systems like MySQL Community Edition or PostgreSQL.

    How do I create a SQL query in a database?

    To create a SQL query in a database, use SQL commands such as "SELECT," "INSERT," "UPDATE," or "DELETE" to interact with the data.

    How do I create a good SQL database?

    To create a good SQL database, design it with normalized tables, establish proper relationships, define constraints, optimize indexing, and ensure scalability and performance considerations are met.
    Thank You! You should check Delete database post next.
    « Previous
    Next »
    RELATED :

    What is SQL

    What is T-SQL

    Difference between DBMS and Data Warehouse

    Download SQL Server

    Install SQL Server

    Download SQL Server Management Studio SSMS

    SQL Server Management Studio

    SQL Database

    Download database

    Restore database

    Backup database

    Attach database

    Detach database

    Delete database

    Rename database

    Select database

    Database offline

    Database online

    SQL Commands

    SQL Tables

    Create table

    Truncate table

    Delete table

    Rename table

    Select table

    Alter table

    SQL Data Types

    SQL Comments

    SQL Constraints

    SQL Joins

    SQL inner join

    SQL left join

    SQL right join

    SQL full join

    SQL cross join

    SQL self join

    INSERT INTO SELECT statement

    INSERT INTO statement

    SQL Clauses

    SELECT clause

    FROM clause

    WHERE clause

    GROUP BY clause

    HAVING clause

    ORDER BY clause

    JOIN clause

    UNION clause

    UNION ALL clause

    TOP clause

    DISTINCT clause

    SQL Operators

    SQL Arithmetic operators

    SQL Comparison operators

    SQL Logical operators

    UNION operator

    UNION ALL operator

    INTERSECT operator

    EXCEPT operator

    LIKE operator

    NOT LIKE operator

    IN operator

    NOT IN operator

    IS NULL operator

    IS NOT NULL operator

    EXISTS operator

    NOT EXISTS operator

    BETWEEN operator

    NOT BETWEEN operator

    SQL Functions

    SQL Built-In functions

    CHARINDEX function

    DATEADD function

    CONCAT function

    LEN function

    REPLACE function

    SUBSTRING function

    CASE statement

    GETDATE function

    DATEPART function

    DATEDIFF function

    CAST function

    TRY_CAST function

    CONVERT function

    TRY_CONVERT function

    ISNULL function

    NULLIF function

    COALESCE function

    SQL Window functions

    ROW_NUMBER function

    RANK function

    DENSE_RANK function

    IIF function

    CHOOSE function

    SQL Store Procedure

    Store Procedure vs. Function

    SQL Subquery

    SQL Aliases

    Temp table

    SQL Error Handling

    SQL Variables

    SQL Views

    SQL Merge

    SQL CTE

    SQL WITH TIES

    Define Transaction in DBMS

    ACID properties in DBMS

    Types of Triggers in DBMS


    • Have Some Questions?
    logo

    Elevate your data experience with SQL excellence

    Quick Links
    •  Home
    •  SQL Tutorial
    •  SQL Syntax
    •  Our Services
    Our Services
    • Web Development
    • BI Development
    • Data Warehousing
    • Data Integration ETL


    Follow Us

    GST Registered: XXAXXXXXXXZX
    Mumbai, Maharashtra, India

    © 2024 Copyright | All Rights Reserved | Privacy Policy