Last active
December 23, 2015 10:29
-
-
Save penso/6621519 to your computer and use it in GitHub Desktop.
Friends table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> desc relationships; | |
+-----------+------------+------+-----+---------+-------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-----------+------------+------+-----+---------+-------+ | |
| user_id | int(11) | NO | PRI | 0 | | | |
| friend_id | int(11) | NO | PRI | 0 | | | |
| status | tinyint(4) | NO | | 0 | | | |
+-----------+------------+------+-----+---------+-------+ | |
3 rows in set (0.00 sec) | |
mysql> show indexes from relationships; | |
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | |
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | | |
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | |
| relationships | 0 | PRIMARY | 1 | user_id | A | 0 | NULL | NULL | | BTREE | | | |
| relationships | 0 | PRIMARY | 2 | friend_id | A | 0 | NULL | NULL | | BTREE | | | |
+---------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+ | |
2 rows in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment