Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Consider the conceptual schema given below. Your task is to perform the steps of logical database design, i.e. to transform a conceptual schema given above into a collection of relational...

1 answer below »





Consider the conceptual schema given below.



Your task is to perform the steps of logical database design, i.e. to transform a conceptual schema given above into a collection of relational schemas.



Before transforming

add the attribute ‘
phone
’ to the

BRANCH and

the attribute ‘
mobile-phone
’

to the CUSTOMER class.



Draw the resulting conceptual schema adding

your name
,

student number

and

the date

to the drawing. Use UMLet and paste images of your drawings into your Microsoft Word document using the template provided.



List the names of attributes, primary key, candidate keys (if any), and foreign keys (if any) for each class in the relational schema. Assume that an

association method

is used to implement the generalisation.



Show your working and explain as you step through the transformation process
.
Convert your Microsoft Word document based on the template provided into a pdf and submit your answer



as a file

question1.pdf






DPIT115 Data Management and Security Final Assessment (Summer 2022)







QUESTION 2 (10 marks)



Write the data definition statements of SQL that modify the structures of a database listed on page 2 of this assessment in the way described below.



Note, that some of the modifications may require more than one SQL data definition statement.





  1. (1) Modify the consistency constraint of the sample database such that after the modification, it is possible to record in the database information about the trucks that have a capacity up to and including

    225
    .



    (2 marks)





  2. (2) Modify the structure and consistency constraints of the sample database such that after the modification, it is possible to store information in the database about the total number of legs a trip contains. Assume that a trip cannot contain more than

    10

    legs.



    (2 marks)





  3. (3) Modify the structure of the sample database so it is possible to store information in a new table in the database about mechanics employed by a transportation company. Assume that a description of a mechanic consists of an

    employee number
    ,

    first name
    ,

    last name
    ,

    date of birth

    and

    qualification level
    . A qualification level is a positive integer number

    1

    or

    2

    or

    3

    or

    4

    or

    5 or 6
    . Remember that a mechanic is an employee.



    (2 marks)





  4. (4) Modify the consistency constraints of the sample database, so it is possible to store information about the

    trip

    without providing information about a

    driver licence number
    . Such modification is required when a driver leaves a transportation company, and we would like to keep information about all

    trips

    performed by the driver.



    (2 marks)





  5. (5) Explain how the use of

    consistency constraints

    supports the management of data security. Use original examples that you make up yourself to illustrate your answer.



    (2 marks)





Add your code into the

question2.sql

template provided and output your report file on your virtual machine



to a file named

question2.rpt
.
Add

your name
,

student number

and

the date

to the comments section of your SQL script.



Submit your answers as the files

question2.sql
,
question2.rpt

and

question2.pdf

using the templates provided.



Note your script may be tested and should not have any errors when run.



If a submitted file has an incorrect filename or file type, it may lose marks.







Page

4

of

6











DPIT115 Data Management and Security Final Assessment (Summer 2022)







QUESTION 3 (10 marks)



Write the data manipulation statements of SQL that modify the contents of a database listed on page 2 of this lab task in the ways described below.



Note that you are not allowed to modify and/or to drop any consistency constraints. Also note, that to implement some of the modifications listed below, you may need more than one data manipulation statement.





  1. (1) A new trip has been completed today. The trip was from

    Wollongong

    to

    Orange
    . The trip has been performed by the driver with the licence number

    412443

    (column

    LICENSENUM

    in a relational table

    TRIP
    ) who used the truck with registration number

    AD29FZ
    . Insert the appropriate information into the sample database assuming the next trip number is

    3452
    .



    (2 marks)





  2. (2) Delete the information from the database about trip number

    53
    . Remember, that the foreign keys in



    all

    CREATE TABLE

    statements have no

    ON DELETE CASCADE

    clause.



    (2 marks)





  3. (3) Change the status of all the drivers who have performed more than

    24

    trips to be

    ON LEAVE
    .



    (2 marks)





  4. (4) Copy information about all employees born before the year

    2000

    to a new table

    S20CENT
    . There is no need to enforce any consistency constraints on the new table.



    (2 marks)





  5. (5) Explain how the

    Data Definition Languate

    (
    DDL
    ) statements of SQL are used in data management and security. Use original examples including sample code that you make up yourself to illustrate your answer.



    (2 marks)





Submit your answer as files named

question3.sql

and

question3.pdf

using the templates provided. Add

your name
,

student number

and

the date

to the comments section of your SQL script.


