This is my first post. In his 20s, he is a fledgling engineer who has real estate, has no experience in his 30s, and has been offered a job hunting by the company he developed in-house. Today I will write about Mysql.
It is a program that extracts items that meet certain conditions from land data. We will pick up land with a unit price of 1 million yen or less.
From create TABLE.
--Create table(Column: id:m2 :price)
CREATE TABLE rands(
id INT NOT NULL AUTO_INCREMENT,
m2 INT,
price INT,
PRIMARY KEY (id)
);
--Then put the data in the table
INSERT INTO rands (m2, price) VALUES
(200, 100000000),
(300, 30000000),
(500, 40000000),
(100, 50000000);
--* SELECT (all data) and retrieve the data from the rands table in a form that meets the conditions with WHERE.
--Since it is a "unit price per tsubo", the constant 3.Insert 30578.
SELECT * FROM rands WHERE price / m2 * 3.30578 < 1000000 ;
This time I made a table and started by inserting data, If the data is accumulated,
SELECT *FROM table name WHERE condition;
You can get it at. that's all.
Recommended Posts