Ashish Patel: Notes

Atom feed

Recently added: Conventional commits, Cli, Shortcuts, Subscriptions, Topic

Basics

Create table

--Create the main employee table
CREATE TABLE employee (
  id int PRIMARY KEY,
  name varchar(255),
  age int
);

--Create the employee age table
CREATE TABLE employee_age (
  id int PRIMARY KEY,
  age int
);

Insert

INSERT INTO employee
  VALUES (1, 'Ashish', 'Pune');
INSERT INTO employee
  VALUES (2, 'patel', 'Nagpur');
INSERT INTO employee
  VALUES (4, 'Ansu', 'Bikaner');

INSERT INTO employee_age
  VALUES (1, 23);
INSERT INTO employee_age
  VALUES (2, 27);
INSERT INTO employee_age
  VALUES (3, 21);

Select

SELECT * FROM employee;
id name city
1 Ashish Pune
2 patel Nagpur
4 Ansu Bikaner
SELECT * FROM employee_age;
id age
1 23
2 27
3 21

Created 2019-01-23T11:57:03+05:30, updated 2024-10-27T19:38:33+00:00 · History · Edit