Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Query 1. Write one DDL statement to perform the following two modifications. (1)

ID: 3735077 • Letter: Q

Question

Query 1.

Write one DDL statement to perform the following two modifications.

(1) Change the data type of GPA in Student table to allow a GPA value of three decimal digits to be stored.

(2) Allow no NULL values in GPA column.

Query 2.

Write one DDL statement to add a new column AssignDate of date type in

ProjAssignment table, which should allow no null values. Because there are already existing rows in the table which have no AssignDate data, your DDL statement should define a default

value of current date in this column. When this statement is executed, it will therefore update the AssignDate of every existing row with a current date.

Query 3.

Write one DDL statement to add a new table Project into exam1. It contains the following three columns:

- ProjNum of char(3) type, which is the primary key of Project.

- Pname of varchar(30) type, which could be null. If it has a value, its first three characters must be 'UH2' or 'UB5'.

- Budget of smallmoney type, which cannot be null and must have aminimum of $1,500.

Student StulD GPA ProjAssignment Pno StulD

Explanation / Answer

Answer is as follows:

a)

ALTER Student ALTER GPA Float(10,3) NOT NULL ;

Where Student is table name and GPA is column of student and float is type with 10 deigits with 3 floatoing point preciosn, NOT NULL is constriant to declar no null.

b)

ALTER ProjAssignment ADD AssignDatw Date DEFAUT getdate() NOT NULL;

Default is keyword to set default date fetch by function getdate() i.e. current date.

c)

CREATE TABLE Project(ProjNum char(3) PRIMARY KEY, Pname Varchar(30) NOT NULL , Budget smallmoney(1500) NOT NULL;

if there is any query or missing part please ask in comments before down-voting..