You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
3.0 KiB

  1. MySQL database "literature", table "queries"
  2. ============================================
  3. field names
  4. -----------
  5. fields available in table "queries" description
  6. ----------------------------------- -----------
  7. query_id the unique ID number of this query entry
  8. user_id the user's unique ID number (which corresponds to the user_id number of the user's record entry within the "users" table)
  9. query_name the name that was assigned by the user to this query
  10. display_type the type of display requested by the user: either 'Display', 'Cite' or '' ('' will produce the default columnar output style)
  11. view_type the view type requested by the user: either 'Print', 'Web' or '' ('' will produce the default 'Web' output style)
  12. query the SQL query
  13. show_query specifies whether the SQL query will be displayed with the output ('1') or not ('0')
  14. show_links specifies whether links will be displayed with the output ('1') or not ('0')
  15. show_rows specifies how many rows will be displayed per results page (must be a positive integer)
  16. cite_style_selector the citation style chosen by the user
  17. cite_order specifies how the data will get sorted on citation (if this param is set to 'year', records will be listed in blocks sorted by year)
  18. last_execution the date & time this query was executed last
  19. column types
  20. ------------
  21. query_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
  22. user_id MEDIUMINT UNSIGNED NOT NULL
  23. query_name VARCHAR(255)
  24. display_type VARCHAR(25)
  25. view_type VARCHAR(25)
  26. query TEXT
  27. show_query TINYINT UNSIGNED
  28. show_links TINYINT UNSIGNED
  29. show_rows MEDIUMINT UNSIGNED
  30. cite_style_selector VARCHAR(50)
  31. cite_order VARCHAR(25)
  32. last_execution DATETIME
  33. INDEX (user_id,query_name)
  34. table creation code
  35. -------------------
  36. CREATE TABLE queries (query_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id MEDIUMINT UNSIGNED NOT NULL, query_name VARCHAR(255), display_type VARCHAR(25), view_type VARCHAR(25), query TEXT, show_query TINYINT UNSIGNED, show_links TINYINT UNSIGNED, show_rows MEDIUMINT UNSIGNED, cite_style_selector VARCHAR(50), cite_order VARCHAR(25), last_execution DATETIME, INDEX (user_id,query_name));
  37. rules for data import
  38. ---------------------
  39. - fields are separated by tabs, records are separated by returns (if not specified otherwise within the LOAD DATA statement)
  40. - order of fields must resemble the above field order!
  41. - DATE format must be YYYY-MM-DD
  42. - TIME format must be HH:MM:SS
  43. - carriage returns *within* fields (ASCII character 11) must be replaced with a "UNIX return" (ASCII character 10) -> Search for: (\x0B) Replace with: \\n
  44. - empty fields are indicated by \N -> Search for: (?<=\t|^)(?=\t|$) Replace with: \\N
  45. - character encoding: higher ASCII chars must be encoded as ISO-8859-1
  46. - file encoding must be UNIX
  47. load data code
  48. --------------
  49. LOAD DATA LOCAL INFILE "/PATH/TO/FILE/queries.txt" INTO TABLE queries;
  50. or, alternatively, use something like the following from your shell:
  51. mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/queries.txt"