CREATE TABLE `businesses` (
  `business_id` INTEGER NOT NULL,
  `name` TEXT NOT NULL,
  `address` TEXT DEFAULT NULL,
  `city` TEXT DEFAULT NULL,
  `postal_code` TEXT DEFAULT NULL,
  `latitude` REAL DEFAULT NULL,
  `longitude` REAL DEFAULT NULL,
  `phone_number` INTEGER DEFAULT NULL,
  `tax_code` TEXT DEFAULT NULL,
  `business_certificate` INTEGER NOT NULL,
  `application_date` DATE DEFAULT NULL,
  `owner_name` TEXT NOT NULL,
  `owner_address` TEXT DEFAULT NULL,
  `owner_city` TEXT DEFAULT NULL,
  `owner_state` TEXT DEFAULT NULL,
  `owner_zip` TEXT DEFAULT NULL,
  PRIMARY KEY (`business_id`)
);
businesses
CREATE TABLE `inspections` (
  `business_id` INTEGER NOT NULL,
  `score` INTEGER DEFAULT NULL,
  `date` DATE NOT NULL,
  `type` TEXT NOT NULL,
  FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`)
);
inspections
CREATE TABLE `violations` (
  `business_id` INTEGER NOT NULL,
  `date` DATE NOT NULL,
  `violation_type_id` TEXT NOT NULL,
  `risk_category` TEXT NOT NULL,
  `description` TEXT NOT NULL,
  FOREIGN KEY (`business_id`) REFERENCES `businesses` (`business_id`)
);
violations
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,the unique id of the business ,integer,
date,,the date of the violation,date,
violation_type_id,violation type id,the unique type id of the violation,text,
risk_category,risk category,"risk category
High / Moderate / Low risk",text,"commonsense evidence:
High risks have more safety and health hazards than low risks"
description,,the description of the violation,text,
violations
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,the unique id of the business ,integer,
name,,the name of the eatery,text,
address,,the eatery address,text,
city,,the city where the eatery is located in,text,
postal_code,postal code,the postal code of the eatery,text,
latitude,,the latitude of the position,real,
longitude,,the longitude of the position,real,"commonsense evidence:
the distance between eatery A and eatery B = \sqrt{(latitude_A-latitude_B)^2 + (longitude_A-longitude_B)^2}"
phone_number,phone number,the phone number of the eatery,integer,
tax_code,tax code,the tax code of the eatery,text,
business_certificate,business certificate,the business certificate number,integer,
application_date,application date,the application date of the eatery,date,
owner_name,owner name,the owner's name,text,
owner_address,owner address,the owner's address,text,
owner_city,owner city,the city where the owner is located,text,
owner_state,owner state,the state where the owner is located,text,
owner_zip,owner zip,the zip code of the owner,text,
businesses
original_column_name,column_name,column_description,data_format,value_description
business_id,business id,the unique id of the business ,integer,
score,score,the inspection score,integer,"commonsense evidence:
The scores range from 1 to 100, where 100 means that the establishment meets all required standards. "
date,,the inspection date,date,
type,,the inspection type,text,
inspections