sql query checker code example

Example 1: sql query checker

CREATE TABLE employee

   ( employee_id VARCHAR(20),

    Name VARCHAR (20),

    Address VARCHAR (20),

    Mobile_no  SMALLINT);

Example 2: online sql testing tool

select * from sql_test_a

Example 3: online sql testing tool

12345678910111213141516171819202122232425CREATE TABLE sql_test_a (     ID         VARCHAR2(4000 BYTE),     FIRST_NAME VARCHAR2(200 BYTE),     LAST_NAME  VARCHAR2(200 BYTE)  ); CREATE TABLE sql_test_b (     ID         VARCHAR2(4000 BYTE));INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('1', 'John', 'Snow');INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('2', 'Mike', 'Tyson');INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('3', 'Bill', 'Keaton');INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('4', 'Greg', 'Mercury');INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('5', 'Steve', 'Jobs');INSERT INTO sql_test_a (ID, FIRST_NAME, LAST_NAME) VALUES ('6', 'Johhny', 'Depp');update sql_test_a set id = '200' where id ='1';  ההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Example 4: sql check

Adds a constraint that limits the value which can be added to a column.
Example 1 (MySQL): Makes sure any users added to the users table are 18
or over.
CREATE TABLE users (
first_name varchar(255),
age int,
CHECK (age>=18)
);
Example 2 (MySQL): Adds a check after the table has already been
created.
ALTER TABLE users
ADD CHECK (age>=18);

Tags:

Sql Example