I want to create a table in SQLyog but after running this query it throws me an error can someone help me out to find this error.
CREATE TABLE survey_mis_temp (survey_id BIGINT(20) PRIMARY KEY,orchardist_name VARCHAR(100),
father_or_husband_name VARCHAR(100),contact_landline BIGINT(20),contact_mobile BIGINT(20),
aadhar_number VARCHAR(20),village VARCHAR(100),post_office VARCHAR(100),
panchayat VARCHAR(100),dev_block VARCHAR(100),tehsil VARCHAR(100),district VARCHAR(100),
assembly_constituency VARCHAR(100),state VARCHAR(50),social_group VARCHAR(50),
cluster_name VARCHAR(50),main_occupation VARCHAR(100),subsdiary_occupation VARCHAR(100),
family_member_no INT(11),family_mem_eng_horticulture INT(11),orchard_distance INT(11),
orchard_dist_unit VARCHAR(10),orchard_elevation_feet INT(11),total_land_holding INT(11),
total_land_holding_unit VARCHAR(10),total_land_holding_small INT(11),total_land_holding_unit_small VARCHAR(10),
irrigated_area INT(11),irrigated_area_unit VARCHAR(10),irrigated_area_small INT(11),
irrigated_area_unit_small VARCHAR(10),irrigation_type_drip INT(11),irrigation_type_drip_unit VARCHAR(10),
irrigation_type_drip_small INT(11),irrigation_type_drip_unit_small VARCHAR(10),irrigation_type_sprinkler INT(11),
irrigation_type_sprinkler_unit VARCHAR(10),irrigation_type_sprinkler_small INT(11),
irrigation_type_sprinkler_unit_small VARCHAR(10),irrigation_type_tubewell INT(11),irrigation_type_tubewell_unit VARCHAR(10),
irrigation_type_tubewell_small INT(11),irrigation_type_tubewell_unit_small VARCHAR(10),irrigation_type_tank INT(11),
irrigation_type_tank_unit VARCHAR(10),irrigation_type_tank_small INT(11),irrigation_type_tank_unit_small VARCHAR(10),
irrigation_type_kuhal INT(11),irrigation_type_kuhal_unit VARCHAR(10),irrigation_type_kuhal_small INT(11),
irrigation_type_kuhal_unit_small VARCHAR(10),total_irrigated_area INT(11),total_irrigated_area_unit VARCHAR(10),
total_irrigated_area_small INT(11),total_irrigated_area_unit_small VARCHAR(10),orchard_irrigated_area INT(11),
orchard_irrigated_area_unit VARCHAR(10),orchard_irrigated_area_small INT(11),
orchard_irrigated_area_unit_small VARCHAR(10),un_irrigated INT(11),
un_irrigated_unit VARCHAR(10),un_irrigated_small INT(11),un_irrigated_unit_small VARCHAR(10),
distance_from_house_godown INT(11),distance_from_house_godown_unit VARCHAR(10),agriculture_crop INT(11),
agriculture_crop_unit VARCHAR(10),agriculture_crop_small INT(11),agriculture_crop_unit_small VARCHAR(10),
land_holding_fruits INT(11),land_holding_fruits_unit VARCHAR(10),land_holding_fruits_small INT(11),
land_holding_fruits_unit_small VARCHAR(10),land_holding_veg INT(11),land_holding_veg_unit VARCHAR(10),
land_holding_veg_small INT(11),land_holding_veg_unit_small VARCHAR(10),land_holding_others INT(11),
land_holding_others_unit VARCHAR(10),land_holding_others_small INT(11),land_holding_others_unit_small VARCHAR(10),
godown_separate VARCHAR(50),terrain_type VARCHAR(50),terrain_aspect VARCHAR(100),soil_type VARCHAR(10),
created_by VARCHAR(50),created_on DATETIME,updated_on DATETIME,updated_by VARCHAR(50),approved_by VARCHAR(50),
survey_status INT(11),is_horticulture INT(1),latitude DOUBLE,longitude DOUBLE,orchard_type VARCHAR(100),
pattern_name VARCHAR(100),root_stock_used VARCHAR(100),fruit_area INT(11),fruit_area_unit VARCHAR(10),
fruit_area_small INT(11),area_unit_small VARCHAR(10),farming_system_name VARCHAR(100),
fruit_crop_name VARCHAR(200),farming_system_area INT(11),farming_system_area_unit VARCHAR(10),
farming_system_area_small INT(11),farming_system_area_unit_small VARCHAR(10),fruit_plant_kind VARCHAR(100),
fruit_plant_variety VARCHAR(100),rootstock VARCHAR(50), 5-10 Years (DECIMAL(32,0)), 10-15 Years (DECIMAL(32,0)),
15-20 Years (DECIMAL(32,0)), 25 Years Above (DECIMAL(32,0)),flower_kind VARCHAR(100),flower_variety VARCHAR(100),
open_area INT(11),protected_area INT(11),area_unit VARCHAR(10),total_area INT(11),total_area_unit VARCHAR(10),
cut_flower_produced DECIMAL(8,2),loose_flower_production DECIMAL(8,2),plotted_plant_production INT(11),
polybag_plant_production INT(11),market_name_produce_sold VARCHAR(100),value_in_lac_market DECIMAL(8,2),
tool_kind VARCHAR(100),tool_number INT(11),tool_cost DECIMAL(8,2),financial_assistance VARCHAR(100),
scheme_name VARCHAR(100),high_level_nos INT(11),high_total_area INT(11),low_level_nos INT(11),low_total_area INT(11),
tool_total_area INT(11),total_nos INT(11),crop_grown_name VARCHAR(100),production_qty INT(11),
production_unit DECIMAL(8,2),prod_area INT(11),production INT(11),qty_self_used INT(11),
quantity_sold INT(11),prod_value_in_lac DECIMAL(8,2),area_mushroom_house INT(11),
area_mushroom_house_unit VARCHAR(10),area_mushroom_house_small INT(11),area_mushroom_house_unit_small VARCHAR(10),
no_of_trays INT(11),crops_taken_nos INT(11),mushroom_type VARCHAR(100),production_in_mt DECIMAL(8,2),
mushroom_value_in_lac DECIMAL(8,2),bee_colony_nos VARCHAR(100),type_of_bee VARCHAR(50),bee_colony_multiply INT(11),
bee_colony_polination_nos VARCHAR(50),bee_colony_polination_rental_val DECIMAL(8,2),flora_type VARCHAR(100),
honey_production INT(11),honey_value DECIMAL(8,2),water_resource VARCHAR(100),water_unit VARCHAR(20),
water_qty DECIMAL(8,2),infra_name VARCHAR(100),infra_address VARCHAR(100),infra_capacity INT(11),
infra_total_cost INT(11),infra_financial_assistance DECIMAL(8,2),infra_scheme_name VARCHAR(100),
tissue_cul_address VARCHAR(100),tissue_cul_capacity INT(11),tissue_cul_total_cost INT(11),
tissue_cul_fin_assistance VARCHAR(10),tissue_cul_scheme_name VARCHAR(100),tissue_cul_plant_name VARCHAR(100),
tissue_cul_plant_address INT(11),farm_type VARCHAR(100),farm_address VARCHAR(100),farm_area INT(11),
farm_area_unit VARCHAR(10),farm_area_small INT(11),farm_area_small_unit VARCHAR(10),farm_plant_name VARCHAR(100),
farm_production_in_mt DECIMAL(8,2),inputs VARCHAR(100),input_qty INT(11),input_qty_unit VARCHAR(10),input_value INT(11),
input_area_unit VARCHAR(10),input_farmcost VARCHAR(100),farmcost_value INT(11),horticulture_activity VARCHAR(100),
family_labour DECIMAL(8,2),hired_labour DECIMAL(8,2),total_mandays DECIMAL(8,2),
fruit_crop_cultivation_problem LONGTEXT,fruit_crop_storage_problem LONGTEXT,fruit_crop_transport_problem LONGTEXT,
fruit_crop_marketing_problem LONGTEXT,fruit_crop_others_problem LONGTEXT,flower_crop_cultivation_problem LONGTEXT,
flower_crop_storage_problem LONGTEXT,flower_crop_transport_problem LONGTEXT,flower_crop_marketing_problem LONGTEXT,
flower_crop_others_problem LONGTEXT,mushroom_crop_cultivation_problem LONGTEXT,
mushroom_crop_storage_problem LONGTEXT,mushroom_crop_transport_problem LONGTEXT,
mushroom_crop_marketing_problem LONGTEXT,mushroom_crop_others_problem LONGTEXT,bee_keeping_storage_problem LONGTEXT,
bee_keeping_transport_problem LONGTEXT,bee_keeping_marketing_problem LONGTEXT,bee_keeping_others_problem LONGTEXT);
After running this query it throws me this error:
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '5-10_Years (decimal(32,0)), 10-15_Years (decimal(32,0)),
15-20 Years (decimal...' at line 36
Can someone tell me where I did it wrong and what am I missing? Error is in line 36 near 5-10 year is the column name the issue?
CodePudding user response:
This query works for me:
CREATE TABLE survey_mis_temp (survey_id BIGINT(20) PRIMARY KEY,orchardist_name VARCHAR(100),
father_or_husband_name VARCHAR(100),contact_landline BIGINT(20),contact_mobile BIGINT(20),
aadhar_number VARCHAR(20),village VARCHAR(100),post_office VARCHAR(100),
panchayat VARCHAR(100),dev_block VARCHAR(100),tehsil VARCHAR(100),district VARCHAR(100),
assembly_constituency VARCHAR(100),state VARCHAR(50),social_group VARCHAR(50),
cluster_name VARCHAR(50),main_occupation VARCHAR(100),subsdiary_occupation VARCHAR(100),
family_member_no INT(11),family_mem_eng_horticulture INT(11),orchard_distance INT(11),
orchard_dist_unit VARCHAR(10),orchard_elevation_feet INT(11),total_land_holding INT(11),
total_land_holding_unit VARCHAR(10),total_land_holding_small INT(11),total_land_holding_unit_small VARCHAR(10),
irrigated_area INT(11),irrigated_area_unit VARCHAR(10),irrigated_area_small INT(11),
irrigated_area_unit_small VARCHAR(10),irrigation_type_drip INT(11),irrigation_type_drip_unit VARCHAR(10),
irrigation_type_drip_small INT(11),irrigation_type_drip_unit_small VARCHAR(10),irrigation_type_sprinkler INT(11),
irrigation_type_sprinkler_unit VARCHAR(10),irrigation_type_sprinkler_small INT(11),
irrigation_type_sprinkler_unit_small VARCHAR(10),irrigation_type_tubewell INT(11),irrigation_type_tubewell_unit VARCHAR(10),
irrigation_type_tubewell_small INT(11),irrigation_type_tubewell_unit_small VARCHAR(10),irrigation_type_tank INT(11),
irrigation_type_tank_unit VARCHAR(10),irrigation_type_tank_small INT(11),irrigation_type_tank_unit_small VARCHAR(10),
irrigation_type_kuhal INT(11),irrigation_type_kuhal_unit VARCHAR(10),irrigation_type_kuhal_small INT(11),
irrigation_type_kuhal_unit_small VARCHAR(10),total_irrigated_area INT(11),total_irrigated_area_unit VARCHAR(10),
total_irrigated_area_small INT(11),total_irrigated_area_unit_small VARCHAR(10),orchard_irrigated_area INT(11),
orchard_irrigated_area_unit VARCHAR(10),orchard_irrigated_area_small INT(11),
orchard_irrigated_area_unit_small VARCHAR(10),un_irrigated INT(11),
un_irrigated_unit VARCHAR(10),un_irrigated_small INT(11),un_irrigated_unit_small VARCHAR(10),
distance_from_house_godown INT(11),distance_from_house_godown_unit VARCHAR(10),agriculture_crop INT(11),
agriculture_crop_unit VARCHAR(10),agriculture_crop_small INT(11),agriculture_crop_unit_small VARCHAR(10),
land_holding_fruits INT(11),land_holding_fruits_unit VARCHAR(10),land_holding_fruits_small INT(11),
land_holding_fruits_unit_small VARCHAR(10),land_holding_veg INT(11),land_holding_veg_unit VARCHAR(10),
land_holding_veg_small INT(11),land_holding_veg_unit_small VARCHAR(10),land_holding_others INT(11),
land_holding_others_unit VARCHAR(10),land_holding_others_small INT(11),land_holding_others_unit_small VARCHAR(10),
godown_separate VARCHAR(50),terrain_type VARCHAR(50),terrain_aspect VARCHAR(100),soil_type VARCHAR(10),
created_by VARCHAR(50),created_on DATETIME,updated_on DATETIME,updated_by VARCHAR(50),approved_by VARCHAR(50),
survey_status INT(11),is_horticulture INT(1),latitude DOUBLE,longitude DOUBLE,orchard_type VARCHAR(100),
pattern_name VARCHAR(100),root_stock_used VARCHAR(100),fruit_area INT(11),fruit_area_unit VARCHAR(10),
fruit_area_small INT(11),area_unit_small VARCHAR(10),farming_system_name VARCHAR(100),
fruit_crop_name VARCHAR(200),farming_system_area INT(11),farming_system_area_unit VARCHAR(10),
farming_system_area_small INT(11),farming_system_area_unit_small VARCHAR(10),fruit_plant_kind VARCHAR(100),
fruit_plant_variety VARCHAR(100), rootstock VARCHAR(50), `5-10 Years` DECIMAL(32,0), `10-15 Years` DECIMAL(32,0),
`15-20 Years` DECIMAL(32,0), `25 Years Above` DECIMAL(32,0),flower_kind VARCHAR(100),flower_variety VARCHAR(100),
open_area INT(11),protected_area INT(11),area_unit VARCHAR(10),total_area INT(11),total_area_unit VARCHAR(10),
cut_flower_produced DECIMAL(8,2),loose_flower_production DECIMAL(8,2),plotted_plant_production INT(11),
polybag_plant_production INT(11),market_name_produce_sold VARCHAR(100),value_in_lac_market DECIMAL(8,2),
tool_kind VARCHAR(100),tool_number INT(11),tool_cost DECIMAL(8,2),financial_assistance VARCHAR(100),
scheme_name VARCHAR(100),high_level_nos INT(11),high_total_area INT(11),low_level_nos INT(11),low_total_area INT(11),
tool_total_area INT(11),total_nos INT(11),crop_grown_name VARCHAR(100),production_qty INT(11),
production_unit DECIMAL(8,2),prod_area INT(11),production INT(11),qty_self_used INT(11),
quantity_sold INT(11),prod_value_in_lac DECIMAL(8,2),area_mushroom_house INT(11),
area_mushroom_house_unit VARCHAR(10),area_mushroom_house_small INT(11),area_mushroom_house_unit_small VARCHAR(10),
no_of_trays INT(11),crops_taken_nos INT(11),mushroom_type VARCHAR(100),production_in_mt DECIMAL(8,2),
mushroom_value_in_lac DECIMAL(8,2),bee_colony_nos VARCHAR(100),type_of_bee VARCHAR(50),bee_colony_multiply INT(11),
bee_colony_polination_nos VARCHAR(50),bee_colony_polination_rental_val DECIMAL(8,2),flora_type VARCHAR(100),
honey_production INT(11),honey_value DECIMAL(8,2),water_resource VARCHAR(100),water_unit VARCHAR(20),
water_qty DECIMAL(8,2),infra_name VARCHAR(100),infra_address VARCHAR(100),infra_capacity INT(11),
infra_total_cost INT(11),infra_financial_assistance DECIMAL(8,2),infra_scheme_name VARCHAR(100),
tissue_cul_address VARCHAR(100),tissue_cul_capacity INT(11),tissue_cul_total_cost INT(11),
tissue_cul_fin_assistance VARCHAR(10),tissue_cul_scheme_name VARCHAR(100),tissue_cul_plant_name VARCHAR(100),
tissue_cul_plant_address INT(11),farm_type VARCHAR(100),farm_address VARCHAR(100),farm_area INT(11),
farm_area_unit VARCHAR(10),farm_area_small INT(11),farm_area_small_unit VARCHAR(10),farm_plant_name VARCHAR(100),
farm_production_in_mt DECIMAL(8,2),inputs VARCHAR(100),input_qty INT(11),input_qty_unit VARCHAR(10),input_value INT(11),
input_area_unit VARCHAR(10),input_farmcost VARCHAR(100),farmcost_value INT(11),horticulture_activity VARCHAR(100),
family_labour DECIMAL(8,2),hired_labour DECIMAL(8,2),total_mandays DECIMAL(8,2),
fruit_crop_cultivation_problem LONGTEXT,fruit_crop_storage_problem LONGTEXT,fruit_crop_transport_problem LONGTEXT,
fruit_crop_marketing_problem LONGTEXT,fruit_crop_others_problem LONGTEXT,flower_crop_cultivation_problem LONGTEXT,
flower_crop_storage_problem LONGTEXT,flower_crop_transport_problem LONGTEXT,flower_crop_marketing_problem LONGTEXT,
flower_crop_others_problem LONGTEXT,mushroom_crop_cultivation_problem LONGTEXT,
mushroom_crop_storage_problem LONGTEXT,mushroom_crop_transport_problem LONGTEXT,
mushroom_crop_marketing_problem LONGTEXT,mushroom_crop_others_problem LONGTEXT,bee_keeping_storage_problem LONGTEXT,
bee_keeping_transport_problem LONGTEXT,bee_keeping_marketing_problem LONGTEXT,bee_keeping_others_problem LONGTEXT);
I have put ` (tilt) around all the column names of year and removed () parenthesis from decimal data type