TestingDocs.com
    Software Testing website
    • Automation
      • Selenium
      • JBehave Framework
    • Tutorials
      • MySQL Tutorials
      • Testlink
      • Maven
      • Git
    • IDEs
      • IntelliJ IDEA
      • Eclipse
    • Flowcharts
      • Flowgorithm
      • Raptor
    • About

    MySQL

    Basic MySQL Commands

    Overview

    In this page, we will learn some basic MySQL commands used in database testing.

    Connect to a database

    https://www.testingdocs.com/working-with-mysql-command-line/

    Create Table

    To create a table, you must use the CREATE TABLE command and specify the table name and fields. The following command creates the department:

    CREATE TABLE department (
    dept_name char(20) NOT NULL,
    dept_number numeric(1) NOT NULL,
    mgrSSN numeric(9) NOT NULL,
    mgrStartDate date NOT NULL,
    PRIMARY KEY (dept_number),
    UNIQUE (dept_name)
    );

     

    Note that we have written SQL keywords in capital letters. It is a coding standard of writing an SQL query. This is to enhance the readability of the SQL query to others. SQL is NOT case sensitive.

    DESCRIBE statement

    https://www.testingdocs.com/mysql-describe-statement/

    INSERT

    Since you’ve created a table, you can begin inserting data to it. The
    INSERT command is shown below to add a record to the table. The values must be listed in exactly the same order as the fields. Each value is separated by a comma, and all VARCHAR & CHAR data type values must be enclosed in single quotation marks.

    INSERT INTO department VALUES 
    (‘Quality Assurance’,1,111223333,’1994-05-24′);

     

    SELECT statement

    SELECT statement is used to retrieve data from the database. To learn about the SELECT statement:

    https://www.testingdocs.com/mysql-select-statement/

    —

    MySQL Tutorials

    MySQL Tutorials on this website:

    https://www.testingdocs.com/mysql-tutorials-for-beginners/

    For more information on MySQL Database:

    https://www.mysql.com/

    Related Posts

    Stellar Converter for Database Tool

    MySQL /

    Stellar Converter for Database

    Stellar MySQL Log Analyzer

    MySQL /

    Stellar Log Analyzer for MySQL

    Stellar Repair for MySQL

    MySQL /

    Stellar Repair for MySQL

    MySQL /

    How to secure your SQL Database: Tips and Tricks

    Stellar Converter for Database

    MySQL /

    Database Converter Tools

    ‹ LAMP Stack Components› Create a Table in MySQL Database

    Recent Posts

    • ChatGPT Plans Free and PlusChatGPT Subscription Plans
    • Stellar Converter for Database ToolStellar Converter for Database
    • Stellar MySQL Log AnalyzerStellar Log Analyzer for MySQL
    • Stellar Repair for MySQLStellar Repair for MySQL
    • ChatGPT IntroductionChatGPT Capabilities
    • How to secure your SQL Database: Tips and Tricks
    • ChatGPT4 Conversational AI FeaturesChatGPT4 Conversational AI Features
    • Trends in Software EngineeringShaping the Future of Development: Exploring Key Trends in Software Engineering
    • Java PerformanceImproving Java Performance with Multithreading
    • QDrant Vector DatabaseOpen-source Vector Databases
    • Difference between PHP and JavaScript?
    • Bing AI Browser Web ContentBing Conversation Styles
    • ChatGPT PreviewChatGPT Introduction
    • Open Source AI Frameworks TensorFlowOpen Source AI Frameworks
    • Artificial Intelligence Tools

    Back to Top

    Links

    • Contact
    • Privacy Policy
    • Cookie Policy

    www.TestingDocs.com