Creating Database and Table
CREATE DATABASE (Name of the database)
Higlight and execute
CREATE TABLE (Name of the table) (
•Names varchar (50),
•Age int,
•Gender char(10),
•Phone bigint,
•Emails varchar (200),
•Address varchar (50)
);
The “INT” and “BIGINT” data types don’t have a length specification like the other data types. That’s because the length of the “INT” and “BIGINT” data types is determined by the specific SQL implementation you’re using. Different implementations of SQL have different maximum lengths for the “INT” and “BIGINT” data types.
•The SELECT statement retrieves data from one or more tables. You can select specific columns or use * to select all columns.
•Example
•SELECT *
• FROM table name;
INSERT Statement:
INSERT INTO table name (column1, column2) VALUES (value1, value2);
INSERT INTO [student_information]
VALUES (
‘Mercy Olamiyi’, 28 ,’Female’, 08123456789 ,’[email protected]’ ,’No 80 Lagos street’
);
Highlight and execute
•Modifies existing data in a table.
•UPDATE table name SET column1 = value1, column2 = value2 WHERE condition;
•Example:
UPDATE[ student_information] Set [State]=CaseWHEN Age = 28 THEN ‘Abia State’WHEN Age = 40 THEN ‘Edo State’Else NullEnd