Question: CREATE TABLE emp ( name text, salary numeric, age integer, cubicle point ) ; # Creates a table name emp with 4 columns name, salary,

CREATE TABLE emp (
name text,
salary numeric,
age integer,
cubicle point
); # Creates a table name emp with 4 columns name, salary, age and cubicle
INSERT INTO emp VALUES ('Bill',4200,45,'(2,1)'),('Jane',4500,34,'(2,1)'); # Inserts values into each column
CREATE FUNCTION double salary(emp) RETURNS numeric AS $$
SELECT $1.salary *2 AS salary;
$$ LANGUAGE SQL;
SELECT name, double_salary(emp.*) AS dream
FROM emp
WHERE emp.cubicle ~= point '(2,1)';

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!