Posts

Showing posts from August, 2020

SQL INSERT statement

Image
                                                    The INSERT statement - Part I Example :          use employees; SELECT     * FROM     employees LIMIT 10; #insert data insert into employees(     emp_no,     birth_date,     first_name,     last_name,     gender,     hire_date ) values(     999901,     '1999-10-10',     'John',     'wick',     'M',     '2020-08-31'     );     SELECT     * FROM     employees WHERE     emp_no = 999901;                       ...

SQL SELECT statement

Image
                                                                             SELECT FROM SELECT - FROM - exercise Select the information from the “dept_no” column of the “departments” table. Select all data from the “departments” table.    SELECT - FROM - solution SELECT     dept_no FROM     departments;   SELECT     * FROM     departments;                                                             WHERE clause     It will allow us to set  ...

MySQL constraints

Image
                                                                   Constraint                 Constaints define a specific rules, or limits , that we define in our tables               - The roll of constraints is to outline the existing replationships between                          deffirent tables in our database.                   e.g : NOT NULL                 PRIMARY KEY CONSTRAINTS :           PRIMARY KEY constraint - exercise Drop the “customers” table and re-create it using the fo...