Question: Data base question please give a answer as brief as possible 2. (30points, each 5 points)Consider the detection relational database for a detection enterprise with

Data base question
please give a answer as brief as possible
 Data base questionplease give a answer as brief as possible 2.

2. (30points, each 5 points)Consider the detection relational database for a detection enterprise with 3 relations as follows: project(projectcode,createdate, projectname) projectcode:code of a project; createdate: when the project was created in system; projectname: project name; projectcode is the primary key of this relation. contact(contactcode, contactname, amount, startdate, enddate, projectcode), contactcode: contact code; contactname:contact name; amount: the total amount for this project; startdate: the beginning date of this contact; enddate: the enddate of this contact: projectcode:the project code which this contact belongs to is a foreign key. sample(samplecode,samplename,tensilevalue,testtime,contactcode), samplecode: the sample code; samplename: the sample name; tensilevalue:the tensile value for this sample; testtime: test time for this sample; contactcode: the contact code which this sample belongs to is a foreign key. A project has possibly several contacts and a contact belongs to one sole project. One contact may have several samples and a sample belongs to sole contact. The primary keys are underlined by solid lines. Please give the SQL statements for the following problems: (1)Create table project with suitable data type for each attribute. You are required to define projectcode as the primary key. (2)Retrival the contactname which containing the letter ' v '. (3)Retrival the projectcode and projectname which is created after "2016-01-01". (4)Retrival each project code and its average amount according to contact relation. (5)Retrival sample name, tensilevalue and corresponding contact name which belongs to the contact whose code is "2020101". (6)increase 10\% of tensilevalue for all the sample rows which belong to the contact with code "2020102

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!