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

create database DDLPractice use DDLPractice create table authors au id char (11)

ID: 3876397 • Letter: C

Question

create database DDLPractice use DDLPractice create table authors au id char (11) not null primary key, au_lname varchar (40) not null, au_fname varchar(20) not null, phone char(12) null, address varchar (40) null, city varchar(20) null, au_state char(2) null, zip char(5) null create table publishers pub_id char (4) not null primary key, pub_name varchar (40) null, address varchar (40) null, city varchar(20) null, pub_state char (2) null create table titles title_id char(6) not null primary key, title varchar (80) not null, title_type char (12) nul1, pub_id char (4) null references publishers (pub_id) price money null, pubdate smalldatetime null

Explanation / Answer

create database DDLPractice use DDLPractice
go
use DDLPractice
go

create table authors (
au_id char(11) not null primary key,
au_lname varchar(40) not null,
au_fname varchar(20) not null,
phone char(12) null,
address varchar (40) null,
city varchar(20) null,
au_state char(2) null,
zip char(5) null
)
go

create table publishers (
pub_id char(4) not null primary key,
pub_name varchar(40) null,
address varchar(40) null,
city varchar(20) null,
pub_state char (2) null
)
go

create table titles (
title_id char(6) not null primary key,
title varchar (80) not null,
title_type char (12) nul1,
pub_id char (4) null
   references publishers (pub_id),
price money null,
pubdate smalldatetime null
)
go