MySQL Cloud: Create Tables & Assign Values

There are two main ways to create tables and assign values in the MySQL cloud database: using SQL statements or using graphical tools.

  1. Create a table and populate it using SQL statements:
    To do this, log into the MySQL database and execute the following SQL statements to create the table and insert data.
CREATE TABLE table_name (
    column1 datatype,
    column2 datatype,
    ...
);

INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);

For example, create a table named student and insert a piece of data.

CREATE TABLE student (
    id INT,
    name VARCHAR(50)
);

INSERT INTO student (id, name)
VALUES (1, 'Alice');
  1. You can use graphical tools like Navicat or MySQL Workbench to create tables and input values. These tools offer a visual interface for easier operations, allowing you to create tables and insert data through drag-and-drop and form filling.

In general, both SQL statements and graphical tools are convenient ways to create tables and assign values to them. The choice of which method to use depends on personal preferences and needs.

bannerAds