If a submitted file has an incorrect filename or file type, it may lose marks.








DPIT115 Data Management and Security Final Assessment (Summer 2022)







QUESTION 4 (10 marks)



Assume that the user

root

with a password '
DPIT115
' created a database called

transport

and the user

‘root’

executed CREATE TABLE statements given on page 2 of the examination paper to create the relational tables in the database transport.



Write a SQL script that performs the following operations the user

‘
root
’
. Assume that the user

‘
root
’

has already connected to the database.





  1. (1) The user

    ‘
    roo
    t
    ’

    nominates a database

    transport

    as a default database, and then the user creates two roles

    ‘
    driver
    ’

    and

    ‘
    admin
    ’
    .



    (1 mark)





  2. (2) The user

    ‘
    root
    ’

    grants read access rights to the relational tables EMPLOYEE and DRIVER to the role

    ‘
    admin
    ’
    . The read access rights cannot be propagated to other roles or users.



    (1 mark)





  3. (3) The user

    ‘
    root
    ’

    grants the rights to insert the rows into a relational tables TRIP and TRIPLEG to



    the role

    ‘
    driver
    ’
    . The access rights can be propagated to other roles or users.





  4. (4) The user

    ‘
    root
    ’

    grants the update privilege on all relational tables in the

    transport

    database to the









role

‘
admin
’
. The privilege cannot be propagated to other roles or users.





  1. (5) The user

    ‘
    root
    ’

    grants the read access rights to information about the total number of trips



    performed by each driver to a role

    ‘
    driver
    ’
    .



    (1 mark)





  2. (6) The user

    ‘
    root
    ’

    creates

    five (5)

    new users and grants the role

    ‘
    driver
    ’

    to

    two (2)

    of the users, and the role

    ‘
    admin
    ’

    to the

    all

    other users. The names and passwords of the new user accounts are up to you. (1 mark)





  3. (7) The user

    ‘
    root
    ’

    sets the resource limits for the users created in the previous step allowing

    ten (10)

    maximum concurrent connections. Finally, the user

    ‘
    root
    ’

    locks all the user accounts created in the previous step. (1 mark)





  4. (8) Explain in your own words the difference between

    Authentication

    and

    Authorisation
    . Use original examples that you make up yourself and diagrams that you draw yourself to illustrate your





answer. (3 marks)



Add your code into the

question4.sql

template provided and output your report file on your virtual machine to a file named

question4.rpt



Add

your name
,

student number

and

the date

to the comments section of your SQL script.
Submit your answers as files named

question4.sql
,

question4.rpt

and

question4.pdf,

use the templates



provided.
Note your script may be tested and should not have any errors when run.


If a submitted file has an incorrect filename or file type, it may lose marks.



END OF ASSESSMENT
















Answered Same Day Jan 17, 2023

Solution

Aditi answered on Jan 17 2023
47 Votes
Question 2
1. Modify the consistency constraint of the sample database such that after the modification, it is possible to record in the database information about the trucks that have a capacity up to and including 225.
SQL:
CREATE TABLE TRUCK(
REGNUM VARCHAR(10) NOT NULL, /* Registration number */ CAPACITY DECIMAL(7) NOT NULL, /* Capacity *
WEIGHT DECIMAL(7) NOT NULL, /* Weight *
STATUS VARCHAR(10) NOT NULL, /* Present status */ CONSTRAINT TRUCK_PKEY PRIMARY KEY(REGNUM),
CONSTRAINT TRUCK_STATUS CHECK ( STATUS IN ('AVAILABLE', 'USED', 'MAINTAINED')), CONSTRAINT TRUCK_WEIGHT CHECK ( WEIGHT > 0.0 AND WEIGHT < 225), CONSTRAINT TRUCK_CAPACITY CHECK ( CAPACITY > 0.0 AND CAPACITY <= 225 )
);
2. Modify the structure and consistency constraints of the sample database such that after the modification, it is possible to store information in the database about the total number of legs a trip contains. Assume that a trip cannot contain more than 10 legs.
SQL:
CREATE TABLE TRIP(
TRIPNUM DECIMAL(10) NOT NULL, /* Trip number */ LICENSENUM DECIMAL(8) NOT NULL, /* Driving license number */ REGNUM VARCHAR(10) NOT NULL, /* Truck registration number */ TDATE DATE NOT NULL, /* Trip date *
LEGSNUM DECIMAL(7) NOT NULL, /* Number of legs */ CONSTRAINT TRIP_PKEY PRIMARY KEY...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here