{"action":"opened","number":3,"pull_request":{"url":"https://api.github.com/repos/kinley/course-db/pulls/3","id":56758603,"html_url":"https://github.com/kinley/course-db/pull/3","diff_url":"https://github.com/kinley/course-db/pull/3.diff","patch_url":"https://github.com/kinley/course-db/pull/3.patch","issue_url":"https://api.github.com/repos/kinley/course-db/issues/3","number":3,"state":"open","locked":false,"title":"Create Lection 2.md","user":{"login":"GZNigmatzyanova","id":14329544,"avatar_url":"https://avatars.githubusercontent.com/u/14329544?v=3","gravatar_id":"","url":"https://api.github.com/users/GZNigmatzyanova","html_url":"https://github.com/GZNigmatzyanova","followers_url":"https://api.github.com/users/GZNigmatzyanova/followers","following_url":"https://api.github.com/users/GZNigmatzyanova/following{/other_user}","gists_url":"https://api.github.com/users/GZNigmatzyanova/gists{/gist_id}","starred_url":"https://api.github.com/users/GZNigmatzyanova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GZNigmatzyanova/subscriptions","organizations_url":"https://api.github.com/users/GZNigmatzyanova/orgs","repos_url":"https://api.github.com/users/GZNigmatzyanova/repos","events_url":"https://api.github.com/users/GZNigmatzyanova/events{/privacy}","received_events_url":"https://api.github.com/users/GZNigmatzyanova/received_events","type":"User","site_admin":false},"body":"# Lection 2\r\n==========================================================\r\n\r\n## Введение в БД\r\n\r\n\r\n### ER модель базы данных\r\n---------------------\r\n**ER-модель** (entity-relationship model/сущность-связь) - модель данных, конструкция, позволяющая проектировать схему базы данных, с помощью графических средств (ER-диаграмм).\r\n\r\n**ER-диаграмма** - графическое изображение сущностей предметной области, их атрибутов и связей. ER-диаграмма может быть концептуальной (не учитывать особенности бд) и физической.\r\n\r\n**Сущность** - класс однотипных объектов / то, что представляет интерес для пользователя базы данных.\r\n**Экземпляр сущности** - конкретный представитель данной сущности.\r\n\r\n![Student](http://savepic.org/7718143.png)\r\n\r\n**Атрибут сущности** - именованная характеристика. являющаяся некоторым свойством сущности.\r\n**Ключ сущности** - не избыточный набор атрибутов, значения которых в совокупности является уникальным.\r\n**Связь** - некоторая ассоциация между двумя сущностями.\r\n\r\n**<u>Типы связей:</u>**\r\n\r\n*  Один-к-одному - один экземпляр первой сущности связан с одним экземпляром второй сущности.<i> (редко встречается)</i>\r\n\r\n*  Один-ко-многим - один экземпляр первой сущности связан с несколькими экземплярами второй сущности.\r\n\r\n*  Много-ко-многим - каждый экземпляр первой сущности связан с несколькими экземплярами второй сущности.<i> (чаще всего этот тип связи временный и допустим только на ранних этапах разработки, затем, чаще всего, он заменяется на двумя связями один-ко-многим и промежуточной таблицей)</i>\r\n\r\n\r\n**Модальность** - дополнительная оценочная информация о связях между сущностями.\r\n\r\n**<u>Существует 2 вида модальности:</u>**\r\n1) Может - экземпляр первой сущности может быть связан с один, несколькими или вообще не связан с экземплярами второй сущности.\r\n2) Должен - экземпляр первой сущности обязан быть связан не менее чем с одним экземпляром второй сущности.\r\n\r\n<i>Как определить?\r\nПостроить фразу:\r\n<Каждый экземпляр 1 сущностями><Модальность><Вид связи><Тип связи><Экземпляр второй сущности>\r\nПример:\r\n1)<Каждый преподаватель> <может> <преподавать> <несколько> <предметов>\r\n2)<Каждый предмет> <обязан> <принадлежать> <не менее чем одному> <преподавателю></i>\r\n\r\nДля построения ER-диаграммы существуют обозначения Питера Чена.\r\n![ОбозначенияПитераЧена](http://upload.akusherstvo.ru/image925409.png)\r\n","created_at":"2016-01-21T14:47:36Z","updated_at":"2016-01-21T14:47:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kinley/course-db/pulls/3/commits","review_comments_url":"https://api.github.com/repos/kinley/course-db/pulls/3/comments","review_comment_url":"https://api.github.com/repos/kinley/course-db/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kinley/course-db/issues/3/comments","statuses_url":"https://api.github.com/repos/kinley/course-db/statuses/fd8071b48b304deaec3a139adb6c0884e0b4b939","head":{"label":"GZNigmatzyanova:patch-3","ref":"patch-3","sha":"fd8071b48b304deaec3a139adb6c0884e0b4b939","user":{"login":"GZNigmatzyanova","id":14329544,"avatar_url":"https://avatars.githubusercontent.com/u/14329544?v=3","gravatar_id":"","url":"https://api.github.com/users/GZNigmatzyanova","html_url":"https://github.com/GZNigmatzyanova","followers_url":"https://api.github.com/users/GZNigmatzyanova/followers","following_url":"https://api.github.com/users/GZNigmatzyanova/following{/other_user}","gists_url":"https://api.github.com/users/GZNigmatzyanova/gists{/gist_id}","starred_url":"https://api.github.com/users/GZNigmatzyanova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GZNigmatzyanova/subscriptions","organizations_url":"https://api.github.com/users/GZNigmatzyanova/orgs","repos_url":"https://api.github.com/users/GZNigmatzyanova/repos","events_url":"https://api.github.com/users/GZNigmatzyanova/events{/privacy}","received_events_url":"https://api.github.com/users/GZNigmatzyanova/received_events","type":"User","site_admin":false},"repo":{"id":42651991,"name":"course-db","full_name":"GZNigmatzyanova/course-db","owner":{"login":"GZNigmatzyanova","id":14329544,"avatar_url":"https://avatars.githubusercontent.com/u/14329544?v=3","gravatar_id":"","url":"https://api.github.com/users/GZNigmatzyanova","html_url":"https://github.com/GZNigmatzyanova","followers_url":"https://api.github.com/users/GZNigmatzyanova/followers","following_url":"https://api.github.com/users/GZNigmatzyanova/following{/other_user}","gists_url":"https://api.github.com/users/GZNigmatzyanova/gists{/gist_id}","starred_url":"https://api.github.com/users/GZNigmatzyanova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GZNigmatzyanova/subscriptions","organizations_url":"https://api.github.com/users/GZNigmatzyanova/orgs","repos_url":"https://api.github.com/users/GZNigmatzyanova/repos","events_url":"https://api.github.com/users/GZNigmatzyanova/events{/privacy}","received_events_url":"https://api.github.com/users/GZNigmatzyanova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GZNigmatzyanova/course-db","description":"DB basics. KFU. SE department.","fork":true,"url":"https://api.github.com/repos/GZNigmatzyanova/course-db","forks_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/forks","keys_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/teams","hooks_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/hooks","issue_events_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/issues/events{/number}","events_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/events","assignees_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/assignees{/user}","branches_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/branches{/branch}","tags_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/tags","blobs_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/git/refs{/sha}","trees_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/statuses/{sha}","languages_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/languages","stargazers_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/stargazers","contributors_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/contributors","subscribers_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/subscribers","subscription_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/subscription","commits_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/commits{/sha}","git_commits_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/git/commits{/sha}","comments_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/comments{/number}","issue_comment_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/issues/comments{/number}","contents_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/contents/{+path}","compare_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/merges","archive_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/downloads","issues_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/issues{/number}","pulls_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/pulls{/number}","milestones_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/milestones{/number}","notifications_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/labels{/name}","releases_url":"https://api.github.com/repos/GZNigmatzyanova/course-db/releases{/id}","created_at":"2015-09-17T11:18:36Z","updated_at":"2016-01-21T11:16:04Z","pushed_at":"2016-01-21T14:46:03Z","git_url":"git://github.com/GZNigmatzyanova/course-db.git","ssh_url":"git@github.com:GZNigmatzyanova/course-db.git","clone_url":"https://github.com/GZNigmatzyanova/course-db.git","svn_url":"https://github.com/GZNigmatzyanova/course-db","homepage":"","size":20,"stargazers_count":0,"watchers_count":0,"language":"PLSQL","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kinley:master","ref":"master","sha":"81ff6222dbd69441ecfd4c9e75258c3962d53027","user":{"login":"kinley","id":566706,"avatar_url":"https://avatars.githubusercontent.com/u/566706?v=3","gravatar_id":"","url":"https://api.github.com/users/kinley","html_url":"https://github.com/kinley","followers_url":"https://api.github.com/users/kinley/followers","following_url":"https://api.github.com/users/kinley/following{/other_user}","gists_url":"https://api.github.com/users/kinley/gists{/gist_id}","starred_url":"https://api.github.com/users/kinley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinley/subscriptions","organizations_url":"https://api.github.com/users/kinley/orgs","repos_url":"https://api.github.com/users/kinley/repos","events_url":"https://api.github.com/users/kinley/events{/privacy}","received_events_url":"https://api.github.com/users/kinley/received_events","type":"User","site_admin":false},"repo":{"id":13373728,"name":"course-db","full_name":"kinley/course-db","owner":{"login":"kinley","id":566706,"avatar_url":"https://avatars.githubusercontent.com/u/566706?v=3","gravatar_id":"","url":"https://api.github.com/users/kinley","html_url":"https://github.com/kinley","followers_url":"https://api.github.com/users/kinley/followers","following_url":"https://api.github.com/users/kinley/following{/other_user}","gists_url":"https://api.github.com/users/kinley/gists{/gist_id}","starred_url":"https://api.github.com/users/kinley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinley/subscriptions","organizations_url":"https://api.github.com/users/kinley/orgs","repos_url":"https://api.github.com/users/kinley/repos","events_url":"https://api.github.com/users/kinley/events{/privacy}","received_events_url":"https://api.github.com/users/kinley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kinley/course-db","description":"DB basics. KFU. SE department.","fork":false,"url":"https://api.github.com/repos/kinley/course-db","forks_url":"https://api.github.com/repos/kinley/course-db/forks","keys_url":"https://api.github.com/repos/kinley/course-db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kinley/course-db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kinley/course-db/teams","hooks_url":"https://api.github.com/repos/kinley/course-db/hooks","issue_events_url":"https://api.github.com/repos/kinley/course-db/issues/events{/number}","events_url":"https://api.github.com/repos/kinley/course-db/events","assignees_url":"https://api.github.com/repos/kinley/course-db/assignees{/user}","branches_url":"https://api.github.com/repos/kinley/course-db/branches{/branch}","tags_url":"https://api.github.com/repos/kinley/course-db/tags","blobs_url":"https://api.github.com/repos/kinley/course-db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kinley/course-db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kinley/course-db/git/refs{/sha}","trees_url":"https://api.github.com/repos/kinley/course-db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kinley/course-db/statuses/{sha}","languages_url":"https://api.github.com/repos/kinley/course-db/languages","stargazers_url":"https://api.github.com/repos/kinley/course-db/stargazers","contributors_url":"https://api.github.com/repos/kinley/course-db/contributors","subscribers_url":"https://api.github.com/repos/kinley/course-db/subscribers","subscription_url":"https://api.github.com/repos/kinley/course-db/subscription","commits_url":"https://api.github.com/repos/kinley/course-db/commits{/sha}","git_commits_url":"https://api.github.com/repos/kinley/course-db/git/commits{/sha}","comments_url":"https://api.github.com/repos/kinley/course-db/comments{/number}","issue_comment_url":"https://api.github.com/repos/kinley/course-db/issues/comments{/number}","contents_url":"https://api.github.com/repos/kinley/course-db/contents/{+path}","compare_url":"https://api.github.com/repos/kinley/course-db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kinley/course-db/merges","archive_url":"https://api.github.com/repos/kinley/course-db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kinley/course-db/downloads","issues_url":"https://api.github.com/repos/kinley/course-db/issues{/number}","pulls_url":"https://api.github.com/repos/kinley/course-db/pulls{/number}","milestones_url":"https://api.github.com/repos/kinley/course-db/milestones{/number}","notifications_url":"https://api.github.com/repos/kinley/course-db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kinley/course-db/labels{/name}","releases_url":"https://api.github.com/repos/kinley/course-db/releases{/id}","created_at":"2013-10-07T02:40:11Z","updated_at":"2015-11-01T21:23:56Z","pushed_at":"2016-01-21T11:16:04Z","git_url":"git://github.com/kinley/course-db.git","ssh_url":"git@github.com:kinley/course-db.git","clone_url":"https://github.com/kinley/course-db.git","svn_url":"https://github.com/kinley/course-db","homepage":"","size":255,"stargazers_count":0,"watchers_count":0,"language":"PLSQL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kinley/course-db/pulls/3"},"html":{"href":"https://github.com/kinley/course-db/pull/3"},"issue":{"href":"https://api.github.com/repos/kinley/course-db/issues/3"},"comments":{"href":"https://api.github.com/repos/kinley/course-db/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/kinley/course-db/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/kinley/course-db/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kinley/course-db/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/kinley/course-db/statuses/fd8071b48b304deaec3a139adb6c0884e0b4b939"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":87,"deletions":0,"changed_files":1}}