Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE TABLE Dentists ( DentID char(4) PRIMARY KEY, FirstName varchar(30) NOT NULL, LastName varchar(30) NOT NULL, Email varchar(30), Office char(4) ); CREATE TABLE Patients (

image text in transcribed

image text in transcribed

image text in transcribed

CREATE TABLE Dentists ( DentID char(4) PRIMARY KEY, FirstName varchar(30) NOT NULL, LastName varchar(30) NOT NULL, Email varchar(30), Office char(4) ); CREATE TABLE Patients ( RatID char(4) PRIMARY KEY, FirstName varchar(30) NOT NULL, LastLame varchar(30) NOT NULL, Address varchar(60), Email varchar(60), Inse o varchar(30) ) CREATE TABLE Procedures ( ProcCode char(4) PRIMARY KEY, ProcName varchar(30) NOT NULL, ProcDesc varchar(30), Cost numeric ); CREATE TABLE Appointments ( AnptDateTime DATE, PatID char(4), DentID char(4) NOT NULL, Preccede char(4) NOT NULL, PRIMARY KEY (ARtDateTime, PatID), FOREIGN KEY (PatID) REFERENCES Patients(RatID), FOREIGN KEY (DertID) REFERENCES Dentists(DentID), FOREIGN KEY (BrocCode) REFERENCES Procedures(RtoeCede) ); CREATE TABLE Employees ( EmpID char(4) PRIMARY KEY, FirstName varchar(30) NOT NULL, LastName varchar(30) NOT NULL, Address varchar(60), DeptCode char(4), Salary numeric, Email varchar(30) ); CREATE TABLE Depts ( DeptID char(4) PRIMARY KEY, DeptName varchar(30) NOT NULL, DeptLocation varchar(30) ); CREATE TABLE Accounts ( AcstNo char(4) PRIMARY KEY, Owner varchar(30) NOT NULL, Address varchar(60), Type varchar(10), Balance numeric ); For this assignment, use your Dentist Office tables you created in Assign \#7. Use just the 4 Dentist Office tables 1.) INSERT : Using SQL, Insert 4 rows of data to each of the Dentist Office tables that you created in Assign \#7. Just make up the data that you add. You should have at least 16 SQL Insert statements to hand in. Print out these SQL statements to hand them in. 2.) DELETE: Next, again using SQL, Delete the last 2 rows in each table from your Database. Use SQL Delete statements. Delete using a where clause based on the Primary key in each table. Print these SQL statements and hand them in. You should have at least 8 Delete statements. 3.) UPDATE: Lastly, change all the lastnames in your "Dentists" table to "Moore". Also change the firstname of the last row of data in each possible table, to "Frank". Change any zipcodes from CA to 90000. You should have at least 3 update statements. 4.) DROP Table: Finally, remove the entire Procedures Table

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

=+ how might this lead to faster growth in productivity?

Answered: 1 week ago