Category: sql
Given a table salary, such as the one below, that has m=male and f=female values. Swap all f and m values (i.e., change all f values to m and …
Given the following SQL Schema, CREATE TABLE If Not Exists point_2d (x INT NOT NULL, y INT NOT NULL) Truncate table point_2d insert into point_2d (x, y) values ('-1', …
Given the following SQL Schema: Create table If Not Exists Employee (Id int, Name varchar(255), Department varchar(255), ManagerId int) Truncate table Employee insert into Employee (Id, Name, Department, ManagerId) …
SQL Left Outer Join can be illustrated by the following: where the query will take everything from left table and those fields from the right table. Let’s take a …
Given a Relational Table stroing the nodes in a tree-like data structure, like this: +----+------+ | id | p_id | +----+------+ | 1 | null | | 2 | …