Share
Explore BrainMass

SQL DDL and DML Queries

Hi,

See attached file for assignment problems.

Thank you

DDL and DML

1. For emp table, set the constraint that Hiredate is later than Jan. 1, 1980.

2. Modify Dept table so that dname column can contain up to 20 characters.

3. Define ProdId+StartDate as the primary key for Price table.

4. Insert this row of data into price table:

Prodid= 200380, stdprice =5, minprice =4.4, startDate =today, EndDate =null.

5. Delete the row added in the previous step from Price table using Delete from (not rollback).

Q18-Q20 require using data dictionary items. Use one SQL for each.
18. Find all check constraints defined on emp. In the result, list name of the constraint.)
19. Find all tables in your account. Return the table names as output.
20. Find all foreign key constraints defined on emp table and on dept table. In the list, list the name of the constraint and which table it is defined on. USE only one SQL statement to accomplish this.)

Attachments

Solution Summary

This solution deals with a set of eight DDL and DML queries. Most of the queries are based on basic DDL and DML commands.

$2.19