Advertisement
Gaela

Untitled

Dec 22nd, 2021 (edited)
1,727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 3.30 KB | None | 0 0
  1. <! CREATION TABLE LANGUAGE !>
  2.  
  3. mysql> CREATE TABLE language(
  4.     -> id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  5.     -> french BIT(1) NULL DEFAULT 1,
  6.     -> deutsch BIT(1) NULL DEFAULT 0,
  7.     -> english BIT(1) NULL DEFAULT 0);
  8. Query OK, 0 rows affected (0.06 sec)
  9.      
  10.       +---------+--------+------+-----+---------+----------------+
  11. | Field   | Type   | Null | Key | Default | Extra          |
  12. +---------+--------+------+-----+---------+----------------+
  13. | id      | int    | NO   | PRI | NULL    | auto_increment |
  14. | french  | bit(1) | YES  |     | b'1'    |                |
  15. | deutsch | bit(1) | YES  |     | b'0'    |                |
  16. | english | bit(1) | YES  |     | b'0'    |                |
  17. +---------+--------+------+-----+---------+----------------+
  18. 4 rows in set (0.00 sec)
  19.      
  20. [============================================================]
  21.      
  22.       <! CREATION TABLE pages !>
  23.      
  24.      
  25.       mysql> CREATE TABLE pages(
  26. -> id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  27. -> name_pages VARCHAR(50) NULL DEFAULT NULL,
  28. -> fk_sections INT NOT NULL);
  29. Query OK, 0 rows affected (0.07 sec)
  30.  
  31. mysql> DESCRIBE pages;
  32. +-------------+-------------+------+-----+---------+----------------+
  33. | Field       | Type        | Null | Key | Default | Extra          |
  34. +-------------+-------------+------+-----+---------+----------------+
  35. | id          | int         | NO   | PRI | NULL    | auto_increment |
  36. | name_pages  | varchar(50) | YES  |     | NULL    |                |
  37. | fk_sections | int         | NO   |     | NULL    |                |
  38. +-------------+-------------+------+-----+---------+----------------+
  39. 3 rows in set (0.00 sec)
  40.      
  41.      
  42. [============================================================]
  43.      
  44.          
  45.       <! CREATION TABLE sections !>
  46.      
  47.      
  48. mysql> CREATE TABLE sections (
  49.     -> id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  50.     -> name_sections VARCHAR(50) NULL DEFAULT NULL);
  51. Query OK, 0 rows affected (0.06 sec)
  52.  
  53. mysql> DESCRIBE sections;
  54. +---------------+-------------+------+-----+---------+----------------+
  55. | Field         | Type        | Null | Key | Default | Extra          |
  56. +---------------+-------------+------+-----+---------+----------------+
  57. | id            | int         | NO   | PRI | NULL    | auto_increment |
  58. | name_sections | varchar(50) | YES  |     | NULL    |                |
  59. +---------------+-------------+------+-----+---------+----------------+
  60. 2 rows in set (0.00 sec)
  61.  
  62. mysql>
  63.      
  64.      
  65. [============================================================]
  66.      
  67.          
  68.       <! CREATION TABLE JONCTION pages_sections !>
  69.  
  70. mysql> CREATE TABLE pages_sections(
  71.     -> id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
  72.     -> pages_id INT NOT NULL,
  73.     -> sections_id INT NOT NULL);
  74. Query OK, 0 rows affected (0.04 sec)
  75.  
  76. mysql> DESCRIBE pages_sections;
  77. +-------------+------+------+-----+---------+----------------+
  78. | Field       | Type | Null | Key | Default | Extra          |
  79. +-------------+------+------+-----+---------+----------------+
  80. | id          | int  | NO   | PRI | NULL    | auto_increment |
  81. | pages_id    | int  | NO   |     | NULL    |                |
  82. | sections_id | int  | NO   |     | NULL    |                |
  83. +-------------+------+------+-----+---------+----------------+
  84. 3 rows in set (0.00 sec)
  85.  
  86. mysql>
  87.  
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement