PLZ help with the following: Populate every relation with “sufficient” representative rows (at least 4 for each table). CREATE TABLE BOOK( BookNo int primary key, Title varchar(100) not null , Subject varchar(70) not null, PublicationYear int not null); CREATE TABLE AUTHOR(AuthorID int primary key , FirstName varchar(100) not null, LastName varchar(100) not null, BirthYear int); CREATE TABLE CLIENT(ClientID int primary key, FirstName varchar(100) not null, LastName varchar(100) not null, ClientType char(1), constraint checkType check (ClientType in ('F', 'S'))); CREATE TABLE BOOKAUTHOR(BookNo int not null, AuthorID int not null, Primary key (bookNo, AuthorID), Constraint bookauth foreign key (bookNo) references BOOK(bookno), Constraint authbook foreign key (AuthorID) references AUTHOR(AuthorID)); CREATE TABLE CHECKOUT(ClientID int not null, BookNo int not null , CheckOutDate date not null, ReturnDueDate date not null, CheckInDate date null, primary key (ClientID, BookNo,CheckOutDate), Constraint bookcheck foreign key (bookNo) references BOOK(bookno), Constraint clientcheck foreign key (clientID) references CLIENT(ClientID));
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
PLZ help with the following:
-
Populate every relation with “sufficient” representative rows (at least 4 for each table).
CREATE TABLE BOOK( BookNo int primary key, Title varchar(100) not null , Subject varchar(70) not null, PublicationYear int not null);
CREATE TABLE AUTHOR(AuthorID int primary key , FirstName varchar(100) not null, LastName varchar(100) not null, BirthYear int);
CREATE TABLE CLIENT(ClientID int primary key, FirstName varchar(100) not null, LastName varchar(100) not null, ClientType
char(1), constraint checkType check (ClientType in ('F', 'S')));
CREATE TABLE BOOKAUTHOR(BookNo int not null, AuthorID int not null,
Primary key (bookNo, AuthorID),
Constraint bookauth foreign key (bookNo) references BOOK(bookno),
Constraint authbook foreign key (AuthorID) references AUTHOR(AuthorID));
CREATE TABLE CHECKOUT(ClientID int not null, BookNo int not null , CheckOutDate date not null, ReturnDueDate date not null,
CheckInDate date null, primary key (ClientID, BookNo,CheckOutDate),
Constraint bookcheck foreign key (bookNo) references BOOK(bookno),
Constraint clientcheck foreign key (clientID) references CLIENT(ClientID));

Step by step
Solved in 7 steps with 5 images









