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

Text copied!

« Previous
Next »

SQL Tables

Dec. 17, 2022, 7:36 a.m. under SQL

  • Hi! You should check SQL commands post first.

    SQL table is a database object that organize and stores data in a structured manner. It uses rows and columns to organize data, where each row represents a unique record and each column represents a specific data field.

    Here is an example of SQL table called [Department] that contains information about department in a company :
    SELECT *
    FROM [Department];
    SQL Tables
    There are several types of SQL tables that can be used to store data, including :
    SQL Tables
    1. Typical tables :

    In SQL, typical tables are created by the user to store data in the database.

    2. Temporary tables :

    Temporary tables are created to store data temporarily during the execution of a query and are automatically deleted when the session ends.

    There are two types of Temporary tables :

    [a] Local temporary table :

    Local temporary tables are only visible to the session that created them and are dropped automatically when the session ends. To create it, place single hash (#) before the table name. Here's an example :

    CREATE TABLE #LocalTemporaryTable (
    [ID] INT
    );
            
    [b] Global temporary table :

    Global temporary tables are accessible to all sessions, but they are dropped automatically when the session that created them ends. To create it, place double hash (##) before the table name. Here's an example :

    CREATE TABLE ##GlobalTemporaryTable (
    [ID] INT
    );
            
    3. System tables :

    System tables are used by the database management system to store metadata or information about the database itself. These tables contain information about the structure of the database such as table names, column names, indexes, constraints and data types.

    System tables are typically read-only which means that users can't modify their contents directly.

    4. Virtual tables :

    Virtual tables is the type of tables that does not actually exist in the database as a physical table, but rather is created dynamically based on the results of a "SELECT statement" or a "view".

    Frequently Asked Questions :

    What are the tables in SQL?

    Tables in SQL are structured data objects used to store information in rows and columns.

    How do I list all tables in SQL?

    You can list all tables in SQL Server using the query: "SELECT * FROM information_schema.tables WHERE table_type = 'BASE TABLE'".

    What are tables and fields?

    Tables are containers for organizing data, while fields (or columns) define the attributes or characteristics of the data stored within those tables.

    How do you create a table in SQL?

    To create a table in SQL, you use the "CREATE TABLE" statement followed by the table name and the definition of its columns along with their data types and any constraints.
    Thank You! You should check Create table 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

    Create database

    Delete database

    Rename database

    Select database

    Database offline

    Database online

    SQL Commands

    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 support@sqlforgeeks.com

    © 2025 Copyright™ | All Rights Reserved | Privacy Policy