Jed Rembold
Monday, September 15, 2025
Suppose I have a table which was created as seen to the right, which contains information on spheres formed of different materials. If I then ran the below right query to compute the radius of each of the spheres, what would the resulting data type be?
CREATE TABLE rev (
material_name TEXT,
ball_mass INT,
mat_dens REAL
);
SELECT
||/( ball_mass / mat_dens /
(4 / 3) / 3.14) AS radius
FROM rev;
Sometimes, especially as we continue to build sophistication in our queries, you may want to save the output of a query to another database table
This can give you a multistep process in approaching more complicated actions
To set a table to a query output, use the
AS keyword
CREATE TABLE |||my new table||| AS (
|||some SELECT query|||
);This table will have columns name according to the select output, so aliases can be important!
TEMP before
TABLE