Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To implement and to test SQL script file solution1.sql you can either use graphical user interface SQL Developer or command line interface mysql. To create

image text in transcribedimage text in transcribedimage text in transcribed

To implement and to test SQL script file solution1.sql you can either use graphical user interface SQL Developer or command line interface mysql. To create a report from processing of a script file solution1.sql open a Terminal window and start the command line interface mysql in the following way: mysql -u csit115 -p -v -C Next, process SQL script solution1.sql and save a report in a file solutioni.rpt. Note, that when started with the options -v and -c the command line interface includes both listing of SELECT statements processed and the comments included in the original version of a file solution1.sql. We have already practiced saving a report from processing of SQL script in the Laboratory 2. You can also find more information about creating reports from processing of SQL scripts in Cookbook, Recipe 3.1 How to use "mysql? Command based interface to MySQL database server? Step 4 How to save the results of SQL processing in a file?" A report that contains no listing of processed SQL statements scores no marks and report that contains errors of any kind also scores no marks ! Deliverables A file solution1.rpt with a report from processing of SQL script solutioni.sql. The report must be created with the command line interface mysql. the report MUST NOT include any errors, and the report must list all SQL statements processed and all comments included in the original (downloaded) version of solution1.sql. Marks will be deducted for the missing comments. Submission of a file with a different name and/or different extension and/or different type scores no marks. Tasks Task 1 (5 marks) An objective of this task is to implement SQL script that verifies the following logical consistency constraint imposed on the contents of a sample database. "Each trip must have at least I leg and at most 5 legs" Download a file solution1.sql and insert into the file the implementations of the following actions. (1) First, the script modifies a sample database, such after the modifications, the database contains at least one trip with no legs and at least one trip with more than 5 legs. (2) Next, the script creates and inserts into a relational table MESSAGE information about the contents of a sample database that violate the following consistency constraint. "Each trip must have at least 1 leg and at most 5 legs" The script must list the outcomes of verification of the consistency constraint as the following messages inserted into a relational table MESSAGE. Trip has more than five legs For example, if a trip number 100 has no legs then the verification of the consistency constraint must return the following message. The script must list the outcomes of verification of the consistency constraint as the following messages inserted into a relational table MESSAGE. Trip has no legs or Trip has more than five legs For example, if a trip number 100 has no legs then the verification of the consistency constraint must return the following message. The script must list the outcomes of verification of the consistency constraint as the following messages inserted into a relational table MESSAGE. Trip has no legs or Trip

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Describe the eight-step category management cycle.

Answered: 1 week ago