{"id":434553,"date":"2018-04-25T03:59:13","date_gmt":"2018-04-25T03:59:13","guid":{"rendered":"https:\/\/essaypaper.org\/assignment-on-creating-sql-table-relationships\/"},"modified":"2018-10-24T09:08:56","modified_gmt":"2018-10-24T09:08:56","slug":"assignment-on-creating-sql-table-relationships","status":"publish","type":"post","link":"https:\/\/www.benedictsol.com\/blogs\/assignment-on-creating-sql-table-relationships\/","title":{"rendered":"Assignment on Creating SQL Table Relationships"},"content":{"rendered":"<div>\n<blockquote>\n<p><em>This assignment on SQL table relationships was completed by an expert who is knowledgeable in the IT sphere. You can read this sample, but you can\u2019t present it as your own homework. On our blog, in addition to this sample, a variety of different examples of tasks and their solutions are presented. In any case, the use of our service will be helpful for you, as we also offer expert help. It is worth paying attention to Assignment.EssayShark.com because we offer the best help with technical assignments on the market.<\/em><\/p>\n<p><em>While your order is being completed, you have the opportunity to contact the expert directly via chat and ask any questions. Our service occupies a special place in students\u2019 lives. First of all, it concerns those students who don\u2019t have time to deal with their homework. Using our service is absolutely legal, and your personal information will be secure. Read our IT sample to see how our experts solve tasks.<\/em><span id=\"more-7912\"\/><\/p>\n<\/blockquote>\n<h2><strong>Creating Tables and Establishing Relationships Using SQL<\/strong><\/h2>\n<p>The Department of labor and wages, on the basis of specifications of products, schedules a production plan of demand for workers of different specialties and qualifications.<\/p>\n<p>Input information:<\/p>\n<p>The Production Department gives the specifications of the product and the need, in hours, for workers of different professions and places in the context of workshops and production units for each product.<\/p>\n<p>The planning section generates the schedule of release, which contains the planned number of products of each type for each date.<\/p>\n<p>Listed is the creation of tables and relationships between them and basic queries of SQL. Note: creating a database is done in SQL Server 2014.<\/p>\n<p><span style=\"color: #0000ff;\">CREATE DATABASE<\/span> WorkforcePlanning<\/p>\n<p><span style=\"color: #0000ff;\">CREATE TABLE<\/span> Department (ID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Name <span style=\"color: #0000ff;\">nvarchar<\/span>(40) NOT NULL ,<br \/><span style=\"color: #0000ff;\">PRIMARY KEY<\/span> (ID))<\/p>\n<p><span style=\"color: #0000ff;\">CREATE TABLE<\/span> Speciality (ID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>DepartmentID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Name <span style=\"color: #0000ff;\">nvarchar<\/span>(40) NOT NULL,<br \/>Qualification <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Gap <span style=\"color: #0000ff;\">time<\/span> NOT NULL,<br \/><span style=\"color: #0000ff;\">PRIMARY KEY<\/span> (ID),<br \/><span style=\"color: #0000ff;\">FOREIGN KEY<\/span> (DepartmentID) <span style=\"color: #0000ff;\">REFERENCES<\/span> Department(ID))<\/p>\n<p><span style=\"color: #0000ff;\">CREATE TABLE<\/span> Demand (ID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>SpecialityID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Amount <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/><span style=\"color: #0000ff;\">PRIMARY KEY<\/span> (ID),<br \/><span style=\"color: #0000ff;\">FOREIGN KEY<\/span> (SpecialityID) <span style=\"color: #0000ff;\">REFERENCES<\/span> Speciality(ID))<\/p>\n<p><span style=\"color: #0000ff;\">CREATE TABLE<\/span> Products (ID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Name <span style=\"color: #0000ff;\">nvarchar<\/span>(40) NOT NULL,<br \/>Price <span style=\"color: #0000ff;\">decimal<\/span>(12, 2) NOT NULL,<br \/><span style=\"color: #0000ff;\">PRIMARY KEY<\/span> (ID))<\/p>\n<p><span style=\"color: #0000ff;\">CREATE TABLE<\/span> CalendarPlan (ID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>ProductID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>DepartmentID <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Quantity <span style=\"color: #0000ff;\">int<\/span> NOT NULL,<br \/>Shelf <span style=\"color: #0000ff;\">date<\/span> NOT NULL,<br \/><span style=\"color: #0000ff;\">PRIMARY KEY<\/span> (ID),<br \/><span style=\"color: #0000ff;\">FOREIGN KEY<\/span> (ProductID) <span style=\"color: #0000ff;\">REFERENCES<\/span> Products(ID),<br \/><span style=\"color: #0000ff;\">FOREIGN KEY<\/span> (DepartmentID) <span style=\"color: #0000ff;\">REFERENCES<\/span> Department(ID))<\/p>\n<p><span style=\"color: #0000ff;\">INSERT INTO<\/span> Department (ID , Name)<br \/><span style=\"color: #0000ff;\">VALUES<\/span> (1 ,\u2019<span style=\"color: #ff0000;\">Bridges Dpt<span style=\"color: #000000;\">\u2018<\/span><\/span>),<br \/>(2 ,\u2019<span style=\"color: #ff0000;\">Wheels Dpt<\/span>\u2018),<br \/>(3 ,\u2019<span style=\"color: #ff0000;\">Hinges Dpt<\/span>\u2018),<br \/>(4 ,\u2019<span style=\"color: #ff0000;\">Generators Dpt<\/span>\u2018),<br \/>(5 ,\u2019<span style=\"color: #ff0000;\">Engines Dpt<\/span>\u2018);<\/p>\n<p><span style=\"color: #0000ff;\">INSERT INTO<\/span> Speciality (ID , DepartmentID , Name, Qualification , Gap)<br \/><span style=\"color: #0000ff;\">VALUES<\/span> (1 ,1, \u2018<span style=\"color: #ff0000;\">Tinker<\/span>\u2018, 2, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">time<\/span>, \u2018<span style=\"color: #ff0000;\">10:00:00<\/span>\u2018)),<br \/>(2 , 2, \u2018 <span style=\"color: #ff0000;\">Mechanic<\/span>\u2018, 1, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">time<\/span>, \u2018<span style=\"color: #ff0000;\">20:00:00<\/span>\u2018)),<br \/>(3 , 3, \u2018 <span style=\"color: #ff0000;\">Locksmith<\/span>\u2018, 5, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">time<\/span>, \u2018<span style=\"color: #ff0000;\">11:00:00<\/span>\u2018)),<br \/>(4 , 4, \u2018<span style=\"color: #ff0000;\">Electrician<\/span> \u2018, 3, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">time<\/span>, \u2018<span style=\"color: #ff0000;\">16:00:00<\/span>\u2018)),<br \/>(5 , 5, \u2018<span style=\"color: #ff0000;\">Tire installer<\/span>\u2018, 4, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">time<\/span>, \u2018<span style=\"color: #ff0000;\">17:00:00<\/span>\u2018));<\/p>\n<p><span style=\"color: #0000ff;\">INSERT INTO<\/span> Demand (ID , SpecialityID , Amount)<br \/><span style=\"color: #0000ff;\">VALUES<\/span> (1 , 1, 4),<br \/>(2 , 2, 2),<br \/>(3 , 3, 1),<br \/>(4 , 4, 3),<br \/>(5 , 5, 6);<\/p>\n<p><span style=\"color: #0000ff;\">INSERT INTO<\/span> Products (ID , Name , Price)<br \/><span style=\"color: #0000ff;\">VALUES<\/span> (1 , \u2018<span style=\"color: #ff0000;\">Wheels\u2019<\/span>, 2500.00),<br \/>(2 , \u2018<span style=\"color: #ff0000;\">Bridge<\/span>\u2018, 2000.00),<br \/>(3 , \u2018<span style=\"color: #ff0000;\">Hinge<\/span>\u2018, 1500.00),<br \/>(4 , \u2018<span style=\"color: #ff0000;\">Generator<\/span>\u2018, 1250.00),<br \/>(5 , \u2018<span style=\"color: #ff0000;\">Engine<\/span>\u2018, 1000.00);<\/p>\n<p><span style=\"color: #0000ff;\">INSERT INTO<\/span> CalendarPlan (ID , ProductID , DepartmentID, Quantity, Shelf)<br \/><span style=\"color: #0000ff;\">VALUES<\/span> (1 , 3, 2, 20, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">date<\/span>, \u2018<span style=\"color: #ff0000;\">30\/09\/1<\/span>5\u2032, 3)),<br \/>(2 , 2, 1, 10, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">date<\/span>, \u2018<span style=\"color: #ff0000;\">25\/09\/15<\/span>\u2018, 3)),<br \/>(3 , 4, 3, 40, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">date<\/span>, \u2018<span style=\"color: #ff0000;\">20\/09\/15<\/span>\u2018, 3)),<br \/>(4 , 5, 5, 70, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">date<\/span>, \u2018<span style=\"color: #ff0000;\">11\/09\/15<\/span>\u2018, 3)),<br \/>(5 , 1, 4, 50, <span style=\"color: #ff00ff;\">CONVERT<\/span>(<span style=\"color: #0000ff;\">date<\/span>, \u2018<span style=\"color: #ff0000;\">10\/09\/15<\/span>\u2018, 3));<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7914\" src=\"https:\/\/assignment.essayshark.com\/blog\/wp-content\/uploads\/2017\/12\/assignment-on-creating-sql-table-relationships-300x213.png\" alt=\"\" width=\"566\" height=\"402\"  \/><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This assignment on SQL table relationships was completed by an expert who is knowledgeable in the IT sphere. You can read this sample, but you can\u2019t present it as your own homework. On our blog, in addition to this sample, <a href=\"https:\/\/www.benedictsol.com\/blogs\/assignment-on-creating-sql-table-relationships\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,25],"tags":[],"class_list":["post-434553","post","type-post","status-publish","format-standard","hentry","category-essay-paper-writing","category-samples"],"_links":{"self":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/434553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/comments?post=434553"}],"version-history":[{"count":0,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/posts\/434553\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/media?parent=434553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/categories?post=434553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.benedictsol.com\/blogs\/wp-json\/wp\/v2\/tags?post=434553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}